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 header doubleclick / resize

Thread ID:

Created:

Updated:

Platform:

Replies:

72568 Mar 26,2008 03:34 PM Mar 27,2008 03:10 PM Windows Forms 1
loading
Tags: GridControl
Christoph
Asked On March 26, 2008 03:34 PM

I've a GGC and want to sort the column by single clicking on the header and resize the column to fit to the content when doubleclicking on the header.

At the moment I'm using the following code:

private void gridGroupingControl_TableControlCellDoubleClick(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableControlCellClickEventArgs e)
{
this.gridGroupingControl.Enabled = false;
//MY CODE TO OPEN THE CURRENT ITEM
this.gridGroupingControl.Enabled = true;
}

What happens is, that when I'm single clicking on the header the grid is sorting correctly but when I'm doubleclicking, an item is opening.

Can you help me in:
*) How to avoid opening an item when doubleclicking on the header.
*) How to fit the column width when doubleclicking on the header.

BR
Christoph


Administrator [Syncfusion]
Replied On March 27, 2008 03:10 PM

Hi Christoph,

Please refer the code below to fit the column width when doubleclicking on the header and to avoid opening an item when doubleclicking on the header.



void gridGroupingControl1_TableControlCellDoubleClick(object sender, GridTableControlCellClickEventArgs e)

{
GridTableCellStyleInfo style = e.TableControl.GetTableViewStyleInfo(e.Inner.RowIndex, e.Inner.ColIndex);
if (style.TableCellIdentity.TableCellType == GridTableCellType.ColumnHeaderCell)
{
this.gridGroupingControl1.TableControl.Model.ColWidths.ResizeToFit(GridRangeInfo.Col(e.Inner.ColIndex) , GridResizeToFitOptions.IncludeHeaders);
this.gridGroupingControl1.Refresh();
}
else

{

//Your Code to open the current item.
}
}



Please let me know if this helps.

Regards,
Srirajan




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.

;