)
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

What is the purpose of the GridRangeInfo class in WinForms GridControl?

Platform: WinForms |
Control: GridControl |
Published Date: April 30, 2011 |
Last Revised Date: December 20, 2019

Purpose of GridRangeInfo class

The GridRangeInfo class allows specification of a range of grid cells. This GridRangeInfo class is used in many grid methods that do their work on a range of cells. It has ranges like a single cell, a rectangular collection of cells, a row or a range of rows, a column or a range of columns, or the entire table. By using this range of cells, you can perform any style or operation for that particular range. The GridRangeInfo class has static methods that allow you to create a range object without explicitly creating an instance of the class.

C#

using Syncfusion.Windows.Forms.Grid;
…
GridStyleInfo style = new GridStyleInfo();
style.BackColor = Color.Blue;
GridRangeInfo range = GridRangeInfo.Cells(2, 2, 3, 3);
gridControl1.CoveredRanges.Add(range);
// Using Cols can have a range of columns from left to right (left,right).
gridControl1.ChangeCells(GridRangeInfo.Cols(4, 5),new GridStyleInfo(){Text="Columnns"});
// Selection is added to the Row.
gridControl1.Selections.Add(GridRangeInfo.Row(4));
//Change the particular cell into blue color.
gridControl1.ChangeCells(GridRangeInfo.Cell(1,1), style);
// Change cell style at particular rows.
gridControl1.ChangeCells(GridRangeInfo.Rows(6,7), new GridStyleInfo(){BackColor = Color.Green});

 

VB

Imports Syncfusion.Windows.Forms.Grid
…
Dim style As New GridStyleInfo()
style.BackColor = Color.Blue
Dim range As GridRangeInfo = GridRangeInfo.Cells(2, 2, 3, 3)
gridControl1.CoveredRanges.Add(range)
' Using Cols can have a range of columns from left to right (left,right).
gridControl1.ChangeCells(GridRangeInfo.Cols(4, 5),New GridStyleInfo() With {.Text="Columnns"})
' Selection is added to the Row.
gridControl1.Selections.Add(GridRangeInfo.Row(4))
'Change the particular cell into blue color.
gridControl1.ChangeCells(GridRangeInfo.Cell(1,1), style)
' Change cell style at particular rows.
gridControl1.ChangeCells(GridRangeInfo.Rows(6,7), New GridStyleInfo() With {.BackColor= Color.Green})

 

ranges in GridRangeInfo

Figure 1: Ranges in GirdRangeInfo

Samples:

C#: GridRangeInfo

VB: GridRangeInfo

 

2X faster development

The ultimate WinForms UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

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

Up arrow icon

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