I have two Datagridview which is bind to a datasource, I want to add a particular row from first gridview to another gridview, when click on my Checked Box field.
My Gridview1 Column Name
ID(Autogenrate) Name Class
Gridview2 Column Name
ID Name Class Address CheckedBoxColumn

Amit ChoudharyRank #145 · 15.8K reputationPosted Jul 9, 2010, 4:18 AM EDT
there are two ways to do it.. either user javascript or you can do it from server side code...
attach your files here i can help you..
Ajay Gautam84 reputationPosted Jul 9, 2010, 8:28 PM EDT
I implemented same type of functionality.
try this
Take one Isvalid parameter in aspx with checkbox and on server side make it true or false then populate that column in your datasource.
The values which are true bind those rows for second gridview and which are false bind those for first gridview depends on your codition. You can easliy divide the datasource by 2 datatables based on Isvalid value then bind both grid
let me know, i can send you my code for reference.
Saqib Malick14 reputationPosted Jul 18, 2010, 10:27 PM EDT
DataGridView dvgView = view_Fee_Schedule_ByClassDataGridView ; DataGridView dvgReceiptDetail = tblFeeRecieptDetailDataGridView; foreach (DataGridViewRow dvgViewRow in dvgView .Rows ){ if (Convert.ToBoolean(dvgViewRow.Cells["AddFeeDVGCheckBox"].Value) == true) { for (int i = 1; i int feeRecptID; feeRecptID = Convert.ToInt32(feeRecieptIDTextBox.Text); int feeSchdID; feeSchdID = Convert .ToInt32( dvgViewRow.Cells[0].Value); this.tblFeeRecieptDetailTableAdapter.InsertQuery(feeRecptID, feeSchdID, 4); } } }