2 Replies Latest reply on Mar 27, 2008 2:52 PM by Neatgadgets

    Find a value in dataGrid

    Neatgadgets Level 1
      I have selected a value on a previous screen that is going to be used on other screens. That value is in a datagrid cell on one of the new screens and I want to select that row given that value. Do I have to loop through the datagrid to find it or is there some other way?

      I know you can select a row with the following:

      datagrid.selectedIndex = index;

      What I want to do is find the index of the row that contains the value from the previous screen.
        • 1. Re: Find a value in dataGrid
          rlc5611 Level 1
          The simple answer is that you do have to loop through to find it. However, you can store ample data in the grid's data provider that does not show up in the grid (i.e. remove columns you don't want displayed). So if you can place some object in the data provider of both grids that you can use to tie them together then you would not have to loop through the second grid to find it.
          • 2. Re: Find a value in dataGrid
            Neatgadgets Level 1
            Thanks for responding, much appreciated.

            I have an ID stored as a hidden column in the data provider already. So how would I go about referencing this in the manner you suggested?