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.

Retrieve Column Index based on Column Name

Thread ID:

Created:

Updated:

Platform:

Replies:

117373 Oct 7,2014 07:49 AM Oct 10,2014 07:11 AM WPF 1
loading
Tags: GridControl
Pavan Nanduri
Asked On October 7, 2014 07:49 AM

Hi.

In GridControl, How can I retrieve 'Column Index' based on 'Column Name'.

Thanks.
Pavan Nanduri.

Balakrishnan P [Syncfusion]
Replied On October 10, 2014 07:11 AM

Hi Pavan,


Thanks for contacting Syncfusion support.


you can get the column index based on column name by using below code snippet. Please find the below code snippet for your reference

Code Snippet:

private void button_Click(object sender, RoutedEventArgs e)

{

        for(int j=0;j

        {

              if (grid.Model[0, j].Text == “ColumnName”)

              MessageBox.Show("selected column is:" + grid.Model[0, j].ColumnIndex);

        }

}

Please let us know if you have any queries.

Thanks

Balakrishnan. P

 


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.

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.

;