This question is locked. New answers and comments are not allowed.
Hi,
I am having trouble with my particualr scenario. I have an Item object with the following properties...
ItemNumber, Description, CategoryID, ProductGroupID, ModifiedDate
Category and ProductGroup object has ID(long) and Description(string) properties and are "Attributes" of Item
The Attribute was added on another screen, and now I want to edit or add the association of the Attribute to the Item
I need a grid that pulls all the Items by the customer and populates the entire item if any exist to look like this
ItemNumber Description Category ProductGroup ModifiedDate
00001 my item 4 My Product Grp 09/25/09
I want comboboxes on Category and ProductGroup....On Category i want the ID of the Category Object to be displayed. On ProductGroup, I want the Product Group Description to be displayed and be able to click the cell on either to put into edit mode at which point, the combobox is displayed. The Category combobox needs to display all the Category IDs available, and the ProductGroup needs to display all the descriptions of product groups available, but when selected it needs to update the complete item with just the ids because the table for my item just contains the ids of these attributes and my constructor for item only takes the ids of the attributes being assigned. How do I create a grid to have the correct bindings to these items and how does the Item Object get updated with the correct ids?
I am completely lost on how to accomplish what im trying to do in both xaml and C#...
I am having trouble with my particualr scenario. I have an Item object with the following properties...
ItemNumber, Description, CategoryID, ProductGroupID, ModifiedDate
Category and ProductGroup object has ID(long) and Description(string) properties and are "Attributes" of Item
The Attribute was added on another screen, and now I want to edit or add the association of the Attribute to the Item
I need a grid that pulls all the Items by the customer and populates the entire item if any exist to look like this
ItemNumber Description Category ProductGroup ModifiedDate
00001 my item 4 My Product Grp 09/25/09
I want comboboxes on Category and ProductGroup....On Category i want the ID of the Category Object to be displayed. On ProductGroup, I want the Product Group Description to be displayed and be able to click the cell on either to put into edit mode at which point, the combobox is displayed. The Category combobox needs to display all the Category IDs available, and the ProductGroup needs to display all the descriptions of product groups available, but when selected it needs to update the complete item with just the ids because the table for my item just contains the ids of these attributes and my constructor for item only takes the ids of the attributes being assigned. How do I create a grid to have the correct bindings to these items and how does the Item Object get updated with the correct ids?
| <telerikGrid:RadGridView x:Name="RadGridView1" AutoGenerateColumns="False" Width="Auto" HorizontalAlignment="Stretch" > |
| <telerikGrid:RadGridView.Columns> |
| <telerikGrid:GridViewDataColumn Header="Item #" DataMemberBinding="{Binding ItemNumber, Mode=TwoWay}" > |
| <telerikGrid:GridViewDataColumn.CellTemplate> |
| <DataTemplate> |
| <TextBlock Text="{Binding ItemNumber}" /> |
| </DataTemplate> |
| </telerikGrid:GridViewDataColumn.CellTemplate> |
| <telerikGrid:GridViewDataColumn.CellEditTemplate> |
| <DataTemplate> |
| <TextBox Text="{Binding ItemNumber, Mode=TwoWay}" /> |
| </DataTemplate> |
| </telerikGrid:GridViewDataColumn.CellEditTemplate> |
| </telerikGrid:GridViewDataColumn> |
| <telerikGrid:GridViewDataColumn Header="Item Description" DataMemberBinding="{Binding Description, Mode=TwoWay}" Width="*"> |
| <telerikGrid:GridViewDataColumn.CellTemplate> |
| <DataTemplate> |
| <TextBlock Text="{Binding Description}" /> |
| </DataTemplate> |
| </telerikGrid:GridViewDataColumn.CellTemplate> |
| <telerikGrid:GridViewDataColumn.CellEditTemplate> |
| <DataTemplate> |
| <TextBox Text="{Binding Description, Mode=TwoWay}" /> |
| </DataTemplate> |
| </telerikGrid:GridViewDataColumn.CellEditTemplate> |
| </telerikGrid:GridViewDataColumn> |
| <telerikGrid:GridViewDataColumn HeaderText="Category" DataMemberBinding="{Binding CategoryId, Mode=TwoWay}" TextAlignment="Right"> |
| <telerikGrid:GridViewDataColumn.CellTemplate> |
| <DataTemplate> |
| <TextBlock Text="{Binding CategoryId}" /> |
| </DataTemplate> |
| </telerikGrid:GridViewDataColumn.CellTemplate> |
| <telerikGrid:GridViewDataColumn.CellEditTemplate> |
| <DataTemplate> |
| <ComboBox DisplayMemberPath="{Binding CategoryId, Mode=TwoWay}" /> |
| </DataTemplate> |
| </telerikGrid:GridViewDataColumn.CellEditTemplate> |
| </telerikGrid:GridViewDataColumn> |
| <telerikGrid:GridViewDataColumn HeaderText="Product Group" DataMemberBinding="{Binding ProductGroupId, Mode=TwoWay}" TextAlignment="Right"> |
| <telerikGrid:GridViewDataColumn.CellTemplate> |
| <DataTemplate> |
| <TextBlock Text="{Binding Description}" /> <!--need productgroup objects description here --> |
| </DataTemplate> |
| </telerikGrid:GridViewDataColumn.CellTemplate> |
| <telerikGrid:GridViewDataColumn.CellEditTemplate> |
| <DataTemplate> |
| <ComboBox DisplayMemberPath="{Binding Description, Mode=TwoWay}" /> |
| </DataTemplate> |
| </telerikGrid:GridViewDataColumn.CellEditTemplate> |
| </telerikGrid:GridViewDataColumn> |
| <telerikGrid:GridViewDataColumn HeaderText="ModifiedDate" DataMemberBinding="{Binding Date, Mode=TwoWay}"> |
| <telerikGrid:GridViewDataColumn.CellTemplate> |
| <DataTemplate> |
| <TextBlock Text="{Binding Date}" /> |
| </DataTemplate> |
| </telerikGrid:GridViewDataColumn.CellTemplate> |
| <telerikGrid:GridViewDataColumn.CellEditTemplate> |
| <DataTemplate> |
| <telerikInput:RadDatePicker SelectedDate="{Binding ModifiedDate, Mode=TwoWay}" /> |
| </DataTemplate> |
| </telerikGrid:GridViewDataColumn.CellEditTemplate> |
| </telerikGrid:GridViewDataColumn> |
| </telerikGrid:RadGridView.Columns> |
| </telerikGrid:RadGridView> |
I am completely lost on how to accomplish what im trying to do in both xaml and C#...
