Click here to Skip to main content
12,395,946 members (67,089 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: .NET3.0 C# .NET
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 18: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 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)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160721.1 | Last Updated 27 Oct 2012
Copyright © CodeProject, 1999-2016
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