Reverse search by dataObjects

Completed

Comments

1 comment

  • Dapfor Team

    Hi,

    A small clarification: the same data object can be inserted several times into the .Net Grid. Thus the grid should return a collection of Rows as well as the first found Row.

    Here is an example:

    public void ReverseSearchExample(Grid grid)
    {
        //Add some products...
        Product product1 = new Product();
        Product product2 = new Product();
        grid.Rows.Add(product1);
        grid.Rows.Add(product2);
       
        //The first found row (not the first visible - just the first found!)
        Row row1 = grid.DataObjects.FindFirstRow(product1);
        //Enumerate all rows, related to the data object
        foreach (Row row in grid.DataObjects.Find(product1))
        {
            //Do something here
        }
    }
    0
    Comment actions Permalink

Please sign in to leave a comment.

Powered by Zendesk