This is a migrated thread and some comments may be shown as answers.

[Solved] Itemsource not updated?

1 Answer 125 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Shipra
Top achievements
Rank 1
Shipra asked on 01 Jun 2009, 04:33 AM

 

 

Below is part of the XAML for my grid with RadComboBox. I noticed that if the itemsource for the combo is assigned once and if it gets changed again, and the drop down is opened again, the new itemsource doesn't take effect. It still has the old items. The DropDownOpenEvent has the old list of items. The binded property to itemsource is an Observable collection.

Thanks
Shipra

<
Grid>

 

 

 

<telerikGrid:RadGridView x:Name="RequirementJurisdictionOverrideGridView" Grid.Column="0" IsReadOnly="False" ColumnsWidthMode="Fill" AutoGenerateColumns="False"

 

 

ItemsSource="{Binding Path=RequirementJurisdictionOverrideList}"

 

 

ShowGroupPanel="False" IsEnabled="{Binding IsEditable}" IsEnabledChanged="RequirementJurisdictionOverrideGridView_IsEnabledChanged" >

 

 

 

<telerikGrid:RadGridView.Columns>

 

 

 

<telerikGrid:GridViewDataColumn Width="20">

 

 

 

<telerikGrid:GridViewDataColumn.CellStyle>

 

 

 

<Style TargetType="GridView:GridViewCell">

 

 

 

<Setter Property="Template">

 

 

 

<Setter.Value>

 

 

 

<ControlTemplate TargetType="GridView:GridViewCell">

 

 

 

<Button Content="X" Click="RemoveRequirementJurisdictionOverride_Click" Width="20"/>

 

 

 

</ControlTemplate>

 

 

 

</Setter.Value>

 

 

 

</Setter>

 

 

 

</Style>

 

 

 

</telerikGrid:GridViewDataColumn.CellStyle>

 

 

 

</telerikGrid:GridViewDataColumn>

 

 

 

<telerikGrid:GridViewDataColumn HeaderText="Jurisdictions">

 

 

 

<telerikGrid:GridViewDataColumn.CellStyle>

 

 

 

<Style TargetType="GridView:GridViewCell">

 

 

 

<Setter Property="Template">

 

 

 

<Setter.Value>

 

 

 

<ControlTemplate TargetType="GridView:GridViewCell">

 

 

 

<Controls:RadComboBox ItemsSource="{Binding AllJurisdictions}" DisplayMemberPath="JurisdictionName" SelectedItem="{Binding Path=RequirementJurisdictionOverrideJurisdiction, Mode=TwoWay}"></Controls:RadComboBox>

 

 

 

</ControlTemplate>

 

 

 

</Setter.Value>

 

 

 

</Setter>

 

 

 

</Style>

 

 

 

</telerikGrid:GridViewDataColumn.CellStyle>

 

 

 

</telerikGrid:GridViewDataColumn>

 

 

 

<telerikGrid:GridViewDataColumn HeaderText="Functions">

 

 

 

<telerikGrid:GridViewDataColumn.CellStyle>

 

 

 

<Style TargetType="GridView:GridViewCell">

 

 

 

<Setter Property="Template">

 

 

 

<Setter.Value>

 

 

 

<ControlTemplate TargetType="GridView:GridViewCell">

 

 

 

<Controls:RadComboBox ItemsSource="{Binding OverrideFunctions}" DisplayMemberPath="FunctionName" SelectedItem="{Binding Path=RequirementJurisdictionOverrideFunction, Mode=TwoWay}"></Controls:RadComboBox>

 

 

 

</ControlTemplate>

 

 

 

</Setter.Value>

 

 

 

</Setter>

 

 

 

</Style>

 

 

 

</telerikGrid:GridViewDataColumn.CellStyle>

 

 

 

</telerikGrid:GridViewDataColumn>

 

1 Answer, 1 is accepted

Sort by
0
Pavel Pavlov
Telerik team
answered on 04 Jun 2009, 01:16 PM
Hi Shipra,

Can you please show me ( e.g. paste some code )  - how exactly do you change the itemsssource for the combo.  Also is the OverrideFunctions property a dependency property? By changing the ItemsSource do you mean changing the entire collection with a new instance or just changing an item/items within the original collection. I will need to know these detailse before I investigate further.

Thanks!

Pavel Pavlov
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
GridView
Asked by
Shipra
Top achievements
Rank 1
Answers by
Pavel Pavlov
Telerik team
Share this question
or