Welcome to the Xceed Community | Help
Community Search  
More Search Options

DataGrid CellValidationRule across rows

Sort Posts: Previous Next
  •  06-23-2010, 12:29 AM Post no. 27245

    DataGrid CellValidationRule across rows

    Hi

     I am trying to implement a CellValidationRule that will throw an error if a duplicate entry exists in the grid already. 

    The problem is that within my custom validation method, the thrid parameter "CellValidationContext context" refers to a cell, and i can not gain access to the grid control from this object.

    I can get the parent row "context.Cell.ParentRow" however there doesn't seem to be a link from the cell to the grid control.  The grid control would have Items list which could be used to test for duplicates.

    Analysing context under the debugger i can see context.Cell.ParentColumn.DataGridControl, however this is not available from code.

    I also saw the post http://xceed.com/CS/forums/ShowPost.aspx?PostID=13649, but context.DataItem can not be cast as a System.Data.DataRow.

    Am i missing something here ?

    Regards

    ViN

  •  06-23-2010, 12:55 AM Post no. 27246 in reply to 27245

    Re: DataGrid CellValidationRule across rows

    Finally found it ..

     http://xceed.com/CS/forums/thread/23698.aspx

    DataGridControl.GetDataGridContext(cell ).DataGridControl;//where cell is a Cell object

     Regards

    ViN

View as RSS news feed in XML
Contact | Site Map | Reviews | Legal Terms of Use | Trademarks | Privacy Statement Copyright 2011 Xceed Software Inc.