Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
node('content')
node('GithubContent')
{
timestamps
{
Expand Down
2 changes: 1 addition & 1 deletion WindowsForms-toc.html
Original file line number Diff line number Diff line change
Expand Up @@ -2180,7 +2180,7 @@
<a href="/windowsforms/Grid-Control/how-to/common/how-to-change-the-mouse-cursor-for-a-gridcontrol">How to Change the Mouse Cursor for a GridControl</a>
</li>
<li>
<a href="/windowsforms/Grid-Control/how-to/General/how-does-the-helper-class-support-percentage-sizinng-in-gridcontrol-or-griddataboundgrid">How Does the Helper Class Support Percentage Sizinng in GridControl or GridDataBoundGrid</a>
<a href="/windowsforms/Grid-Control/how-to/General/how-does-the-helper-class-support-percentage-sizing-in-gridcontrol-griddataboundgrid">How Does the Helper Class Support Percentage Sizing in GridControl or GridDataBoundGrid</a>
</li>
</ul>
</li>
Expand Down
38 changes: 19 additions & 19 deletions WindowsForms/Grid-Control/Appearance-and-Formatting.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,35 +8,35 @@ documentation: ug
---

# Appearance and Formatting in Windows Forms Grid Control
GridControl provides lot of properties and events for customizing the appearance of the grid. This section explains the appearance and formatting available in GridControl. GridControl provides different kinds visual styles, which changes the appearance of the whole grid. To know more about the Visual Styles check the link over [here](https://help.syncfusion.com/windowsforms/grid-control/visual-styles).
Grid Control provides lot of properties and events for customizing the appearance of the grid. This section explains the appearance and formatting available in Control. The control provides different kinds visual styles, which changes the appearance of the whole grid. To know more about the Visual Styles check the link over [here](https://help.syncfusion.com/windowsforms/grid-control/visual-styles).

## Grid control designer
GridControl has an excellent user friendly design-time support. A GridControl’s edit designer is added to the grid to ease the process of designing GridControl on a cell level. Using the editor, Grid can be modified, saved, and loaded to XML formatted files or to SOAP formatted templates. 
Grid Control has an excellent user friendly design-time support. A control’s edit designer is added to the grid to ease the process of designing the control on a cell level. Using the editor, Grid can be modified, saved, and loaded to XML formatted files or to SOAP formatted templates. 

Following is the step-by-step procedure to save the GridControl into an XML format
Following is the step-by-step procedure to save the Grid Control into an XML format

1. Right click the Grid control. A context menu is displayed.
2. Select `Edit` from the context menu drop-down.

![Appearance-and-Formatting_img1](Appearance-and-Formatting_images/Appearance-and-Formatting_img1.jpeg)

3. GridControl Designer window will be opened. In that select the File -> Save to XML option.
3. Grid Control Designer window will be opened. In that select the File -> Save to XML option.

![Appearance-and-Formatting_img2](Appearance-and-Formatting_images/Appearance-and-Formatting_img2.jpeg)

N> Editor opens up on the right hand side of the page and Grid Properties tab is highlighted by default. The cell content, styles and general grid properties can be modified under Grid Properties tab.

4. A dialog box will be opened. Save the XML file in the desired location.

The cell styles of the Grid can be changed by using the Grid Properties tab and Selected Range tab in the designer which is located at the right side of the GridControl designer. For more information on how to customize the cells using the GridControl designer, check the link over [here](https://help.syncfusion.com/windowsforms/grid-control/populating-data#modifying-cell-styles-through-designer).
The cell styles of the Grid can be changed by using the Grid Properties tab and Selected Range tab in the designer which is located at the right side of the Grid Control designer. For more information on how to customize the cells using the control designer, check the link over [here](https://help.syncfusion.com/windowsforms/grid-control/populating-data#modifying-cell-styles-through-designer).

N> The system prompts you to save the changes to the Grid control in the designer if exited without saving.

## Grid properties
This section would explain the list of properties that changes the Appearance, Print Styles, and Scroll Bar settings of GridControl.
This section would explain the list of properties that changes the Appearance, Print Styles, and Scroll Bar settings of Grid Control.

### Appearance properties
The properties that mainly affect the appearance of cells in GridControl are listed below.
The properties that mainly affect the appearance of cells in Grid Control are listed below.

#### Hiding verticalLines
To display the grid without the vertical lines, set the [DisplayVerticalLines](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Grid.GridControl.html#Syncfusion_Windows_Forms_Grid_GridControl_DisplayVerticalLines) property to `false`.
Expand Down Expand Up @@ -70,7 +70,7 @@ Me.gridControl.DisplayHorizontalLines = False
![Appearance-and-Formatting_img4](Appearance-and-Formatting_images/Appearance-and-Formatting_img4.jpeg)

#### Border line color
The color of vertical and horizontal lines can be set for GridControl by using the [GridLineColor](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Grid.GridControl.html#Syncfusion_Windows_Forms_Grid_GridControl_GridLineColor) property.
The color of vertical and horizontal lines can be set for Grid Control by using the [GridLineColor](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Grid.GridControl.html#Syncfusion_Windows_Forms_Grid_GridControl_GridLineColor) property.

{% tabs %}
{% highlight c# %}
Expand All @@ -86,7 +86,7 @@ Me.gridControl.GridLineColor = Color.Orange
![Appearance-and-Formatting_img5](Appearance-and-Formatting_images/Appearance-and-Formatting_img5.jpeg)

#### Border styles
The `BorderStyle` for the GridControl can be set by using [DefaultGridBorderStyle](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Grid.GridControl.html#Syncfusion_Windows_Forms_Grid_GridControl_DefaultGridBorderStyle) property.[GridBorderStyle](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Grid.GridBorderStyle.html) enumeration has provide the following options to set the border style,
The `BorderStyle` for the Grid Control can be set by using [DefaultGridBorderStyle](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Grid.GridControl.html#Syncfusion_Windows_Forms_Grid_GridControl_DefaultGridBorderStyle) property.[GridBorderStyle](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Grid.GridBorderStyle.html) enumeration has provide the following options to set the border style,

* DashDot
* DashDotDot
Expand All @@ -111,7 +111,7 @@ Me.gridControl.DefaultGridBorderStyle = GridBorderStyle.DashDotDot
![Appearance-and-Formatting_img6](Appearance-and-Formatting_images/Appearance-and-Formatting_img6.jpeg)

#### Setting background image
The background of the GridControl can be filled with an image by using [BackgroundImage](https://learn.microsoft.com/en-us/dotnet/api/system.windows.forms.control.backgroundimage?view=windowsdesktop-8.0&viewFallbackFrom=net-5.0) property.
The background of the Grid Control can be filled with an image by using [BackgroundImage](https://learn.microsoft.com/en-us/dotnet/api/system.windows.forms.control.backgroundimage?view=windowsdesktop-8.0&viewFallbackFrom=net-5.0) property.

{% tabs %}
{% highlight c# %}
Expand All @@ -137,7 +137,7 @@ Me.gridControl.TransparentBackground = True

![Appearance-and-Formatting_img7](Appearance-and-Formatting_images/Appearance-and-Formatting_img7.jpeg)

While changing the Background image of GridControl, the [BackgroundImageChanged](https://learn.microsoft.com/en-us/dotnet/api/system.windows.forms.control.backgroundimagechanged?view=windowsdesktop-8.0&viewFallbackFrom=net-5.0) event will be fired.
While changing the Background image of Grid Control, the [BackgroundImageChanged](https://learn.microsoft.com/en-us/dotnet/api/system.windows.forms.control.backgroundimagechanged?view=windowsdesktop-8.0&viewFallbackFrom=net-5.0) event will be fired.

{% tabs %}
{% highlight c# %}
Expand Down Expand Up @@ -187,7 +187,7 @@ Me.gridControl.Properties.ResetBackgroundColor()
{% endtabs %}

#### Hiding column headers
The [ColHeaders](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Grid.GridProperties.html#Syncfusion_Windows_Forms_Grid_GridProperties_ColHeaders) property used to indicate whether the GridControl should display column headers or not.
The [ColHeaders](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Grid.GridProperties.html#Syncfusion_Windows_Forms_Grid_GridProperties_ColHeaders) property used to indicate whether the Grid Control should display column headers or not.

{% tabs %}
{% highlight c# %}
Expand Down Expand Up @@ -323,23 +323,23 @@ Me.gridControl.Properties.ResizingCellsLinesColor = Color.Red
![Appearance-and-Formatting_img16](Appearance-and-Formatting_images/Appearance-and-Formatting_img16.jpeg)

### Print properties
GridControl provides lot properties which specifically relates to printing functionality. For enabling the GridControl to the printing mode make use of the Printing property.
Grid Control provides lot properties which specifically relates to printing functionality. For enabling the control to the printing mode make use of the Printing property.

{% tabs %}
{% highlight c# %}
// Switches to printing mode of the GridControl.
// Switches to printing mode of the Grid Control.
this.gridControl1.Properties.Printing = true;
{% endhighlight %}
{% highlight vb %}
'Switches to printing mode of the GridControl.
'Switches to printing mode of the Grid Control.
Me.gridControl1.Properties.Printing = True
{% endhighlight %}
{% endtabs %}

The list of print properties available in GridControl can be viewed in the separate topic named Printing. Refer that topic for more detailed explanation on Printing functionality.
The list of print properties available in Grid Control can be viewed in the separate topic named Printing. Refer that topic for more detailed explanation on Printing functionality.

### Scroll bar properties
GridControl provides support to control functionalities and appearance of grid scroll bars. To enable or disable the scrolling make use of the [HScrollBehavior](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Grid.GridControlBase.html#Syncfusion_Windows_Forms_Grid_GridControlBase_HScrollBehavior) and [VScrollBehavior](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Grid.GridControlBase.html#Syncfusion_Windows_Forms_Grid_GridControlBase_VScrollBehavior) properties. It specifies the behavior of the horizontal and vertical scroll bar respectively.[GridScrollbarMode](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Grid.GridScrollbarMode.html) enumeration provides list of options to control the scroll bar behavior.
Grid Control provides support to control functionalities and appearance of grid scroll bars. To enable or disable the scrolling make use of the [HScrollBehavior](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Grid.GridControlBase.html#Syncfusion_Windows_Forms_Grid_GridControlBase_HScrollBehavior) and [VScrollBehavior](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Grid.GridControlBase.html#Syncfusion_Windows_Forms_Grid_GridControlBase_VScrollBehavior) properties. It specifies the behavior of the horizontal and vertical scroll bar respectively.[GridScrollbarMode](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Grid.GridScrollbarMode.html) enumeration provides list of options to control the scroll bar behavior.

{% tabs %}
{% highlight c# %}
Expand All @@ -360,10 +360,10 @@ Me.gridControl1.VScrollBehavior = GridScrollbarMode.Disabled
{% endhighlight %}
{% endtabs %}

The list of properties related to scroll bar in GridControl can be viewed in the separate topic which comes under Scrolling.
The list of properties related to scroll bar in Grid Control can be viewed in the separate topic which comes under Scrolling.

## GridFormatCellDialog
[GridFormatCellDialog](https://help.syncfusion.com/cr/windowsforms/Syncfusion.GridHelperClasses.GridFormatCellDialog.html) simulates **Format Cells dialog** feature of Microsoft Excel. It provides numerous formatting options such as Font, Alignment, Background, and Number format, which aid in formatting grid cells dynamically. It is now available as an add-on feature for GridControl. `GridFormatCellDialog` class accepts an instance of the GridControl to be formatted, and exposes the above mentioned formatting options to operate on grid cells that are selected. The `GridFormatCellDialog` class comes under the [Syncfusion.GridHelperClasses](https://help.syncfusion.com/cr/windowsforms/Syncfusion.GridHelperClasses.html) library.
[GridFormatCellDialog](https://help.syncfusion.com/cr/windowsforms/Syncfusion.GridHelperClasses.GridFormatCellDialog.html) simulates **Format Cells dialog** feature of Microsoft Excel. It provides numerous formatting options such as Font, Alignment, Background, and Number format, which aid in formatting grid cells dynamically. It is now available as an add-on feature for Control. `GridFormatCellDialog` class accepts an instance of the Grid Control to be formatted, and exposes the above mentioned formatting options to operate on grid cells that are selected. The `GridFormatCellDialog` class comes under the [Syncfusion.GridHelperClasses](https://help.syncfusion.com/cr/windowsforms/Syncfusion.GridHelperClasses.html) library.
![Appearance-and-Formatting_img17](Appearance-and-Formatting_images/Appearance-and-Formatting_img17.jpeg)

This `GridFormatCellDialog` can be enabled by instantiating `GridFormatCellDialog` class and invoking its **ShowDialog** method.
Expand Down
14 changes: 7 additions & 7 deletions WindowsForms/Grid-Control/Cell-Merging.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ control: Grid Control
documentation: ug
---
# Cell Merging in Windows Forms Grid Control
The cell merging is also one of the technique to merge the range of cells in the GridControl. The range of cells will be merged based on the data. The cells which has same data will be merged in row wise in same column or column wise in same row. To enable the merging support in grid, the [MergeCell](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Grid.GridStyleInfo.html#Syncfusion_Windows_Forms_Grid_GridStyleInfo_MergeCell), [MergeCellsMode](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Grid.GridModelOptions.html#Syncfusion_Windows_Forms_Grid_GridModelOptions_MergeCellsMode) and [MergeCellsLayout](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Grid.GridMergeCellsLayout.html) properties can be used.
The cell merging is also one of the technique to merge the range of cells in the Grid Control. The range of cells will be merged based on the data. The cells which has same data will be merged in row wise in same column or column wise in same row. To enable the merging support in grid, the [MergeCell](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Grid.GridStyleInfo.html#Syncfusion_Windows_Forms_Grid_GridStyleInfo_MergeCell), [MergeCellsMode](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Grid.GridModelOptions.html#Syncfusion_Windows_Forms_Grid_GridModelOptions_MergeCellsMode) and [MergeCellsLayout](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Grid.GridMergeCellsLayout.html) properties can be used.

The following code snippet is used to enable the merging in GridControl,
The following code snippet is used to enable the merging in Grid Control,

{% tabs %}
{% highlight c# %}

// Set MergeCells direction for the GridControl.
// Set MergeCells direction for the Grid Control.
this.gridControl1.TableStyle.MergeCell = GridMergeCellDirection.Both;

// Set merge cells behavior for the Grid.
Expand Down Expand Up @@ -47,7 +47,7 @@ The [MergeCell](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.F
{% tabs %}
{% highlight c# %}

// Set MergeCells direction for the GridControl.
// Set MergeCells direction for the Grid Control.
this.gridControl1.TableStyle.MergeCell = GridMergeCellDirection.ColumnsInRow | GridMergeCellDirection.RowsInColumn;
{% endhighlight %}
{% highlight vb %}
Expand All @@ -74,7 +74,7 @@ Me.gridControl1.Model.Options.MergeCellsMode = GridMergeCellsMode.OnDemandCalcul
{% endhighlight %}
{% endtabs %}

This property is used to set the calculation area for the merge cells in GridControl. The [GridMergeCellsLayout](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Grid.GridMergeCellsLayout.html) provides the following options to set the calculation area for the merging,
This property is used to set the calculation area for the merge cells in Grid Control. The [GridMergeCellsLayout](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Grid.GridMergeCellsLayout.html) provides the following options to set the calculation area for the merging,

* **Grid** – Merge cells for entire grid, may affect the performance for the large grid.<br/>
* **VisibleRange** – Merge cells only in visible range.<br/>
Expand All @@ -89,7 +89,7 @@ Me.gridControl1.Model.Options.MergeCellsLayout = GridMergeCellsLayout.Grid
{% endtabs %}

## Finding a Merged Range of a Cell
The [MergeCells](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Grid.GridModelMergeCells.html) collection maintains the all the merged ranges of a GridControl. To find a merged range of a cell, [FindRange](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Grid.GridModelMergeCells.html#Syncfusion_Windows_Forms_Grid_GridModelMergeCells_FindRange_System_Int32_System_Int32_) method can be used. If the specified cell with row index and column index is inside a ` MergedRange `, a range will be returned. Otherwise it will return the empty range.
The [MergeCells](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Grid.GridModelMergeCells.html) collection maintains the all the merged ranges of a Grid Control. To find a merged range of a cell, [FindRange](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Grid.GridModelMergeCells.html#Syncfusion_Windows_Forms_Grid_GridModelMergeCells_FindRange_System_Int32_System_Int32_) method can be used. If the specified cell with row index and column index is inside a ` MergedRange `, a range will be returned. Otherwise it will return the empty range.

{% tabs %}
{% highlight c# %}
Expand Down Expand Up @@ -140,7 +140,7 @@ Me.gridControl1.Model.MergeCells.EvaluateMergeCells(GridRangeInfo.Rows(1, 3))
{% endtabs %}

## Custom cell merging
The GridControl lets you define the merged cells using [QueryCanMergeCells](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Grid.GridControl.html) event. This event will be raised when grid compares the content of the two cells to determine if they should be merged.
The Grid Control lets you define the merged cells using [QueryCanMergeCells](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Grid.GridControl.html) event. This event will be raised when grid compares the content of the two cells to determine if they should be merged.

Any of the cells can be merged using this event. The [Handled](https://help.syncfusion.com/cr/windowsforms/Syncfusion.ComponentModel.SyncfusionHandledEventArgs.html#Syncfusion_ComponentModel_SyncfusionHandledEventArgs_Handled) and [Result](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Grid.GridQueryCanMergeCellsEventArgs.html#Syncfusion_Windows_Forms_Grid_GridQueryCanMergeCellsEventArgs_Result) properties have to be enabled to perform the customization in this event.

Expand Down
Loading