Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: .NET3.0 C# WinForm
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 26-Oct-12 19:55pm

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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;
}
}
  Permalink  
Comments
AmrutaKanvinde at 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 at 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)

  Print Answers RSS
0 OriginalGriff 350
1 Jochen Arndt 190
2 Richard MacCutchan 135
3 Sergey Alexandrovich Kryukov 120
4 DamithSL 105
0 OriginalGriff 6,045
1 DamithSL 4,611
2 Maciej Los 4,087
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,310


Advertise | Privacy | Mobile
Web04 | 2.8.141220.1 | Last Updated 27 Oct 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100