How To get Column index from column Name at client-side

2 posts, 0 answers
  1. suraj
    suraj avatar
    2 posts
    Member since:
    Dec 2008

    Posted 24 Dec 2008 Link to this post


    I Am using radgrid in my project. i am implementing a functionality...

    for that i need column index using column name. Can anybody please provide it.

  2. Kevin Babcock
    Kevin Babcock avatar
    189 posts
    Member since:
    Mar 2007

    Posted 28 Dec 2008 Link to this post

    Hello Suraj,

    You can easily use the RadGrid's client-side API to achieve the functionality you desire. Here is an example of how you might create a JavaScript method that would take a column name and return that column's index:

    function getColumnIndexByUniqueName(columnName) { 
        var masterTableView = $find('<%= RadGrid1.ClientID %>').get_masterTableView(); 
        var column = masterTableView.getColumnByUniqueName(columnName); 
        var element = column.get_element(); 
        return element.cellIndex; 

    I hope that helps. Let me know if you have any further questions.

    Kevin Babcock
  3. DevCraft R3 2016 release webinar banner
Back to Top