Hi,
I am switching all my XamDataGrids to XamGrids due to high performance in XamGrid.
I had an implementation of Templating RecordSelector in XamDataGrid, with a checkbox to select Rows.
But in XamGrid, I couldn't have this implemented.
I tried templating on RowSelectorCellControl,RowSelectorControl etc. But unsuccessfull.
Can anyone tell me what could be the workaround for this?
Thanks,
VJ
Hello VJ,
I am just checking if you got this worked out or you still require any assistance or clarification on the matter.
I saw your implementation.
In MVVM, we cant play on UI Element directly, we have to use some kind of binding to achieve our goal.
But your implementation, is totally based on UI Elements.
So, kindly provide me an MVVM implementation.
Hello,
Have you logged your own feature request and if so, could tell me what exactly is it for. If you haven’t, could you please tell for which of the existing ones are you asking, the one about XamGrid or the one about XamDataChart.
Looking forward for your reply.
I'm actually talking about both the request, XamGrid as well as XamDataChart.
What is the functionality you want to achieve? I am guessing that you have a property on your Model object called IsSelected and want to bind the IsChecked property of the CheckBox in the RowSelector to that property. If this is the case then the code that was provided is correct and does not belong in a ViewModel. The process of selecting/unselecting when the CheckBox's IsChecked property value changes is the responsibility of the View.
What you want to do is bind your IsSelected property of the Model object to the IsChecked property of the CheckBox in the DataTemplate. Simply add this single line of code to the CheckBox:
< CheckBox IsChecked="{Binding Cell.Row.Data.IsSelected, RelativeSource={RelativeSource AncestorType={x:Type prim:RowSelectorCellControl}}}"
This is under the assumption that you added an IsSelected property to the Person class (model object) in the sample.
My Scenario (In MVVM pattern):
On ViewModel, I have DataTable with IsSelected as one of the column along with the Data.
I want to bind this IsSelected column with a CheckBox/RowSelector to select that record.
Is possible to bind this type of data?
Yes