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.
I have been looking into your requirement and I can say that the thing you would like to achieve cannot be done in MVVM without using any code behind as you want, so my suggestion is to use my previous approach that uses code behind, or if you want I would be glad to log a feature request for adding an ability to use CheckBox as Row’s Selector in the XamGrid.
Looking forward for your reply.
I am just checking the progress of this issue and was wondering if you me to log a feature request on your behalf.
Hi Stefan,
Yes, surely this is a new feature request.
In xamGrid, checkbox can be placed in RowSelector and can also be bind to the bool property of datasource of the XamGrid and should support commanding for MVVM.
One more feature request, though not fully related to XamGrid.
On selection of these checkbox's on runtime, The chart should update themselve, through binding in MVVM, which is not happening, as the XamDataChart Series Property is readony property.
Surely, this feature is a very demanding feature to update the chart on the basis of rowselection in Grid and it will make your product more useful.
I would expect new feature request to be incorporated in the next release.
Yes
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?
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.
I'm actually talking about both the request, XamGrid as well as XamDataChart.
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.