We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

How-To (GridGrouingControl and GridDataBoundGrid)

Hi, Please I would like to know : On GridGrouingControl : 1. How to set the tab key behaviour on GridGroupingControl (When the user tabs to the end of a row, go to the next row. When the user tabs to the last cell in the last row, go to the next control in the tab order on the form) ?. 2. How to make a column''s TabStop 3. How to make a column''s BackColor 4. How to make a cell to display "..." if it is not wide enough to have the whole text 5. How do efficiently modify the underlying DataSource when its bound to the GridGroupingControl ? On GridDataBoundGrid : 1. How to make a column''s TabStop 2. How to make a column''s BackColor Best regards, Jamâl-Dine DISSOU

2 Replies

AD Administrator Syncfusion Team May 17, 2005 12:32 PM

1) Currently, there are no property settings available to manage this. At this point, you would have to handle an event, TableControlMoveCurrentCellDirection, and move things yourself. Here is little snippet to give you the idea.
private void gridGroupingControl1_TableControlMoveCurrentCellDirection(object sender, GridTableControlMoveCurrentCellDirectionEventArgs e)
{
	GridTableCellStyleInfo style = e.TableControl.Model[e.Inner.RowIndex, e.Inner.ColIndex];
	int lastCol = style.TableCellIdentity.Table.TableDescriptor.VisibleColumns.Count - 1;
	if(style.TableCellIdentity.Column.MappingName == style.TableCellIdentity.Table.TableDescriptor.VisibleColumns[lastCol].Name)
	{
		if( e.Inner.Direction == GridDirectionType.Right)
		{
			GridCurrentCell cc = e.TableControl.CurrentCell;
			cc.MoveDown(1);
			cc.MoveTo(cc.RowIndex, cc.ColIndex - lastCol);
			e.Inner.Handled = true;
			e.Inner.Result = true;
			
		}
	}
}
2) You can prevent a cell fdrom becoming the currentcell by setting style.Enabled=false for that cell. So, if you do not want a column enabled, you could do something like: this.gridGroupingControl1.TableDescriptor.Columns["ParentName"].Appearance.AnyCell.Enabled = false; 3) You set the BackColor of a column by setting the style.BackColor property for that column. this.gridGroupingControl1.TableDescriptor.Columns["ParentName"].Appearance.AnyCell.BackColor = Color.Red; 4) You set the style.Trimming property for that column. this.gridGroupingControl1.TableDescriptor.Columns["ParentName"].Appearance.AnyCell.Trimming = StringTrimming.EllipsisWord; 5) If you want to change a whole series of values in a DataTable and not have each change individually propagated to the grid, before modifying the datatable values, set this.gridGroupingControl1.Table.TableDirty = true; and then do not access any this.gridGroupingControl1 properties until you have completed your update. 1) You use either grid.GridBoundColumns["Col1"}.StyleInfo.Enabled or grid.Binder.InternalColumns["Col1"].StyleInfo.Enabled depending upon whether you have added GridBoundColumns or not. 2) Same as 1 except you set StyleInfo.BackColor.


PD Prof DISSOU Jamâl-Dine May 19, 2005 10:35 AM

Hi Clay, Thanks a lot. Best regards, Jamâl-Dine DISSOU

Loader.
Live Chat Icon For mobile
Up arrow icon