Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
330
Select a row with specific DataRecord and highlight/activate it programmatically in XamTreeGrid.
posted
I have a XamTreeGrid, version 15.1. I would like to select a row with specific DataRecord and highlight/activate it programmatically. The grid should scroll to the proper location if the selected row is not visible. I'm trying next codes: var rec = XamGrid.GetRecordFromDataItem(someValue, true); // the rec exactly is not null rec.IsActive = rec.IsSelected = true; XamGrid.ActiveRecord = rec; XamGrid.BringRecordIntoView(rec). But any method does not work (((. Always was selected first row. How to programmatically select and highlight/activate row in XamTreeGrid with specific DataRecord?
Parents
No Data
Reply
  • 2490
    Verified Answer
    Offline posted

    Hello Igor,

    Thank you for the code example, you have provided.
    You can use, setting the XamTreeGrid's ActiveRecord. When you set it programmatically the XamTreeGrid will scroll to it and will mark it in blue color.
    Like in your example XamGrid.ActiveRecord = rec. And after that you can mark it as selected.

    To illustrate this I have prepared a sample application, please test it with writing Id's which are out of view or are not expanded.

    XamTreeGrid_ActivateRecord.zip
Children
No Data