reference columns by name or index

3 posts, 0 answers
  1. Jim
    Jim avatar
    68 posts
    Member since:
    Apr 2011

    Posted 19 Oct 2011 Link to this post

    In a bit of a rush so don't have all day to surf !
    But it's a simple question.
    I can access my row such as
    row.Name
    row.Age
    Any way to access as
    row(2)
    or
    row("Age")
    Thanks
    Jim
  2. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 19 Oct 2011 Link to this post

    Hi Jim,

    You need to work with the Items collection of the grid. For example:

    foreach(Player player in this.playersGrid.Items)
    {
         string name = player.Name;
    }

    You can reach each item by its index as well. For example:
    Player sixthPlayer = this.playersGrid.Items[7] as Player;

     

    Greetings,
    Maya
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. Jim
    Jim avatar
    68 posts
    Member since:
    Apr 2011

    Posted 20 Oct 2011 Link to this post

    Thanks
    Jim
Back to Top