Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
10177 | Jan 24,2004 03:13 PM UTC | Jan 24,2004 04:02 PM UTC | WinForms | 1 |
![]() |
Tags: Grouping |
[C#]
this.groupingGrid1.TableControl.CellDoubleClick += new GridCellClickEventHandler(TableControl_CellDoubleClick);
this.groupingGrid1.TableControl.CurrentCellControlDoubleClick += new ControlEventHandler(TableControl_CurrentCellControlDoubleClick);
private void TableControl_CellDoubleClick(object sender, GridCellClickEventArgs e)
{
GridTableControl tableControl = (GridTableControl) sender;
GridTableCellStyleInfo style = tableControl.Table.GetTableCellStyle(e.RowIndex, e.ColIndex);
GridTableCellStyleInfoIdentity id = style.TableCellIdentity;
MessageBox.Show("DoubleClick on " + id.ToString());
}
private void TableControl_CurrentCellControlDoubleClick(object sender, ControlEventArgs e)
{
GridTableControl tableControl = (GridTableControl) sender;
GridCurrentCell gcc = tableControl.CurrentCell;
GridTableCellStyleInfo style = tableControl.Table.GetTableCellStyle(gcc.RowIndex, gcc.ColIndex);
GridTableCellStyleInfoIdentity id = style.TableCellIdentity;
MessageBox.Show("DoubleClick on " + id.ToString());
}
[VB]
AddHandler Me.groupingGrid1.TableControl.CellDoubleClick, AddressOf TableControl_CellDoubleClick
AddHandler Me.groupingGrid1.TableControl.CurrentCellControlDoubleClick, AddressOf TableControl_CurrentCellControlDoubleClick
Private Sub TableControl_CellDoubleClick(sender As Object, e As GridCellClickEventArgs)
Dim tableControl As GridTableControl = CType(sender, GridTableControl)
Dim style As GridTableCellStyleInfo = tableControl.Table.GetTableCellStyle(e.RowIndex, e.ColIndex)
Dim id As GridTableCellStyleInfoIdentity = style.TableCellIdentity
MessageBox.Show("DoubleClick on " + id.ToString())
End Sub ''TableControl_CellDoubleClick
Private Sub TableControl_CurrentCellControlDoubleClick(sender As Object, e As ControlEventArgs)
Dim tableControl As GridTableControl = CType(sender, GridTableControl)
Dim gcc As GridCurrentCell = tableControl.CurrentCell
Dim style As GridTableCellStyleInfo = tableControl.Table.GetTableCellStyle(gcc.RowIndex, gcc.ColIndex)
Dim id As GridTableCellStyleInfoIdentity = style.TableCellIdentity
MessageBox.Show("DoubleClick on " + id.ToString())
End Sub ''TableControl_CurrentCellControlDoubleClick
We will also provide current cell and cell events for the GridGroupingControl soon. Then you don''t have to access the underlying GridTableControl.
This will make it easier especially when hierarchies are involved. (Above code is meant for a grouping grid with just one table).
Stefan
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.