Hello,
How would I get the value of columns from a selected row in the grid.
On doubleclick of row in the grid, I need to take the values from the selected row for each column and pass it to the other form.
I want to put the values in different variables.
This is my code:
''Check if the user has selected the row
If Me.ugrdImportDetails.Selected.Rows.Count > 0 Then
Next
End If
Thanks
just enumerate cells in your row:
foreach (UltraGridCell cell in rowSelected.Cells)
{
cell.Value - gives you value object in row at column: cell.Column.Key (column name)
}
Can I have a VB.net code please??
On double clicking a row, you don't need to get row collection. i am here assuming that you are using DoubleClick event for ultragrid instead you may use DoubleClickRow event which will give you only that row which you double clicked.
Private Sub ultragrid1_DoubleClickRow(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinGrid.DoubleClickRowEventArgs) Handles ultragrid1.DoubleClickRow
For Each oCell As Infragistics.Win.UltraWinGrid.UltraGridCell In e.Row.Cells your_variable = oCell.Value Next
or your_variable = e.Row.Cells("CellName").Value
End Sub