Home Forums WPF controls Xceed DataGrid for WPF Highlight Row by Key

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

    I know a row exists in my datagrid that has a custid of 1000. The custid is unique for each row. How do I locate and highlight that row?

    Imported from legacy forums. Posted by Brian (had 1829 views)

    Xceed Support
    Member
    Post count: 5658

    Because of UI Virtualization… It is possible that at the moment you want to highlight the row… Its UI container does not exist…

    To go over that problem… you can Inject an implicit style in the resource dictionary for the DataGridControl a dynamically created style for DataRow that has a DataTrigger that binds on “custid” and trigs on 1000…

    This method can be painful… but it’s 100% efficient and persistent.

    If you are sure the row is currently “realized”… Then you can find he data item you know exists and call DataGridControl.GetContainerFromItem( ) to get the DataRow. Be aware that if you scroll out of view… any changes done on the Row will be “lost” (that is why the first method is more efficient).

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

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