Hi,
Can you a give me an example demonstrates how get row cell value with double-click on a grid row or cell .
Thanks.
Get row cell value with double-click on a grid row or cell
Answers approved by DevExpress Support
Hi,
You can handle a cell double click as shown in the A2934: How to handle a double-click on a grid row or cell KB article. To obtain a cell value, you can use the GridView.GetRowCellValue method that requires RowHandle and Column as parameters.
RowHandle and Column are available through GridHitInfo in the DoRowDoubleClick method.
See also the E595: How to handle a double-click on a grid row or cell example.
Hi,
As stated in my answer, to obtain a cell value, use the GridView.GetRowCellValue method. In the example, I suggested you can see that when a double click occurs, the DoRowDoubleClick method is called. Call the GridView.GetRowCellValue method in this method to access a cell value.
C#private static void DoRowDoubleClick(GridView view, Point pt) {
GridHitInfo info = view.CalcHitInfo(pt);
if(info.InRow || info.InRowCell) {
string colCaption = info.Column == null ? "N/A" : info.Column.GetCaption();
object val = view.GetRowCellValue(info.RowHandle, info.Column);
if(val != null)
MessageBox.Show(string.Format("DoubleClick on row: {0}, column: {1}, value: {2}", info.RowHandle, colCaption, val));
}
}
C#Private Shared Sub DoRowDoubleClick(ByVal view As GridView, ByVal pt As Point)
Dim info As GridHitInfo = view.CalcHitInfo(pt)
If info.InRow OrElse info.InRowCell Then
Dim colCaption As String = If(info.Column Is Nothing, "N/A", info.Column.GetCaption())
Dim val As Object = view.GetRowCellValue(info.RowHandle, info.Column)
If val IsNot Nothing Then
MessageBox.Show(String.Format("DoubleClick on row: {0}, column: {1}, value: {2}", info.RowHandle, colCaption, val))
End If
End If
End Sub
Keep us posted of your results.
Hi,
We will answer you in the Get value from particular column on double click on another column ticket. Please refer to it for further correspondence.