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.
Unfortunately, activation email could not send to your email. Please try again.

Setting Style for range of Columns

Thread ID:

Created:

Updated:

Platform:

Replies:

14701 Jun 2,2004 01:34 PM Jun 2,2004 03:35 PM Windows Forms 3
loading
Tags: GridControl
Vivek
Asked On June 2, 2004 01:34 PM

hi, How would i set some property lke (back color, width, type ..) for a range of columns? Thanks

Administrator [Syncfusion]
Replied On June 2, 2004 02:04 PM

In a GridControl, you can use grid.ChangeCells passing in a GridRangeInfo object and a style. In a GridDataBoundGrid, you will have to loop through either grid.GridBoundColumns collection or the grid.Binder.InternalColumns collection, changing the GridBoundColumn.StyleInfo object for each column you want to change.

Vivek
Replied On June 2, 2004 03:22 PM

Thanks i tried few things and working fine. I am having problem to do the following. Q1 How would I change column width for a range of columns? I really don’t see any property in GridStyleInfo object. Q2 I am trying to put a “solid” black line at the top of some cell and using following code GridStyleInfo style = new GridStyleInfo(); style.Borders.Top.Style = GridBorderStyle.Solid; style.Borders.Top.Color = Color.Black; style.Borders.Top.Weight = GridBorderWeight.Thick; programGrid.ChangeCells(GridRangeInfo.Cells(1, 1, 1, 5), style); But I am getting the following error messages: ''Syncfusion.Windows.Forms.Grid.GridBorder.Weight'' cannot be assigned to -- it is read only How should I do that? Please do reply! Thanks

Administrator [Syncfusion]
Replied On June 2, 2004 03:35 PM

1) this.gridControl1.ColWidths.SetRange 2) Instead of style.Borders.Top.Style = GridBorderStyle.Solid; style.Borders.Top.Color = Color.Black; style.Borders.Top.Weight = GridBorderWeight.Thick; try style.Borders.Top = new GridBorder(GridBorderStyle.Solid, Color.Black, GridBorderWeight.Thick);

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.

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.

;