Hi all,
I am having a XamDataGrid with three columns by default nothing was selected and if we click on any cell then that entire row will be selected and also maximum selected records is only one (Single).
Now my question is, if i click on the already selected row then i need it should be UNSELECTED.
How can i achive this, i am using MVVM model in my FrameWork3.5 with VisualStudio2008.
I need the solution to be in the Xaml file rather then it being in the code.
Thanks in Advance.
Hello nm108,
Thank you for your post.
With regards to unselecting rows within the xamDataGrid control, please refer to the following forum posts:
http://es.infragistics.com/community/forums/p/16193/58983.aspx#58983
http://es.infragistics.com/community/forums/p/29363/127522.aspx#127522
Sincerely,
Hi Pamela Brasil,
Thanks for the support, i have gone through the second link already but no progress. The first link was also of no use, when i am holding the crtl and click the cell it was not unselecting rather additional record was selecting. Here in my case i need only a single record to select and also to unselect by second click.
How to achive this?
*I am using MVVM model with FrameWork3.5 in VisaulStudio2008
Hi,
we have XamDataGrid, we have to select and deselect a row. based on the selection and deselection we are manipulating other items in the view. I have attached a sample project.
In the viewmodel SelectedCustomer property i have added to messagebox to display the state of selection, deselection not at all fired. Kindly help us how to achieve this.
Note: Framework 3.5, Infragistics v12.1
I am also facing the same issue, what saravanan is facing. we need this functionality to be integrated to our application. can anyone helpus to achieve the functionality? please update the sample application provided in the previous post.
Thanks in Advance
Hello,
I'm attaching a sample project where I try to implement the behaviour you want.
Looking for your reply, if this meets your requirements.
Regards,
Anastas
Hi Saravanan,
Do you have any further questions on this matter?
I'm not sure what you mean. The sample I attached is using .NET 3.5 and the System.Windows.Interactivity dll is the 3.5 version.
Do you have the Expression Blend 3 SDK installed? Behaviors were introduced in Blend 3 which was built with .NET 3.5 so that assembly is definitely supported. You just need the 3.5 version.
http://www.microsoft.com/en-us/download/details.aspx?id=22829
Hi Rob,
The sample you have given is using the System.Windows.Interactivity DLL which is not supported in .NET 3.5, so the sample is not working.
can you please give me a sample which works.
Thanks
Saravanan J
It's not really possible to do this from the viewmodel since we need to handle the PreviewMouseLeftButtonDown event. We can make this follow MVVM better by getting rid of the extended class 'CustomXamDataGrid' and moving the logic to a behavior that we can attach to the regular XamDataGrid in XAML. This way we're left with an empty code-behind file and a reusable behavior. Take a look at the attached sample.
The sample you have given is working fine, thanks for the timely help.
Note: Is it possible to achieve it in viewmodel, instead of codebehind?