Sir here I hav attached my project
Once i select the main from combo and press the random generatingbutton , after that clicking on select button and press the Transfer button the data from the grid view should transfer to another gridview
How to transfer??
Loading
Sudhakar ChaudharyPosted Jul 22, 2012, 9:32 AM
it works on select row in datagridview1. in both case like one row selected or all row selected.
try
{
dataGridView2.Rows.Clear();
for (int i = 0; i < dataGridView2.Rows.Count; i++)
{
if (Convert.ToBoolean(dataGridView1.Rows[i].Cells[0].Value) == true)
{
dataGridView2.Rows.Add();
dataGridView2.Rows[i].Cells[0].Value = true;
dataGridView2.Rows[i].Cells[1].Value = dataGridView1.Rows[i].Cells[1].Value;
}
}
}
catch (Exception ) { }
Sudhakar ChaudharyPosted Jul 22, 2012, 11:38 AM
rashmi kcPosted Jul 22, 2012, 11:19 AM
Sudhakar ChaudharyPosted Jul 22, 2012, 10:28 AM
try
{
for (int i = 0; i < dataGridView1.Rows.Count; i++)
{
if (Convert.ToBoolean(dataGridView1.Rows[i].Cells[0].Value) == true)
{
int irow = dataGridView2.Rows.Count;
dataGridView2.Rows.Add();
dataGridView2.Rows[irow-1].Cells[0].Value = true;
dataGridView2.Rows[irow-1].Cells[1].Value = dataGridView1.Rows[i].Cells[1].Value;
}
}
}
catch (Exception s) { MessageBox.Show(s.ToString()); }
rashmi kcPosted Jul 22, 2012, 10:05 AM
If i select 2 question on first click on generate button it should be added to datagridview2
If i select four questions on second click on generate button these 4 questions should be added along with the 2 questions to in datagridview2 totaly 6 question should be ther
and similary one selecting new questions questions should be added in datagridview2
how to do this...........
.
In this code only one time it s transfering .
if i select for the next generating question it s not adding to the gridview along with the first set of question