1
Answer

Operating Checkboxes in the Gridview

asif basha

asif basha

15y
4.8k
1
Hi,

I am new in asp.net and need some guidance. I have a gridview and have added a check box besides each row.



For example In gmail If we see the inbox down one Select Hypherlink where when clicks checks all the checkboxes of the mails and when click on the button Delete I will delete and When select some labels from the "Move" drop downlist.........How to do that

besides I have an insert button at the bottom where when click checks all the heckboxes and should be able to store the Grid data on to a table

How to do all this please explain me with an example
Answers (1)
1
Vulpes
NA 98.3k 1.5m 10y
A DataTable in ADO.NET has no concept of a 'current row' because, once it's been populated, it's disconnected from the underlying database. In fact, it doesn't need to have an underlying database at all - it can be created entirely using code!

Once you have your DataTable (dt, say), you can iterate through its DataRows just like any other collection:

foreach(DataRow dr in dt.Rows)
{
   // do something with dr
}

You can also obtain a DataRow directly:

DataRow rowFirst = dt.Rows[0];

DataRow rowLast = dt.Rows[dt.Rows.Count - 1];

It follows that there's no concept of being before the first row or after the last row (BOF or EOF in an ADO RecordSet). You must always be within the row collection itself or you'll get an exception.


0
David Smith
NA 1.9k 0 10y
Thank you so much.