Click here to Skip to main content
15,881,898 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

Gridview inside a fieldset as below

ASP.NET
<fieldset id="fieldSet" style="display: block;width:99%;vertical-align: text-top;">
   <legend>Student Report</legend>
   <table border="0" width="100%">
    <tr>
     <td>
     <br />
         <asp:UpdatePanel runat="server" ID="updtPanel">
         <ContentTemplate>
         <div id="scrolldiv">

         <asp:GridView ID="studentReportGrid" runat="server" AutoGenerateColumns="false" HeaderStyle-BackColor="#0080C0"
         HeaderStyle-Width="200" HeaderStyle-ForeColor="White" Width="100%" RowStyle-HorizontalAlign="Left" AllowPaging="true" PageSize="3"
         OnPageIndexChanging="studentReportGrid_PageIndexChanging">
          <Columns>
           <asp:templatefield HeaderText="Date&time" HeaderStyle-HorizontalAlign="Left">
            <itemtemplate>
            </itemtemplate>
           </asp:templatefield>
           <asp:BoundField DataField="STUDENT_NAME" HeaderText="Student name" ReadOnly="True"  HeaderStyle-HorizontalAlign="Left" />
           <asp:BoundField DataField="STUDENT_ID" HeaderText="Id"  HeaderStyle-HorizontalAlign="Left"/>
           <asp:BoundField DataField="VEHICLE_NUMBER" HeaderText="Vehicle_no"  HeaderStyle-HorizontalAlign="Left"/>
           <asp:templatefield HeaderText="Entry_location" HeaderStyle-HorizontalAlign="Left">
            <itemtemplate>
            </itemtemplate>
           </asp:templatefield>
           <asp:templatefield HeaderText="Exit_location" HeaderStyle-HorizontalAlign="Left">
            <itemtemplate>
            </itemtemplate>
          </asp:templatefield>
         </Columns>
        </asp:GridView>
        </div>
        </ContentTemplate>
        <Triggers>
          <asp:AsyncPostBackTrigger ControlID="generateReportbtn" EventName="click" />
          <asp:AsyncPostBackTrigger ControlID="hdnBtn" EventName="click" />
       </Triggers>
       </asp:UpdatePanel>
     </td>
    </tr>
    <tr>
     <td>
     </td>
    </tr>
 </table>
</fieldset>


When i see the page in browser, gridview is missing. what could be the reason?


Thanks..
Posted

check the properties of your div that contains the grid i.e.,
<div id="scrolldiv">

ensure that you are not using any css on it that restricts it's width/height and/or visibility.

Regards
Pawan
 
Share this answer
 
First put this tag in your gridview control and check there is data or not...

C#
<EmptyDataTemplate>no record found</EmptyDataTemplate>


AND
Where is your DATASOURCE..???
(if datasource in code then you applied databind() function after it or not)..
place your datasource code also in your question for detail


Thank you
Asp.Net/C#.Net Help[^]
Hemant Singh
 
Share this answer
 
Possiblities are in scrolldiv(check out the CSS code).or the dataset does not return any resultset.

Thanks
 
Share this answer
 
Hello,

I Think You not Provide Any Data Sourec Either In Code Behinf or Source Code It Thats why Your GridView Not Display Any Data.
And Of Cause If Your DataSource Empty Than it will not give any Records For That Case used
<EmptyDataTemplate>no record found</EmptyDataTemplate>


I hope Your Problem Will Solve If Not Please Give Your Comment....
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900