Skip to content

Commit db24a0b

Browse files
ES-975464 - Resolve the ReadMe file length issue in this sample repository
1 parent caf671f commit db24a0b

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

README.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,19 @@
11
# How to format the doubletextbox cell in winforms gridcontrol
2-
This example demonstrates how to format the doubletextbox cell in winforms gridcontrol
2+
3+
This example demonstrates how to format the doubletextbox cell in [WinForms GridControl](https://www.syncfusion.com/winforms-ui-controls/grid-control).
4+
5+
By default, the value “0” will be displayed as “0.00” in the [DoubleTextBox](https://help.syncfusion.com/windowsforms/grid-control/enhanced-cell-types#doubletextbox-cell-type) cell. To customize the display format of cell value, use the [DisplayText](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Grid.GridDrawCellDisplayTextEventArgs.html#Syncfusion_Windows_Forms_Grid_GridDrawCellDisplayTextEventArgs_DisplayText) property in [DrawCellDisplayText](https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.Grid.GridControlBase.html#Syncfusion_Windows_Forms_Grid_GridControlBase_DrawCellDisplayText) event.
6+
7+
``` c#
8+
//Event Subscription
9+
gridControl1.DrawCellDisplayText += GridControl1_DrawCellDisplayText;
10+
11+
//Event Customization
12+
private void GridControl1_DrawCellDisplayText(object sender, GridDrawCellDisplayTextEventArgs e)
13+
{
14+
if(e.Style.CellType== CustomCellTypes.DoubleTextBox.ToString() && e.DisplayText== "0.00")
15+
{
16+
e.DisplayText = "0";
17+
}
18+
}
19+
```

0 commit comments

Comments
 (0)