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
close icon

Grid Lines

Is it possible to turn off grid lines for individual cells? For example, I want to turn off the vertical grid lines for cell 2,2. It seems I can''t override InternalDrawVertBorders, but perhaps there is an event I can catch and cancel? Thanks, Steve

4 Replies

AD Administrator Syncfusion Team January 17, 2005 02:20 PM UTC

By default, the grid draws the bottom and right borders for each cell. So, you can set gridControl1[2,2].Borders.Bottom = GridBorder.Empty; gridControl1[2,2].Borders.Right = GridBorder.Empty; to turn these borders on an individual cell. (With a GridDataBoundGrid, you cannot set individual properties like this, so you would have to use either model.QuerycellInfo or PrepareViewStyleInfo to handle this.)

AD Administrator Syncfusion Team January 18, 2005 01:23 AM UTC

Why is it that if I hard code the borders property in the load event that it works, but if I set the border property on the query cell info event it does not. For example, in queryCellInfo I am setting the following, but the border is still being drawn. if (e.RowIndex == 1 && e.ColIndex == 2) { e.Style.Borders.Bottom = Syncfusion.Windows.Forms.Grid.GridBorder.Empty; } Is there another property I need to set? Thanks, Steve

AD Administrator Syncfusion Team January 18, 2005 05:54 AM UTC

Your code seems to work for me using 3010 in this sample. http://www.syncfusion.com/forums/Uploads/GC_Borders.zip Do you have other code that might be setting border styles somewhere?

ST Steve January 18, 2005 10:41 AM UTC

I found the mistake in my code. (queryCellInfo wasn''t wired in my test) Thanks.

Live Chat Icon For mobile
Up arrow icon