Home Forums WinForms controls Xceed Grid for WinForms Suppress Grid Lines

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #15324 |

    Similar to the nearby post about suppressing the focus border, I would like suppress display of all grid lines. I will vary the color of different rows based on values for each row. I have set both GridLineColor and GridLineBackColor to Transparent, BackColor to Black. In the AddingDataRow event, I set the row’s backcolor based on the row’s content. However, when I have multiple rows, I see black lines between the rows – i.e. from the grid’s black background. How can I prevent these black grid lines from appearing? Thanks.

    Imported from legacy forums. Posted by ronnotel (had 3922 views)

    User (Old forums)
    Member
    Post count: 23064

    You will need to derive from the DataRow and DataCell classes in order to be able to do this.

    <a href=”http://www.xceedsoft.com/cs/download/XceedGrid/CSharp/Custom Row Cell Derivation.zip”>Here</a> is a sample application that demonstrate how to customize grid lines.

    Imported from legacy forums. Posted by André (had 333 views)

    User (Old forums)
    Member
    Post count: 23064

    Thanks, again, Andre. It would be nice if I didn’t have to derive subclasses to do this, but your help is much appreciated.

    Ron

    Imported from legacy forums. Posted by ronnotel (had 270 views)

    User (Old forums)
    Member
    Post count: 23064

    Hi, I”m sure the answer you’ve provided accomplishes the stated and intended goals of the developer, but it would be great if I could instead do something like this:

    row.Borders.Bottom.Size = 0;
    row.Borders.Bottom.Color = Color.Blue;
    row.Alignment = ContentAlignment.MiddleLeft;

    See? Intuitive, intellisense helps me along, no error message telling me that Borders.Bottom is read-only, no extra inheritance-with-custom-borders-overriding required.

    I think you’d make a lot of programmers happy with this ability.

    Imported from legacy forums. Posted by camera (had 373 views)

    User (Old forums)
    Member
    Post count: 23064

    The grid does not offer this feature for performance reasons. Using the DefaultValue means that the grid does not have to load/verify the borders for each rows/cells, which means things are way faster, and this saves a lot of memory usage.

    Moreover, it does not require much work to implement this in the derived class, the example provided is easy to follow, so you should have no problem accomplishing this in no time.

    Imported from legacy forums. Posted by André (had 343 views)

    User (Old forums)
    Member
    Post count: 23064

    my wife would tell me that I’m denying her feelings if i said what you said, Andre 🙂

    “it doesn’t work that way because of performance reasons” is fine.

    “it doesn’t take much effort to override…” sounds like “you’re just being lazy” when in fact I’m providing valuable feedback based on actual experience.

    Imported from legacy forums. Posted by camera (had 5107 views)

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.