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. Image for the cookie policy date

Collaps Borders

Hi!

Is there any way to collaps borders of to cells?

cell 1 and cell 2 have the following borders:
left, top, bottom, right --> thin

now, the right border (cell 1) and the left border (cell 2) do not collaps and it look like a thik border? (see attachement)

any idea?

regards,
boris


thikborder.zip

5 Replies

AD Administrator Syncfusion Team December 1, 2006 01:25 PM UTC

Hi Boris,

Use the Style.Borders property to change the border of the cell in a grid. Here is a code snippet to show this.

//Collapse the all cell borders in a grid
this.gridControl1.TableStyle.Borders.All = new GridBorder(GridBorderStyle.None);

//Enable the particular cell border and collapse the Right border.
this.gridControl1[2,2].Borders.All = new GridBorder(GridBorderStyle.Solid);
this.gridControl1[2,2].Borders.Right = new GridBorder(GridBorderStyle.None);

//Enable the particular cell border and collapse the left border..
this.gridControl1[2,3].Borders.All= new GridBorder(GridBorderStyle.Solid);
this.gridControl1[2,3].Borders.Left = new GridBorder(GridBorderStyle.None);

If you want to disable the cell border in a grid, you need to set the ShowCurrentCellBorderBehavior property to GridShowCurrentCellBorder.HideAlways.

this.gridControl1.Model.Options.ShowCurrentCellBorderBehavior = GridShowCurrentCellBorder.HideAlways;

Here is a sample.
GCchangeBorder.zip

Best Regards,
Haneef


BJ Boris Jansen March 5, 2007 04:13 PM UTC

mhhhhh.... it doesn`t work!???

here my steps:

first i create a template and set the defaultgridborderstyle = notset

during my programm, i load the template, put data into the grid, and set the borderstyle only for cells with data:

Dim style As GridStyleInfo = New GridStyleInfo()
style.Borders.Left = New GridBorder(GridBorderStyle.Solid, Color.Black, GridBorderWeight.ExtraThin)
style.Borders.Top = New GridBorder(GridBorderStyle.Solid, Color.Black, GridBorderWeight.ExtraThin)
style.Borders.Right = New GridBorder(GridBorderStyle.NotSet)
style.Borders.Bottom = New GridBorder(GridBorderStyle.NotSet)


Dim range As GridRangeInfo = GridRangeInfo.Cells(Top, Left, Bottom, Right)
Grid.ChangeCells(range, style)

now, the gridborderstyle is set for the grid and it looks very well.

but, if i save the whole grid to excel (using xlsio), all borders in excel are thick. the borderrange in excel is ok but not the borderstyle?

any idea?


BJ Boris Jansen March 6, 2007 01:52 PM UTC

Hello!

for better understanding
please see attachement!

onload:
fill data into grid

press button1:
save grid to excel

result:
all borders in excel a thick

Best Regards,
Boris


gridtest3.zip


AD Administrator Syncfusion Team March 6, 2007 09:54 PM UTC

Hi Boris,

We are currently examining the issue in detail and let you know the points by tomorrow EST. We sincerely rationalize for this time delay.

Thank you for being patience.

Best regards,
Haneef


AD Administrator Syncfusion Team March 13, 2007 07:28 AM UTC

Any Idea at this moment?

Loader.
Live Chat Icon For mobile
Up arrow icon