Click here to Skip to main content
15,895,142 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Het frnds,I have datagridview(dgv) in my project 3 f dem.
the first gridview gets populated on my find btn,
I need to select values in my 2nd dgv and on the basis of the value selected in 2nd
the 3rd dgv gets filled.
My prob is dat wen i select value in the combox in 2nd dgv n press enter it goes
the cursor goes on the next row whos index is passed in my 3rd dgv.
PLs help.Its urgent.

I tried using the KeyDown event of 2nd dgv but it doesnt get fired on enter of the combobox selection.
Posted

1 solution

hi
use this

this.dgvacc_InvChild.CellLeave += new DataGridViewCellEventHandler(dgvacc_InvChild_CellLeave);

private void dgvacc_InvChild_CellLeave(object sender, DataGridViewCellEventArgs e)
{
int ncolumn = dgvacc_InvChild.CurrentCell.ColumnIndex;
switch (ncolumn)
{
case 1:
GetStockItemFullName();
break;
case 2:
break;
case 3:
CalculateCounterValue();
CalculateTotalValue();
break;
case 4:
CalculateCounterValue();
CalculateTotalValue();
break;
case 5:
CalculateCounterValue();
CalculateTotalValue();
break;
case 6:
break;
case 7:
CalculateTotalValue();
break;
case 8:
break;
default:
//MessageBox.Show("default");
break;
}
}
 
Share this answer
 
Comments
AmrutaKanvinde 27-Oct-12 1:24am    
I have my function written in cell leave event nly but it occurs aftr d rows left again changing d rowindex.
AmrutaKanvinde 27-Oct-12 1:47am    
it doesnt help coz on cell_leave d value of the combobox is still null.

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