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.
Syncfusion Feedback

Split column header in Grid Grouping Control

Thread ID:

Created:

Updated:

Platform:

Replies:

40946 Feb 17,2006 04:01 AM Feb 20,2006 09:46 AM Windows Forms 3
loading
Tags: GridControl
Prathima Venkobachar
Asked On February 17, 2006 04:01 AM

Hi, We have a requirement to display the column header as attached in the file. To achieve this we are using the following code. GridColumnSetDescriptor gridColumnSetDescriptor = new GridColumnSetDescriptor(); gridColumnSetDescriptor.ColumnSpans.AddRange( new Syncfusion.Windows.Forms.Grid.Grouping.GridColumnSpanDescriptor[] { new Syncfusion.Windows.Forms.Grid.Grouping.GridColumnSpanDescriptor("CASH", "R0C0:R0C1"); syncGrid.TableDescriptor.ColumnSets.Add(gridColumnSetDescriptor); But it is adding extra rows to the rows also. We want to display for only columns. How to handle this in Grid Grouping Control. Thanks & Regards, Prathima.

pic20033.zip

stanleyj [Syncfusion]
Replied On February 18, 2006 06:30 AM

Hi Prathima, The ColumnSets are used for diplaying the rows in a multi row fashion, therefore it is quite not possible to have only the header cells multirows and the record field as single row. However using QueryCellStyleInfo, the border style for the bottom of that cell can be removed and a similar dotted image as of standard GridBorderStyle can be placed in that cell. Also disable that cell so that the user do not move over there. To the rest of the columns set VerticalAlignment to Bottom, so that the text are placed uniformly. private void gridGroupingControl1_QueryCellStyleInfo(object sender, GridTableCellStyleInfoEventArgs e) { if(e.TableCellIdentity.Column != null) if(e.TableCellIdentity.Column.Name == "Cash" &&( e.TableCellIdentity.TableCellType == GridTableCellType.RecordFieldCell || e.TableCellIdentity.TableCellType == GridTableCellType.AlternateRecordFieldCell)) { e.Style.Borders.Bottom = new GridBorder(GridBorderStyle.None); e.Style.CellType = "Image"; e.Style.CellValue = bmp; e.Style.Enabled = false; } else if(e.TableCellIdentity.Column.Name != "Cash") { e.Style.VerticalAlignment = GridVerticalAlignment.Bottom; } } Best regards, Stanley

Prathima Venkobachar
Replied On February 20, 2006 03:35 AM

Hi, Thanks for your reply. One more query we are having regarding the same. As you mentioned,we assigned a image with vertical dotted lines in the middle to that cell. Now our problem is if the column header is dragged, then the image is not stretched. So the vertical alignment is not proper. Give us some solution for this. Regards, Prathima. >Hi Prathima, > >The ColumnSets are used for diplaying the rows in a multi row fashion, therefore it is quite not possible to have only the header cells multirows and the record field as single row. However using QueryCellStyleInfo, the border style for the bottom of that cell can be removed and a similar dotted image as of standard GridBorderStyle can be placed in that cell. Also disable that cell so that the user do not move over there. To the rest of the columns set VerticalAlignment to Bottom, so that the text are placed uniformly. > > > private void gridGroupingControl1_QueryCellStyleInfo(object sender, GridTableCellStyleInfoEventArgs e) > { > if(e.TableCellIdentity.Column != null) > if(e.TableCellIdentity.Column.Name == "Cash" &&( e.TableCellIdentity.TableCellType == GridTableCellType.RecordFieldCell || e.TableCellIdentity.TableCellType == GridTableCellType.AlternateRecordFieldCell)) > { > e.Style.Borders.Bottom = new GridBorder(GridBorderStyle.None); > e.Style.CellType = "Image"; > e.Style.CellValue = bmp; > e.Style.Enabled = false; > } > else if(e.TableCellIdentity.Column.Name != "Cash") > { > e.Style.VerticalAlignment = GridVerticalAlignment.Bottom; > } > } > > >Best regards, >Stanley

Pics0.zip

stanleyj [Syncfusion]
Replied On February 20, 2006 09:46 AM

Hi Prathima, If you have troubles while resizing, then you may prefer querying both the sub columns to be equal and have resizing with Cash or This order column. this.gridGroupingControl1.TableControl.Model.QueryColWidth += new GridRowColSizeEventHandler(Model_QueryColWidth); private void Model_QueryColWidth(object sender, GridRowColSizeEventArgs e) { if(e.Index == 1) //Yesterday Column e.Size = this.gridGroupingControl1.TableModel.ColWidths[2];// Cash Column } Best regards, Stanley

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

;