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: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

GridDataControl display row numbers

Thread ID:





108507 Apr 24,2013 06:53 PM UTC Apr 25,2013 10:00 AM UTC WPF 1
Tags: GridControl
Asked On April 24, 2013 06:53 PM UTC

Hi, I am using GridDataControl WPF control and binding data to the view using mvvm. How can i display row numbers in the grid ? is there a built in functionality to do that ? Basically i want to display the sequence numbers for each row in the grid.


Divya A [Syncfusion]
Replied On April 25, 2013 10:00 AM UTC

Hi Raghu,


Thanks for using Syncfusion products.


We have analyzed your query, you can achieve your requirement by enabling ShowRowHeader API as true and you can set the row numbers in the row header by handling QueryCellInfo event. You can handle event inside a Behavior in MVVM pattern.



Code Snippet:


     <syncfusion:GridDataControl x:Name="SyncGrid"


                                    ItemsSource="{StaticResource ComboSource}"










    GDC.Model.QueryCellInfo += new GridQueryCellInfoEventHandler(Model_QueryCellInfo);



        void Model_QueryCellInfo(object sender, GridQueryCellInfoEventArgs e)


            var style = e.Style as GridDataStyleInfo;


            if (style.CellIdentity.TableCellType == GridDataTableCellType.RowHeaderCell)


                e.Style.CellValue = e.Style.CellRowColumnIndex.RowIndex;






We have prepared a sample based on your requirement and attached it in the following location.


Sample: GridDataControlSample.zip





This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

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

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