View Single Post
  #92 (permalink)  
Old 09-04-2007, 04:14 AM
sathian sathian is offline
D-Web Analyst
 
Join Date: Aug 2007
Posts: 252
sathian is on a distinguished road
Thumbs up Re: ASP.NET Data Controls

hi,

After the user makes the selection using checkboxes and hits the insert button which is present outside the gridview i have to get the selection datakeys for inserting into database, how do i get this index for each row, can you suggest?
One more question Allen as the people gridview has paging when i go to the second page the checkboxes selected in the first page are unchecked, so is there a way to maintain the selection during paging. Cheers, Shilpa.
GridView people = (GridView)grdCompanyPeople.Rows[Index].FindControl("grdPersons");foreach (GridViewRow row in people.Rows)
{
if (row.RowType = DataControlRowType.DataRow)
{
bool isChecked = ((CheckBox)row.FindControl("chkSelect")).Checked;
if (isChecked)
{
str.Append(People.DataKeys[row.RowIndex]["PersonID"].ToString() + ",");
}
}
Reply With Quote