Last post Feb 01, 2010 12:54 AM by decker dong - msft
Jan 29, 2010 06:59 AM|gomzy.net|LINK
I want to insert a record in the gridview and i have designed it as the fig: below shows.
Initially there is no data in the datatable to which the gridview is bound to,so the gridview is not displayed when the page load,ok
I want to ask that is it possible to display Gridview on page load with only the header and the footer?
i.e;the user can see the header names and the textbox and drop down list at the foorter so that they can insert data in the grid?
Jan 29, 2010 12:09 PM|Aquaren|LINK
Try using the <EmptyDataTemplate>
Jan 29, 2010 12:20 PM|niksv|LINK
if you are using SqlDataSource, modify selectcommand to look like below (assuming your table is Table1 and has a field called Field1),
SelectCommand="SELECT field1 FROM table1 union all select '' from table1 having count(Field1) =0"
If there is rows in your table1, it will return the rows correctly, otherwise it will return a blank row. The
footer will still be shown in either situation.
Jan 29, 2010 12:21 PM|niksv|LINK
Or another lengthy but sureshot solution is here
Feb 01, 2010 12:54 AM|Decker Dong - MSFT|LINK
Of course you can use it in the GridView FooterRow, please try this: