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: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Problem Drawing right border for Merged Cells

Thread ID:

Created:

Updated:

Platform:

Replies:

41432 Mar 1,2006 09:53 PM UTC Mar 3,2006 05:50 PM UTC WinForms 1
loading
Tags: GridControl
Brian Richards
Asked On March 1, 2006 09:53 PM UTC

I''m drawing left and right borders to display edges for groups of columns. The column headers are done via a merge and I set the left and right border of cells based on whether or not they are the most Left or most Right cell in a range. Everything seems to be working fine except for the merged cells at the top. The right border does not seem to show up. Code snippets are below any help would be appreciated. Thanks Brian GridRangeInfo rangeInfo = getRangeInfoForGridColumn(e.ColIndex -1); if ((rangeInfo != null) && (rangeInfo.Left <= e.ColIndex - 1) && (rangeInfo.Right >= e.ColIndex - 1)) { applyGroupBorderStyle(gridColumn.DataGridColumnGroup, e.Style); e.Style.MergeCell = GridMergeCellDirection.ColumnsInRow; e.Style.CellValue = getColumnGroupCaption(gridColumn); } -- int colIndex = style.CellIdentity.ColIndex - 1; if (colIndex == range.Left) { style.Borders.Left = new GridBorder(GridBorderStyle.Solid, columnGroup.BorderColor); } else if(colIndex == range.Right) { style.Borders.Right = new GridBorder(GridBorderStyle.Solid, columnGroup.BorderColor); }

mergeborder.zip

Administrator [Syncfusion]
Replied On March 3, 2006 05:50 PM UTC

Hi Brain, The merge cell is spanned over the cells under them. So, you have to set right border property to same cell that starts from left. ================================= For Example: | 1 |* | 2 | 3 |+ The 1 cell is merged from 2 cell to 3 cell. To have border property on ''*'', then set right border for 1 cell. For ''+'' set property to 3 cell ================================= Here is the modified code. ----- if (colIndex == range.Left) { style.Borders.Left = new GridBorder(GridBorderStyle.Solid, columnGroup.BorderColor); if( rowIndex == 0) style.Borders.Right = new GridBorder(GridBorderStyle.Solid, columnGroup.BorderColor); } else if(colIndex == range.Right) { style.Borders.Right = new GridBorder(GridBorderStyle.Solid, columnGroup.BorderColor); } Let us know if you need further assistance, Best Regards, Madhan.

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

;