New added item doesn't displayed in grid.

2 posts, 0 answers
  1. CRM
    CRM avatar
    1 posts
    Member since:
    Dec 2016

    Posted 01 Feb Link to this post


    I am trying to add new item into GridView with UI.

    My GridView ItemsSource setting. Analytics_Passports_FIO implements INotifyPropertyChanged:

    AnalyticsPassportsLinqToSqlDataContext dc = new AnalyticsPassportsLinqToSqlDataContext(Properties.Settings.Default.DefaultConnectionString);
    var query = (from u in dc.Analytics_Passports_FIO select u);
    var FIOs = new ObservableCollection<Analytics_Passports_FIO>(query);
    GridFIODetails.ItemsSource = FIOs;


    My FilterDescriptor inititalizing:

    FilterDescriptor filter = new Telerik.Windows.Data.FilterDescriptor("user_id", Telerik.Windows.Data.FilterOperator.IsEqualTo, id);


    If i am trying to add new item in GridView with default UI abilities(NewRow button) it doesn't appears in grid.

    What am i doing wrong?


  2. Stefan
    Stefan avatar
    791 posts

    Posted 06 Feb Link to this post


    Speaking in general, this would be the expected behavior.

    When a filtering operation applied, in order the new item to be displayed, it needs to pass the filtering criteria. You can alter this behavior by utilizing the FilterMemberPath property of the column. By doing so, the filtering operation will be processed over a property different than the one the column is bound to. Thus, irrelevant to what input the user enters for the new item, it will be displayed. Note, that at some point you might need to manually synchronize the two properties - the one that the column is bound through its DataMemberBinding and the one that points to the FilterMemberPath. More information can be found in the Basic Filtering topic.

    I hope this helps.

    Stefan X1
    Telerik by Progress
    Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Back to Top