Click here to Skip to main content
15,909,829 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hi friends,

I have a gridview, in that gridview there is checkbox, one databound item, textbox, dropdownlist, radio button.

when checkbox checked then that particular row data of the gridview which containing the datas in databound item, textbox, and dropdownlist selected item should get store to database by pressing submit button.

please reply..

Cheers JAGADiSH...
Posted
Comments
Sunasara Imdadhusen 28-Feb-11 0:30am    
Did you try anything before?

I assume that you can update more than one record by selecting multiple check box.

On Submit buttons click event make following code.

C#
for (int i = 0; i < grdDisplayAll.Rows.Count; i++)
{
  string id;
  //Here it is assume that your first cell contains CheckBox
  if (Convert.ToBoolean(grdDisplayAll.Rows[i].Cells[0].Value) == true)
  {
       //Make Code here to update record.
       id = grdDisplayAll.Rows[i].Cells["Id"].Value.ToString();
       //You may Use ColunIdex instead of ColumnId (i.e Here "Id")
  }
}



Mark as Answer/Solution if it is helpful to you. :-O :)
 
Share this answer
 
There are two scenarios that

1. if your grid is editable, means provides inline editing and then want to save grid to database refer this[^] link.

2. if your grid is just generated one time, no more editing has been provided then refer this[^] link.



HTH
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900