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.
Unfortunately, activation email could not send to your email. Please try again.

ggc - fixed columns

Thread ID:

Created:

Updated:

Platform:

Replies:

60640 May 9,2007 11:41 AM Jan 9,2008 01:58 AM Windows Forms 6
loading
Tags: GridControl
Ryan Hardoon
Asked On May 9, 2007 11:41 AM

Hi,

Is it possible to keep a specific column (the left-most column) from scrolling horizontally and cause it to be drawn on top of overlapping columns ?


Thanks in advance.

Saravanan A [Syncfusion]
Replied On May 9, 2007 12:03 PM

Hi Ryan,

You can achieve this by setting the TableDescriptor.FrozenColumn property to the name of the first column.
Here is the code snippet.

this.gridGroupingControl1.TableDescriptor.FrozenColumn = "ColumnName";

Best Regards,
Saravanan

Ryan Hardoon
Replied On May 10, 2007 08:31 AM

Thanks, that's exactly the behavior I need :)

Now all I need is to prevent the frozen column from being resized.
Is it possible to identify the name of the column to be resized from within TableControlResizingColumns, or is there a similar settings (like: ".FrozenColumn =") that does the job ?

haneefm [Syncfusion]
Replied On May 10, 2007 03:11 PM

Hi Ryan,

You can use this code to get column name in a TableControlResizingColumns event.

private void gridGroupingControl1_TableControlResizingColumns(object sender, GridTableControlResizingColumnsEventArgs e)
{
int iColIndex = e.Inner.Columns.Left;
int iField = e.TableControl.TableDescriptor.ColIndexToField(iColIndex);
if( iField >= 0 )
Console.WriteLine( e.TableControl.TableDescriptor.Columns[iField].Name);
}

Best regards,
Haneef

James Gramosli NO LONGER WITH COMPANY
Replied On January 4, 2008 05:56 AM

The above code does not seem to work, its returning different columns than the one selected in my grid. We're using a combination of Bound Fields, and 2 Unbound action fields in a hierarchy(2 GridTables).


James Gramosli NO LONGER WITH COMPANY
Replied On January 4, 2008 06:19 AM

There is a bug in the code you guys provided, if parent and children table have different column counts, you need to do a check for the index being valid as this event is still fired for columns which are not there. There is a few versions of this code on your forums, I suggest you update all of the threads with the right code...

if ( e.Inner.Columns.IsCols)
{
int colIndex = e.TableControl.TableDescriptor.ColIndexToField(e.Inner.Columns.Left);

if(colIndex < e.TableControl.TableDescriptor.VisibleColumns.Count && e.TableControl.TableDescriptor.VisibleColumns[colIndex].Name == "Whatever" )
e.Inner.Cancel = true;
}



Jisha Joy [Syncfusion]
Replied On January 9, 2008 01:58 AM

Hi James,

Thank you for your suggestion.

Thank you for your interest in Syncfusion Products.
Regards,
Jisha



CONFIRMATION

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.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;