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

How to find ColumnIndex knowing ColumnName

Thread ID:

Created:

Updated:

Platform:

Replies:

115851 Feb 11,2014 06:20 PM UTC Feb 24,2014 06:13 AM UTC WPF 1
loading
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 ,


Regards,

Saravanan.M

 


Attachment: GDC_Sample_ColumnIndex_c147e96e.zip

CONFIRMATION

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.

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

;