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 ChaudharyRank #1,379 · 1.2K reputationPosted Jul 22, 2012, 5:32 AM EDT
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 ) { }
rashmi kc89 reputationPosted Jul 22, 2012, 6:05 AM EDT
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
Sudhakar ChaudharyRank #1,379 · 1.2K reputationPosted Jul 22, 2012, 6:28 AM EDT
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 kc89 reputationPosted Jul 22, 2012, 7:19 AM EDT
Sudhakar ChaudharyRank #1,379 · 1.2K reputationPosted Jul 22, 2012, 7:38 AM EDT