Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
20208 | Oct 12,2004 02:01 PM UTC | Oct 14,2004 09:51 AM UTC | WinForms | 9 |
![]() |
Tags: Grouping |
this.groupingGrid1.TableOptions.AllowDragColumns = false;
this.groupingGrid1.TableOptions.AllowSortColumns = false;
this.groupingGrid1.TableOptions.AllowSelection = GridSelectionFlags.Any;
this.groupingGrid1.TableModel.SelectionChanging += new GridSelectionChangingEventHandler(TableModel_SelectionChanging);
this.groupingGrid1.TopLevelGroupOptions.ShowCaption = false;
this.groupingGrid1.TableControlCellHitTest += new GridTableControlCellHitTestEventHandler(groupingGrid1_TableControlCellHitTest);
and these handlers:
private void groupingGrid1_TableControlCellHitTest(object sender, GridTableControlCellHitTestEventArgs e)
{
GridTableCellStyleInfo style = (GridTableCellStyleInfo) e.TableControl.Model[e.Inner.RowIndex, e.Inner.ColIndex];
if (style.TableCellIdentity.TableCellType == GridTableCellType.ColumnHeaderCell
)
{
e.Inner.Cancel = true;
e.Inner.Result = 0;
}
}
private void TableModel_SelectionChanging(object sender, GridSelectionChangingEventArgs e)
{
GridTableCellStyleInfo style = ((GridTableModel) sender)[e.ClickRange.Top, e.ClickRange.Left];
if (style.TableCellIdentity.TableCellType == GridTableCellType.ColumnHeaderCell
)
{
e.Range = GridRangeInfo.Cols(e.Range.Left, e.Range.Right);
}
}
Stefan
> this.groupingGrid1.TableOptions.AllowDragColumns = false;
> this.groupingGrid1.TableOptions.AllowSortColumns = false;
> this.groupingGrid1.TableOptions.AllowSelection = GridSelectionFlags.Any;
> this.groupingGrid1.TableModel.SelectionChanging += new GridSelectionChangingEventHandler(TableModel_SelectionChanging);
> this.groupingGrid1.TopLevelGroupOptions.ShowCaption = false;
> this.groupingGrid1.TableControlCellHitTest += new GridTableControlCellHitTestEventHandler(groupingGrid1_TableControlCellHitTest);
>
>
>and these handlers:
>
>
> private void groupingGrid1_TableControlCellHitTest(object sender, GridTableControlCellHitTestEventArgs e)
> {
> GridTableCellStyleInfo style = (GridTableCellStyleInfo) e.TableControl.Model[e.Inner.RowIndex, e.Inner.ColIndex];
> if (style.TableCellIdentity.TableCellType == GridTableCellType.ColumnHeaderCell
> )
> {
> e.Inner.Cancel = true;
> e.Inner.Result = 0;
> }
> }
>
> private void TableModel_SelectionChanging(object sender, GridSelectionChangingEventArgs e)
> {
> GridTableCellStyleInfo style = ((GridTableModel) sender)[e.ClickRange.Top, e.ClickRange.Left];
> if (style.TableCellIdentity.TableCellType == GridTableCellType.ColumnHeaderCell
> )
> {
> e.Range = GridRangeInfo.Cols(e.Range.Left, e.Range.Right);
> }
> }
>
>
>
>
>
>
>Stefan
>> this.groupingGrid1.TableOptions.AllowDragColumns = false;
>> this.groupingGrid1.TableOptions.AllowSortColumns = false;
>> this.groupingGrid1.TableOptions.AllowSelection = GridSelectionFlags.Any;
>> this.groupingGrid1.TableModel.SelectionChanging += new GridSelectionChangingEventHandler(TableModel_SelectionChanging);
>> this.groupingGrid1.TopLevelGroupOptions.ShowCaption = false;
>> this.groupingGrid1.TableControlCellHitTest += new GridTableControlCellHitTestEventHandler(groupingGrid1_TableControlCellHitTest);
>>
>>
>>and these handlers:
>>
>>
>> private void groupingGrid1_TableControlCellHitTest(object sender, GridTableControlCellHitTestEventArgs e)
>> {
>> GridTableCellStyleInfo style = (GridTableCellStyleInfo) e.TableControl.Model[e.Inner.RowIndex, e.Inner.ColIndex];
>> if (style.TableCellIdentity.TableCellType == GridTableCellType.ColumnHeaderCell
>> )
>> {
>> e.Inner.Cancel = true;
>> e.Inner.Result = 0;
>> }
>> }
>>
>> private void TableModel_SelectionChanging(object sender, GridSelectionChangingEventArgs e)
>> {
>> GridTableCellStyleInfo style = ((GridTableModel) sender)[e.ClickRange.Top, e.ClickRange.Left];
>> if (style.TableCellIdentity.TableCellType == GridTableCellType.ColumnHeaderCell
>> )
>> {
>> e.Range = GridRangeInfo.Cols(e.Range.Left, e.Range.Right);
>> }
>> }
>>
>>
>>
>>
>>
>>
>>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.