Reputation: 39
I have a gridview in my Master page.I have taken an item template inside it. I have given some text to the controls initially. In the design view of the content page gridview is visible but while running the page it's not showing gridview. when i deleted gridview and put some simple text in place of it ,it's working .
i tried setting z- index and some peculiar things but nothing seems to work.Please help me out
Upvotes: 0
Views: 803
Reputation: 17380
Try setting the EmptyDataText
to something and see if it shows the text. If it does, it means it is not DataBound
to anything, or the DataSource
has no rows. Good luck!
Upvotes: 0
Reputation: 4469
Confirm the below cases to show the gridview, listed below:
a. Must have to put "DataSource" and then call DataBind() method, like
gridViewToShow.DataSource = dataSourceName; // may be table or custom data source
gridViewToShow.DataBind();
b. Data must exists in the "DataSource" c. Locate data field( <%# Eval("DataFieldName") %> ) to Gridview column, like in aspx code c. Make it visible (or don't make invisible, by default it is true) d. If you use CssClass, then make sure there has "display:block;" or has no "display:none;"
Hope these would be very helpful.
Upvotes: 0
Reputation: 94653
There may be number of causes - you might not bind it or datasource
is empty or its visibility state is hidden
or you have placed GridView
inside the ContantPlaceHolder
in master page.
Upvotes: 2