Last post Jul 04, 2013 02:31 AM by Amy Peng - MSFT
Jun 26, 2013 02:21 AM|San2ASP|LINK
Hi, In my web-application I have a gridView having 30 rows(I added them using dataTable), which is fixed and in The "serial no" column I have added data from 1 to 30. So, The gridView is also showing 30 rows. I made a buttonOnClick event to save the data
in sql table. uptill it is working fine. But I want to show the data, saved by user, from sqlDB in the same gridview. Like if there is already 5 rows in DB-table it will be shown to the gridView's first 5 rows,and the remaining 25 rows will be blank.Can it
is possible.Plz help!!!
Jun 26, 2013 02:33 AM|smartymca|LINK
Yes you can do it with the following ways : -
1) You can set some flag which differentiate sql table with Datatable, check flag in rowdataboud event and show blank rows as per your flag.
2) when you are saving rows in sql table, suppose you are saving only 5 then save other 25 rows as text "Blank" and then bind sql table with grid. It will show 5 records and remaining row it will show as "blank"
Jun 26, 2013 02:41 AM|San2ASP|LINK
Thanks smartymca, hope it will help me. Can you give me any link regurding to flag, as till now i have not used it.Thanx again!!
Jul 04, 2013 02:31 AM|Amy Peng - MSFT|LINK
It will be easy to use flag. If flag=1 means this row will be blank, if the flag=0, then this row will show:
select * from table where flag=1 //......blank row;
select * from table where flag=0//......not blank row.
Hope it can help you.