I have made a grid view in asp.net, when there is no record, grid is not shown, i want that if there is no record, grid must be shown, but there must be a message, record not found with gridview headers available. I mean gridview must be there, but instead of rows there should be a message in it, record not found, i have not used any code for fetching data in string, i just used datasource, please help.
Share
The
GridViewhas anEmptyDataTextproperty, where if there is no record found it will be displayed.If you want to show the header of
GridView, then you can make theDataTablehave all the columns that are in yourDataSourceand add an Empty Row and bind thatDataTableif your originalDataSourcedoes not contain data.