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

How to show Grid Lines as solid (not borders)?

Thread ID:





2578 Feb 1,2003 12:13 PM UTC Feb 1,2003 05:22 PM UTC WinForms 1
Tags: GridControl
Asked On February 1, 2003 12:13 PM UTC

Hi I want to show Grid lines in solid and also want to color it. I tried to set these properties in gridDataBoundGrid1_PrepareViewStyleInfo Dim grid As GridDataBoundGrid = sender grid.Model.Properties.DisplayHorzLines = True grid.Model.Properties.DisplayVertLines = True grid.Model.Properties.GridLineColor=color.SteelBlue where i am missing, also i dont find in you samples, knowledge base, forums (!?) Am I Right? Regards Rajaraman California SOftware, INDIA

Administrator [Syncfusion]
Replied On February 1, 2003 05:22 PM UTC

PrepareViewStyleInfo is hit every time a cell is drawn on the screen so that the cell specific style can be modified if desired. The settings you are trying to use, are gridwide setting. They apply to the whole grid and don't have to be set for every cell. So, it would be better do the grid wide settings, once say in the form's constructor or Form_Load. If you want to have blue solid lines in the whole grid, then you can do this by setting the TableStyle.Borders property. To get a thin solid line, you can just set two borders to do this. Me.Grid.TableStyle.Borders.Bottom = New GridBorder(GridBorderStyle.Solid, Color.SteelBlue,GridBorderWeight.Thin) Me.Grid.TableStyle.Borders.Right = New GridBorder(GridBorderStyle.Solid, Color.SteelBlue,GridBorderWeight.Thin) Again, since this applies to the whole table, you can just do this once in Form_Load. If you want to do this in PrepareViewStyleInfo, you would set these properties on teh e.Style.Borders. Here, you could condiitionally color the borders (or conditionally change other display properties of the style) based on teh e.ColIndex and e.RowIndex.


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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

Live Chat Icon For mobile
Live Chat Icon