Skip to content

Commit 2a1145a

Browse files
updated KB content
1 parent bc8bc75 commit 2a1145a

File tree

1 file changed

+16
-17
lines changed

1 file changed

+16
-17
lines changed

README.md

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,21 @@ In.NET [MAUI DataGrid](https://www.syncfusion.com/maui-controls/maui-datagrid) (
99

1010
4. Finally, you must add the custom column to the [SfDataGrid.Columns](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.DataGrid.SfDataGrid.html#Syncfusion_Maui_DataGrid_SfDataGrid_Columns) collection and its renderer in the [SfDataGrid.CellRenderers](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.DataGrid.SfDataGrid.html#Syncfusion_Maui_DataGrid_SfDataGrid_CellRenderers) collection.
1111

12-
>Note:
13-
>* *D- type of the view that should be placed inside cells in display mode.*
14-
>* *E- type of the view that should be placed inside cells in edit mode.*
15-
1612
For example, refer the below example in which a custom column is created for loading a Stepper control in the grid columns. A custom renderer class is written to load Stepper control as display.
1713

14+
## XAML
15+
```XAML
16+
<syncfusion:SfDataGrid x:Name="dataGrid"
17+
ItemsSource="{Binding Employees}"
18+
ColumnWidthMode="Auto"
19+
AutoGenerateColumnsMode="None">
20+
<syncfusion:SfDataGrid.Columns>
21+
<local:StepperColumn MappingName="OrderID"/>
22+
</syncfusion:SfDataGrid.Columns>
23+
</syncfusion:SfDataGrid>
24+
25+
```
26+
1827
## C#
1928
### Creating Stepper Column
2029
```C#
@@ -46,28 +55,18 @@ public class StepperColumnRenderer : DataGridCellRenderer<Stepper, Stepper>
4655
```C#
4756
public partial class MainPage : ContentPage
4857
{
49-
public SfDataGrid dataGrid;
50-
EmployeeViewModel viewModel;
58+
5159
public MainPage()
5260
{
5361
InitializeComponent();
54-
dataGrid = new SfDataGrid()
55-
{
56-
ColumnWidthMode = ColumnWidthMode.Auto
57-
};
58-
viewModel = new EmployeeViewModel();
59-
dataGrid.ItemsSource = viewModel.Employees;
60-
dataGrid.AutoGenerateColumnsMode = AutoGenerateColumnsMode.None;
6162
dataGrid.CellRenderers.Add("Stepper", new StepperColumnRenderer());
62-
var customColumn = new StepperColumn();
63-
customColumn.MappingName = "OrderID";
64-
dataGrid.Columns.Add(customColumn);
65-
this.Content = dataGrid;
6663
}
6764
}
6865
```
6966
![How to create a Custom DataGridColumn](CustomDatagridColumn.png)
7067
## Conclusion
68+
I hope you enjoyed learning about how to create custom DataGridColumn in MAUI DataGrid (SfDataGrid).
69+
7170
You can refer to our [.NET MAUI DataGrid’s feature tour](https://www.syncfusion.com/maui-controls/maui-datagrid) page to know about its other groundbreaking feature representations. You can also explore our .NET MAUI DataGrid Documentation to understand how to present and manipulate data.
7271
For current customers, you can check out our .NET MAUI components from the [License and Downloads](https://www.syncfusion.com/account/downloads) page. If you are new to Syncfusion, you can try our 30-day free trial to check out our .NET MAUI DataGrid and other .NET MAUI components.
7372
If you have any queries or require clarifications, please let us know in comments below. You can also contact us through our [support forums](https://www.syncfusion.com/forums), [Direct-Trac](https://support.syncfusion.com/account/login?ReturnUrl=%2Faccount%2Fconnect%2Fauthorize%2Fcallback%3Fclient_id%3Dc54e52f3eb3cde0c3f20474f1bc179ed%26redirect_uri%3Dhttps%253A%252F%252Fsupport.syncfusion.com%252Fagent%252Flogincallback%26response_type%3Dcode%26scope%3Dopenid%2520profile%2520agent.api%2520integration.api%2520offline_access%2520kb.api%26state%3D8db41f98953a4d9ba40407b150ad4cf2%26code_challenge%3DvwHoT64z2h21eP_A9g7JWtr3vp3iPrvSjfh5hN5C7IE%26code_challenge_method%3DS256%26response_mode%3Dquery) or [feedback portal](https://www.syncfusion.com/feedback/maui?control=sfdatagrid). We are always happy to assist you!

0 commit comments

Comments
 (0)