Skip to content

Commit 3acb9b1

Browse files
Addressed the concern
1 parent 72fd666 commit 3acb9b1

3 files changed

Lines changed: 8 additions & 13 deletions

File tree

DisplayRowIndex.png

-60 KB
Binary file not shown.

README.md

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
# How to to display the RowIndex in GridRowHeaderCell when combined with SfDatapager in WPF DataGrid
22

3-
You can display the row index value in the RowHeaderCell by customizing its style with the binding of **RowIndex** to the **TextBlock**.**Text** property, as shown in the link below:
3+
Your requirement is to display row numbers in the GridRowHeaderCell. This functionality can be achieved by customizing the RowHeaderCell style with the binding of RowIndex to the TextBlock.Text property then using a MultiValueConverter and handling the PageIndexChanged event in SfDataPager, as demonstrated below:
44

5-
[Display RowIndex at RowHeaderCell](https://support.syncfusion.com/kb/article/5182/how-to-display-rowindex-at-rowheadercell-in-sfdatagrid-in-wpf-)
6-
7-
Currently, we do not have direct support to display the number of data in the GridRowHeaderCell when combined with SfDataPager. However, you can achieve this functionality by using a MultivalueConverter and handling the PageIndexChanged event in SfDataPager, as demonstrated below:
8-
9-
```C#
5+
6+
```C#
107

11-
private void SfDataPager_PageIndexChanged(object sender, PageIndexChangedEventArgs e)
8+
private void SfDataPager_PageIndexChanged(object sender, PageIndexChangedEventArgs e)
129
{
1310
for (int i = 1; i < dataGrid.RowGenerator.Items.Count; i++)
1411
{
@@ -17,11 +14,11 @@ Currently, we do not have direct support to display the number of data in the Gr
1714
}
1815
}
1916

20-
```
17+
```
2118

2219
```C#
2320

24-
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
21+
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
2522
{
2623
var dataPager = values[2] as SfDataPager;
2724

@@ -38,8 +35,6 @@ Currently, we do not have direct support to display the number of data in the Gr
3835
```
3936

4037
The index is displayed in RowHeaderCell based on the above customized style like below,
41-
![Shows the RowIndex](DisplayRowIndex.png)
42-
43-
![Shows the secondpage RowIndex](SecondPageDisplayRowIndex.png)
38+
![Shows the DisplayRowIndexInGridRowHeaderCell image](DisplayRowIndexInGridRowHeaderCell.gif)
4439

45-
Take a moment to peruse the [WPF DataGrid - Row Header](https://help.syncfusion.com/wpf/datagrid/rows#row-header) documentation, to learn more about Row Header code examples.
40+
Take a moment to peruse the [WPF DataGrid - Row Header](https://help.syncfusion.com/wpf/datagrid/rows#row-header) documentation, to learn more about Row Header code examples.

SecondPageDisplayRowIndex.png

-58.9 KB
Binary file not shown.

0 commit comments

Comments
 (0)