This question is locked. New answers and comments are not allowed.
Hi,
I'm having an issue with the GridViewComboBoxColumn where the selected values for ALL of my rows don't always display.
The images I've attached show what I mean. I have no clue how they'll post, but they're attached.
I am writing this using the MVVM pattern, so everything is binding to my View Model. Also, I'm using RIA Services and the ADO.NET Entity Framework to pull data from my SQL Server Database.
In said database, I have two relevant tables:
Material
ID (int)
GaugeID (int)
Name (nvarchar(63))
Grade (nvarchar(63))
Thickness(numeric(5,4))
WeightPerSquareFoot(numeric(9,4))
Gauge
ID (int)
Name (nvarchar(63))
And, of course, there is a foreign key between Material.GaugeID and Gauge.ID.
So, here's the XAML for my RadGridView:
Materials and Gauges are both fetched from the RIA Services when the Page loads.
The values display correctly (when they display), and when I make changes to the values the changes stick. I just can't get them to reliably display. Any ideas?
Thanks,
-Dan Pingel Materials and Gauges are both fetched from the RIA Services when the Page loads.The values display correctly (when they display), and when I make changes to the values the changes stick. I just can't get them to reliably display. Any ideas?Thanks,-Dan Pingel
I'm having an issue with the GridViewComboBoxColumn where the selected values for ALL of my rows don't always display.
The images I've attached show what I mean. I have no clue how they'll post, but they're attached.
I am writing this using the MVVM pattern, so everything is binding to my View Model. Also, I'm using RIA Services and the ADO.NET Entity Framework to pull data from my SQL Server Database.
In said database, I have two relevant tables:
Material
ID (int)
GaugeID (int)
Name (nvarchar(63))
Grade (nvarchar(63))
Thickness(numeric(5,4))
WeightPerSquareFoot(numeric(9,4))
Gauge
ID (int)
Name (nvarchar(63))
And, of course, there is a foreign key between Material.GaugeID and Gauge.ID.
So, here's the XAML for my RadGridView:
<telerik:RadGridView Grid.Row="0" ItemsSource="{Binding Materials}" SelectedItem="{Binding SelectedMaterial, Mode=TwoWay}" CanUserResizeColumns="False" CanUserInsertRows="False" CanUserFreezeColumns="False" AutoGenerateColumns="False" SelectionMode="Single" ShowGroupPanel="False"> <telerik:RadGridView.RowStyle> <Style TargetType="telerik:GridViewRow"> <Setter Property="MinHeight" Value="30"/> </Style> </telerik:RadGridView.RowStyle> <telerik:RadGridView.Columns> <telerik:GridViewToggleRowDetailsColumn /> <telerik:GridViewDataColumn Header="Material Name" DataMemberBinding="{Binding Name}" Width="*" /> <telerik:GridViewComboBoxColumn Header="Gauge" DataMemberBinding="{Binding GaugeID}" ItemsSource="{Binding Gauges}" DisplayMemberPath="Name" SelectedValueMemberPath="ID" Width="*"/> <telerik:GridViewDataColumn Header="Grade" DataMemberBinding="{Binding Grade}" Width="*" /> <telerik:GridViewDataColumn Header="Thickness" DataMemberBinding="{Binding Thickness}" Width="*" /> <telerik:GridViewDataColumn Header="Wt. / Sq. Foot" DataMemberBinding="{Binding WeightPerSquareFoot}" Width="*" /> </telerik:RadGridView.Columns> </telerik:RadGridView>And the view model:
private IEnumerable<Material> materials; public IEnumerable<Material> Materials { get { return materials; } private set { if (value != materials) { materials = value; RaisePropertyChanged("Materials"); } } } private IEnumerable<Gauge> gauges; public IEnumerable<Gauge> Gauges { get { return gauges; } private set { if (value != gauges) { gauges = value; RaisePropertyChanged("Gauges"); } } } private Material selectedMaterial; public Material SelectedMaterial { get { return this.selectedMaterial; } set { if (value != this.selectedMaterial) { this.selectedMaterial = value; this.RaisePropertyChanged("SelectedMaterial"); DeleteMaterialCommand.RaiseCanExecuteChanged(); } } }Materials and Gauges are both fetched from the RIA Services when the Page loads.
The values display correctly (when they display), and when I make changes to the values the changes stick. I just can't get them to reliably display. Any ideas?
Thanks,
-Dan Pingel Materials and Gauges are both fetched from the RIA Services when the Page loads.The values display correctly (when they display), and when I make changes to the values the changes stick. I just can't get them to reliably display. Any ideas?Thanks,-Dan Pingel