I'm trying to understand how to do the things I'm used to do using the Windows Forms Ultragrid...
searching what I wrote on the subject finds only things on the XamDataGrid not related.
I need to know the ActiveRow of the Grid, and seeing that there is an ActiveItem
While in Windows Forms usually I search for the ActiveRow property, with standard WPF list control there is a SelectedItem or an ActiveItem that I can Simply bind to a property on my Model with a Two Way mode, this allows me to get the selected item reading the property and set the selected item changing that property.
I've tried a direct binding of ActiveItem on a property (this kind of binding on a ListBox standard works)
but here I probably do something wrong because my property is never accessed
<ig:XamGrid Name="namesGrid" Grid.Column="2" Grid.Row="1" Margin="0"
AutoGenerateColumns="False" ItemsSource="{Binding Path=SelectedNamesList}"
ActiveItem="{Binding Path=SelectedName, Mode=TwoWay}" ColumnWidth="*" >
if you have any clue
thank you in advance
I've solved the problem:
My Property was a DependencyProperty not a Simple property with INotifyPropertyChanged implemented.
I replaced the Dependency property with a plain property and implemented the interface and everything was OK!
May I ask you if it is opportune that all bound objects (models, or data objects inside models) are Simple objects and not Dependency objects????is there some problem with the WPF objects that binding not always works???
bye
Sabrina
Hi Sabrina,
Thank you for your posts. I am glad that you have managed to resolve your issue. I have been looking into your question and I am not sure why you are trying to use dependency properties in the definition of your data source. It is usually defined with simple properties.
Let me know, if you need any further assistance on this matter.
About the use of dependency properties, the Data usually are just plain classes, but usually the data model relative to a Window or a User control may have the need to work with many things on the WPF user interface, so We tend to use Dependency Properties for all things in the view model bound to the controls properties, just because they don't need manual property changed to inform the UI when they are programmatically changed. This is why I've used a Dependency property, but probably the non working of the property was due to the fact that the ViewModel property was a Dependency Property but the class underneath was a simple data class even if with Property Changed in its elements.
Thank you for your reply. Please let me know, if you need any further assistance on this matter.