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. Image for the cookie policy date

Retrieve Column Index based on Column Name

Hi.

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

Thanks.
Pavan Nanduri.

1 Reply

BP Balakrishnan P Syncfusion Team October 10, 2014 11:11 AM UTC

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

 


Loader.
Live Chat Icon For mobile
Up arrow icon