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

problem with binding in R2

1 Answer 101 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Kineas
Top achievements
Rank 1
Kineas asked on 08 Aug 2011, 05:44 PM
Hello,

just moved from R1 to R2 and we have a problem with some of the bindings in the GridView
In the UC I have a grid described like this:
<telerik:RadGridView
                            Margin="6,6,1,4"
                            CanUserReorderColumns="False"
                            CanUserDeleteRows="False"
                            CanUserInsertRows="False"
                            IsReadOnly="True"
                            AutoGenerateColumns="False"
                            IsFilteringAllowed="False"
                            SelectionMode="Extended"
                            SelectedItem="{Binding PersoanaSelectata, Mode=TwoWay}"
                            ItemsSource="{Binding Persoane, Mode=TwoWay}"
                            Name="radGridViewPersoane"
                            ShowGroupPanel="False" >
                   <telerik:RadGridView.Columns>
                       <telerik:GridViewDataColumn Header="Nume"
                                           DataMemberBinding="{Binding Nume}"  Width="4*" TextWrapping="Wrap" IsReadOnly="True"/>
                       <telerik:GridViewDataColumn Header="Prenume"
                                           DataMemberBinding="{Binding Prenume}" Width="4*" TextWrapping="Wrap" IsReadOnly="True"/>
                       
                   </telerik:RadGridView.Columns>
               </telerik:RadGridView>

in the vm I have the properties

private VerificarePersoana _verificarePersoana;
        public VerificarePersoana VerificarePersoana
        {
            get
            {
                if (_verificarePersoana == null)
                    _verificarePersoana = new VerificarePersoana();
                return _verificarePersoana;
            }
            set
            {
                _verificarePersoana = value;
                Notify("VerificarePersoana");
            }
        }
 
        private ObservableCollection<Persoana> persoane;
        public ObservableCollection<Persoanaa> Persoane
        {
            get
            {
                if (_verificarePersoana.Persoane == null)
                {
                    _verificarePersoana.Persoane = new ObservableCollection<Persoana>();
                    
                }
                return _verificarePersoana.Persoane;
            }
            set
            {
                _verificarePersoana.Persoane = value;
                Notify("Persoane");
            }
        }



and in  persoana I have something like
private string _nume;
public string Nume
{
    get { return _nume; }
    set { _nume = value; Notify("Nume"); }
}
 
private string _prenume;
public string Prenume { get { return _prenume; } set { _prenume=value; Notify("Prenume"); } }

  public void Notify(string propertyName)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }


My problem is that in R1 when I updated the information in a separate form for one of the entries the information got updated in the grid too. now it doesn't do that. If i sort the items by a column the information shows up correctly again.

Why is that? i would really like to move my solution to R2 but this is really a problem.

Thanks in advance.

1 Answer, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 09 Aug 2011, 07:03 AM
Hi,

 Please open support ticket and send us an example project where we can reproduce and debug the wrong grid behavior compared to previous version!

Best wishes,
Vlad
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

Tags
GridView
Asked by
Kineas
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Share this question
or