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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

ggc - fixed columns

Thread ID:

Created:

Updated:

Platform:

Replies:

60640 May 9,2007 03:41 PM UTC Jan 9,2008 06:58 AM UTC WinForms 6
loading
Tags: GridControl
Ryan Hardoon
Asked On May 9, 2007 03:41 PM UTC

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 04:03 PM UTC

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 12:31 PM UTC

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 07:11 PM UTC

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 10:56 AM UTC

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 11:19 AM UTC

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 06:58 AM UTC

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.

Warning Icon 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.Close Icon

;