wpf-devexpress-dot-xpf-dot-grid-dot-gridcontrol-dot-isgrouprowhandle-x28-system-dot-int32-x29.md
Indicates whether the specified handle corresponds to a group row.
Namespace : DevExpress.Xpf.Grid
Assembly : DevExpress.Xpf.Grid.v25.2.dll
NuGet Package : DevExpress.Wpf.Grid.Core
public bool IsGroupRowHandle(
int rowHandle
)
Public Function IsGroupRowHandle(
rowHandle As Integer
) As Boolean
| Name | Type | Description |
|---|---|---|
| rowHandle | Int32 |
An integer value that specifies the row’s handle.
|
| Type | Description |
|---|---|
| Boolean |
true if the specified handle corresponds to a group row; otherwise, false.
|
Group row handles are negative (start from -1 ). The IsGroupRowHandle method returns false , if the specified handle corresponds to a data row or invalid row.
To learn more, see Grouping and Identifying Rows and Cards.
The following example demonstrates how to use the TableView.RowDoubleClick event to process double-clicks:
View Example: How to Handle Row Double-clicks
<dxg:GridControl x:Name="grid">
<!-- ... -->
<dxg:GridControl.View>
<dxg:TableView RowDoubleClick="OnRowDoubleClick"/>
</dxg:GridControl.View>
</dxg:GridControl>
void OnRowDoubleClick(object sender, RowDoubleClickEventArgs e) {
int rowHandle = e.HitInfo.RowHandle;
if(rowHandle == GridControl.InvalidRowHandle)
return;
if(grid.IsGroupRowHandle(rowHandle))
MessageBox.Show("A group row has been double clicked.", "Info");
else
MessageBox.Show("A data row has been double clicked.", "Info");
}
Private Sub OnRowDoubleClick(ByVal sender As Object, ByVal e As RowDoubleClickEventArgs)
Dim rowHandle As Integer = e.HitInfo.RowHandle
If rowHandle = DataControlBase.InvalidRowHandle Then Return
If Me.grid.IsGroupRowHandle(rowHandle) Then
MessageBox.Show("A group row has been double clicked.", "Info")
Else
MessageBox.Show("A data row has been double clicked.", "Info")
End If
End Sub
The following code snippets (auto-collected from DevExpress Examples) contain references to the IsGroupRowHandle(Int32) method.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.
int rowHandle = this._Grid.GetRowHandleByVisibleIndex(i);
if(this._Grid.IsGroupRowHandle(rowHandle)) {
if(!this._Grid.IsGroupRowExpanded(rowHandle)) {
wpf-grid-select-child-rows-in-groups-on-click/CS/GridGroupSelect/GroupChildSelector.cs#L33
TableViewHitInfo hitInfo = view.CalcHitInfo(e.OriginalSource as DependencyObject);
if (hitInfo.InRow && view.Grid.IsGroupRowHandle(hitInfo.RowHandle)) {
view.Grid.BeginSelection();
wpf-data-grid-handle-row-double-clicks/CS/RowDoubleClick_CodeBehind/MainWindow.xaml.cs#L48
return;
if(grid.IsGroupRowHandle(rowHandle))
MessageBox.Show("A group row has been double clicked.", "Info");
wpf-data-grid-obtain-rows-visible-on-screen/CS/IScrollInfoSample/Window1.xaml.cs#L35
else
listBox.Items.Add(grid.IsGroupRowHandle(handle) ? "Group: " + item.Text : item.Text);
}
Dim rowHandle As Integer = _Grid.GetRowHandleByVisibleIndex(i)
If _Grid.IsGroupRowHandle(rowHandle) Then
If Not _Grid.IsGroupRowExpanded(rowHandle) Then
wpf-grid-select-child-rows-in-groups-on-click/VB/GridGroupSelect/GroupChildSelector.vb#L38
Dim hitInfo As TableViewHitInfo = view.CalcHitInfo(TryCast(e.OriginalSource, DependencyObject))
If hitInfo.InRow AndAlso view.Grid.IsGroupRowHandle(hitInfo.RowHandle) Then
view.Grid.BeginSelection()
wpf-data-grid-handle-row-double-clicks/VB/RowDoubleClick_CodeBehind/MainWindow.xaml.vb#L45
If rowHandle = DataControlBase.InvalidRowHandle Then Return
If Me.grid.IsGroupRowHandle(rowHandle) Then
MessageBox.Show("A group row has been double clicked.", "Info")
wpf-data-grid-obtain-rows-visible-on-screen/VB/IScrollInfoSample/Window1.xaml.vb#L35
Else
Me.listBox.Items.Add(If(Me.grid.IsGroupRowHandle(handle), "Group: " & item.Text, item.Text))
End If
See Also