Hi
Say I have a column called CategoryId that contains a numeric value and I want to display a text representation of that value in each cell plus allow the user to edit the value by using a ComboBox editor.
In the asp.net/windows forms grid i could do this by use of a ValueList or ComboBox, setting the datasource of the ComboBox and setting the displaymember and valuemember properties. How can i do this with the xamWebGrid?
Thanks again.
Kevin
We have an example of exactly how to do this using the TempalteColumn in our samples: http://samples.infragistics.com/silverlight/
xamWebGrid > Data Binding and Interaction > Cell Editor Templates
The basic XAML looks like this:
<igGrid:TemplateColumn Key="Category" Width="120" HorizontalContentAlignment="Stretch"> <igGrid:TemplateColumn.ItemTemplate> <DataTemplate> <TextBlock x:Name="CategoryDisplay" Text="{Binding Category}" /> </DataTemplate> </igGrid:TemplateColumn.ItemTemplate> <igGrid:TemplateColumn.EditorTemplate> <DataTemplate> <ComboBox x:Name="CategoryEditList" ItemsSource="{StaticResource categoryProvider}" SelectedItem="{Binding Category, Mode=TwoWay, Converter={StaticResource categoryConverter}, ConverterParameter={StaticResource categoryProvider}}" DisplayMemberPath="Value" /> </DataTemplate> </igGrid:TemplateColumn.EditorTemplate></igGrid:TemplateColumn>
Thanks for that example. I didn't notice you could scroll to the right for even more samples !
I have followed the example and it is not quite the same as my situation. The sample has a category column that displays category names from the itemsource and the combobox is also populated with category names. What I have is a categoryId column with the numeric Id of the category. The itemsource of the combobox is a list of categories with ID and Name properties. I want the grids categoryId column to display the category.name resolved from combobox editor using the id's. This is achievable with asp.net grid and win forms grid.
Can this be done?
Thanks