Home Forums WPF controls Xceed DataGrid for WPF How to know when the edition of a cell is over?

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #25550 |

    I want to refresh the items of the DataGridControl when the edition of a cell is over.

    I didn’t find any event which would be thrown at the end of edition.. Do you know one? Or an other way to do some treatment at this time?

    The code in my XAML defining a handler for a certain event :
    <code>
    <Style TargetType =”{x:Type xcdg:DataCell}”>
    <EventSetter Event=”?????” Handler=”DataCellEndEditionHandler”/>
    </Style>
    </code>

    The C# code which implements my handler :
    <code>
    private void DataCellEndEditionHandler(object sender, RoutedEventArgs e)
    {
    this.MyGrid.Items.Refresh();
    }
    </code>

    Imported from legacy forums. Posted by Alex (had 1810 views)

    User (Old forums)
    Member
    Post count: 23064

    I try to refresh the items when the Property to which my grid is binds is update.
    I add a call to “myGrid.Items.Refresh(); in the setter of this property.

    But, the problem is that the an “Items.Refresh()” done while a underlying data bind to the grid is modified, returns only a part of the items!

    For instance :
    If a add in the DataGridCollectionView the following datas in this order :
    DataForGrid Data1
    DataForGrid Data2
    DataForGrid Data3
    DataForGrid Data4

    If I edit Data3 from the grid. After to have finished to edit, it will call the setter of the property Data3 :
    <code>
    //In my class : DataForGrid
    private int data;
    public int Data
    {
    get
    {
    return data;
    }
    set
    {
    data = value;
    MainWindow.MyGrid.Items.Refresh();
    }
    }
    </code>
    In the XAML, the binding is done by setting the property ItemsSource and more specifically on columns when I define the columns.
    <code>
    <xcdg:DataGridControl x:Name=”MyGrid” AutoCreateColumns=”False” ItemsSource=”{DynamicResource DataGridCollectionView}”>
    <xcdg:DataGridControl.Columns>
    <xcdg:Column Title=”MyData”
    FieldName=”Data”
    MinWidth=”35″
    DisplayMemberBinding=”{Binding Mode=TwoWay, Path=Data}”/>
    </xcdg:DataGridControl.Columns>
    </code>

    And the grid shows only the following datas!!! :
    Data3
    Data4

    What’s wrong? What should I do please? I’m really stuck. Hope someone will help…

    Imported from legacy forums. Posted by Alex (had 2778 views)

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.