I would like to know is there a way I can use stlye triggers to set Record.IsSelected based on a condition in a record set?
Hello,
Thank you for your post. I have been looking into it and I can say that you are not able to set the IsSelected Property of the DataRecordPresenter via Style, because this Property is set internally by code.
Hope this helps you.
The problem I have is when I load a datagrid I want to set selected records based on a criteria, however I'm having trouble trying to do so using MVVM. I've attached a sample project were I was trying to preselect records based on sex when the datagrid loads.
After looking at this posting I figured out how to pass in the entire datarecord and set is selected:
http://ko.infragistics.com/community/forums/t/69484.aspx
Thanks for your help.
Thank you for your feedback. I am glad that you resolved your issue and I believe that other community members may benefit from this as well. Also as I said before your are not able to use a Converter and Style for the DataRecordPresenter in order to achive this functionality, becasue the IsSelected Property is set internally via code.
Thanks again.
I figured out a way to do it however, I would like to know is there a way I can use a converter to do the following code:
foreach (Record r in xamDataGrid1.Records) { DataRecord dr = r as DataRecord; if (dr.Cells["Sex"].Value.ToString() == "F") { r.IsSelected = true; } }
I've attached an update sample project, to show my scenerio.