Home Forums WPF controls Xceed DataGrid for WPF Accesing certain Cell.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #22628 |

    How can I programmatically access Cell at certain Row and Column?

    Imported from legacy forums. Posted by Sergey (had 2792 views)

    Xceed Support
    Member
    Post count: 5658

    You can do so by using the ItemContainerGenerator:

    Row myRow = dataGridControl.ItemContainerGenerator.ContainerFromItem( dataGridControl.Items[x] ) as Row;

    Cell myCell = myRow.Cells[ dataGridControl.Columns[“fieldName”] ];

    Note: Be aware that because of UI Virtualization, the value returned by the ItemContainerGenerator.ContainerFromItem() can be null ( UI is virtualized for the data item ).

    Imported from legacy forums. Posted by Marcus [Xceed] (had 182 views)

    User (Old forums)
    Member
    Post count: 23064

    How can I access a specific control that is in the cell (say forf example a progressbar)?

    Thanks
    Beni

    Imported from legacy forums. Posted by Beni (had 199 views)

    Xceed Support
    Member
    Post count: 5658

    You can always dig the VisualTree using the VisualTreeHelper but my best recommendation would be to place a handler for an event that is significant to you on the control in question and handle your logic from the handler (e.g Loaded event, … ).

    Imported from legacy forums. Posted by Marcus [Xceed] (had 4002 views)

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.