To get focusedrow cell value using Devexpress XtraGrid in C# and VB.NET you can use one of the following ways.
Samples
Sample C#
string value = gridView1.GetFocusedRowCellValue("ColumnName").ToString(); string value = gridView1.GetDataRow(e.FocusedRowHandle)["ColumnName"].ToString(); string value = (gridView1.GetFocusedRow() as DataRowView).Row["ColumnName"].ToString(); string value = gridView1.GetFocusedDataRow()["ColumnName"].ToString();
Sample VB.NET
Dim value as String = gridView1.GetFocusedRowCellValue("ColumnName").ToString() Dim value as String = gridView1.GetDataRow(e.FocusedRowHandle)("ColumnName").ToString() Dim value as String = TryCast(gridView1.GetFocusedRow(), DataRowView).Row("ColumnName").ToString() Dim value as String = gridView1.GetFocusedDataRow()("ColumnName").ToString()
If you have any questions or suggestions feel free to rate this snippet, post a comment or Contact Us via Email.
Related links:
- Devexpress.com
- Blazing Fast WinForms Data Grid
- How to get the selected row values of DevExpress XtraGrid?
Get focusedrow cell value using #Devexpress XtraGrid in C# and #VB .NET http://t.co/c2x97Q9ZWp #csharp #dotnet #developer #programming #code
RT @CodeSnippetsNET: Get focusedrow cell value using #Devexpress XtraGrid in C# and #VB .NET http://t.co/c2x97Q9ZWp #csharp #dotnet #develo…
RT @CodeSnippetsNET: Get focusedrow cell value using #Devexpress XtraGrid in C# and #VB .NET http://t.co/c2x97Q9ZWp #csharp #dotnet #develo…
RT @CodeSnippetsNET: Get focusedrow cell value using #Devexpress XtraGrid in C# and #VB .NET http://t.co/c2x97Q9ZWp #csharp #dotnet #develo…