Hi All, I have a combo box column in vb.net datagridview . i want to perform some validation like to put some values in another text column of Grid on selectionindexchanged event of a combo box in datagridview. but unable to do so. Any Help appreciated. Thanks in Advance.
A:
Implement the CellEndEdit event, switch on the selected column, then cast the cell to a DataGridViewComboBoxCell object and set the value of cell you want to change ...
DataGridViewComboBoxCell cell = (DataGridViewComboBoxCell)this.dataGridIneligibleReports.Rows[e.RowIndex].Cells[e.ColumnIndex];
this.dataGrdReconciliations.Rows[e.RowIndex].Cells["NameOfTheCellToChange"].Value = cell.Value.ToString();
Sorry it's in C#.
Converted by Meta-Knight..
Dim cell As DataGridViewComboBoxCell = CType(Me.dataGridIneligibleReports.Item(e.ColumnIndex,e.RowIndex), DataGridViewComboBoxCell)
Me.dataGrdReconciliations.Item("NameOfTheCellToChange", e.RowIndex).Value = cell.Value.ToString()
bleeeah
2009-09-17 09:28:40
i am thankful if you please provide me vb.net code
Faizan Dosani
2009-09-17 09:47:20
I'm sure you can work it out :)
bleeeah
2009-09-17 10:24:13
I converted the code to VB in my answer. bleeeah, if you copy it into your answer and I'll delete mine.
Meta-Knight
2009-09-17 12:52:44
A:
bleeeah's code converted to VB:
Dim cell As DataGridViewComboBoxCell = CType(Me.dataGridIneligibleReports.Item(e.ColumnIndex,e.RowIndex), DataGridViewComboBoxCell)
Me.dataGrdReconciliations.Item("NameOfTheCellToChange", e.RowIndex).Value = cell.Value.ToString()
Meta-Knight
2009-09-17 12:51:30