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

How to find ColumnIndex knowing ColumnName

Thread ID:





115851 Feb 11,2014 06:20 PM UTC Feb 24,2014 06:13 AM UTC WPF 1
Tags: GridDataControl
Grzegorz Vaban
Asked On February 11, 2014 06:20 PM UTC

What is the best way to find current column index having column name? I was hoping to find it inside GridDataStyleInfo.CellIdentity.Column property, but it seems to be null most of the time. 


Saravanan M [Syncfusion]
Replied On February 24, 2014 06:13 AM UTC


Hi Vaban,

 We are sorry for delay caused,

 We have analyzed your query. You can find the column index by knowing the column name. You need to call IndexOf method to find the Visible Column index. Please refer the below code snippet.

 Code snippet[C#]:

private void Button_Click(object sender, RoutedEventArgs e)


 var column=this.syncgrid.VisibleColumns["ProductName"];

 int index = this.syncgrid.VisibleColumns.IndexOf(column);



We have prepared the sample based on your requirement and you can download it from below attachment. 

Please let us know if this sample helps you ,




Attachment: GDC_Sample_ColumnIndex_c147e96e.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