Hi All,
How to highlight the XamGrid row programmaticaly (through c# code) ?
Regards
Sufyan
Hello Stefan,
Thank you for your reply. I check the modified sample when i click on a button my grid is clear, no records are displayed and i used a grid click event to get the selected item and saved in a temporary variable and on GroupByRowCellsPanel_Loaded i assigned that temporary variable to the property that are bound to Grid ActiveItem but still i am not able to highlight the selected record after grid refresh. Please see my attached sample and modify sample again that may be helpful for me.
Regards,
Hello,
I have modified the sample, so now the ActiveItem Property of the XamGrid is bound to a ViewModel’s Property called MyActiveItem, this way by setting this property to an item from the DataSource will activate the desired item in the XamGrid.
Hope this helps you.
Thank you so much for your reply. Actually we use grouping on xamGrid and expand all groups, user select the any row from grid to modify. we done modification through another user control and make some business logic through user control and saved that logic in data base than we fetch all records from database and display in grid. At this state page is refreshed and we loose the selected row. How can select the row that was modified ? Modify sample is attached.
Hello Sufyan,
Thank you for your post. I have been looking into it and I created a sample project with the functionality you want. Basically I have a bool Property in the ViewModel called IsHighlighted and by using DataTrigger in the CellControl’s Style I set the Background of the Cells which Row’s object has this Property set to true. You can just edit the column in the Grid to see how the functionality works. You can also hide IsHighlighted Column from the Grid if you want. Please let me know if this helps you or you need further assistance on this matter.
Looking forward for your reply.
Please keep in mind i am using MVVM. Please help me with sample application.