where can I find guidelines for using xamGrid in a silverlight project with a ORM entity framework?
Hi foxjazz,
check out his help page.
Hope this helps
Ok this was a big help to getting started.
Next question, what's the best way of going about hiding columns?
I am no quite sure what exactly do you mean by hiding columns.
One way would be to remove the columns you don't want from the Columns collection or simply set the column's Visibility property to Collapsed(Suitable when you plan to turn certain columns on and off). Here is a link with more details on working with columns.
Another approach would be using data annotations on your domain objects and marking certain properties with the [DisplayAttribute(AutoGenerate(false)] so the columns wont get auto generated in first place. For more info on DataAnnotations support of XamGrid check this out. Note that DataAnnotations are not supported in the XamGrid for WPF.
The last approach you could take is to hook up to ColumnAutoGenerated event of the xamGrid and put the logic which decides which columns to be Auto Generated.
Regards,
Ok, I have decided not to use autogenerated so now I can select my columns :) this helps.
However now I have a question about using the ComboBoxColumn item in the grid.
I set the key to ProductTypeID field.
I set the DisplayMemberPath to ProductType
I set the valuememberpath to ProductTypeID
My question is what do I set the ItemSource to in order to get the comboboxcolumn populated upon load of the xamgrid?
Hello foxjazz,
I was just wondering did you have a chance to try Konstantin's suggestion. If you still need any assistance on the matter, please do not hesitate to ask.
you probably need to enable the editing of xamGrid. You could check how to set the editing settings at this page.
If this is not the case please provide some code and context of what the scenario is.
You could set the ComboBox column's ItemsSource in xaml by providing a StaticResource(it is not possible to bind it to the rows data) or you could set it through the code-behind.
Ok I found instructions to use the ItemTemplate in order to define the comboboxcolumns.
But I don't see a sample for deriving these columns from a table in a database.
So I draged xamcomboeditor on the page.
And I made a column of comboboxcolumn in a column for the grid both with the same ItemSource data and DisplayMember data.
However when I click on the grid dropdown selector for the combobox, it doesn't attempt to open.
When I click on the xamcomboeditor it opens fine.
What do I need to to to get this to open?