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

Editing a cell and saving in MySQL db

1 Answer 107 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Alexandre
Top achievements
Rank 1
Alexandre asked on 28 May 2018, 08:19 PM

Hi, I'm using a RadGridView with MySQL.Data and I need to save the cell value after I edit it.

How can I create a function that is called after I edit the cell?

This is my xaml code about RadGridView:

 

        <telerik:RadGridView x:Name="MyName" NewRowPosition="None" ItemsSource="{Binding}" CanUserInsertRows="True" AddingNewDataItem="PricingGrid_AddingNewDataItem"
                            ColumnWidth="*"
                            AutoGenerateColumns="False"
                            RowIndicatorVisibility="Collapsed"
                            ShowGroupPanel="True"
                            AlternationCount="2"
                            CanUserFreezeColumns="False"
                            IsReadOnly="False">
            <telerik:RadGridView.Columns>
                <telerik:GridViewDataColumn DataMemberBinding="{Binding Area}" Header="Area (m²)" DataFormatString="n2" />
                <telerik:GridViewDataColumn DataMemberBinding="{Binding Coe}" Header="Coe" DataFormatString="n2" />
            </telerik:RadGridView.Columns>
        </telerik:RadGridView>

1 Answer, 1 is accepted

Sort by
0
Vladimir Stoyanov
Telerik team
answered on 31 May 2018, 09:49 AM
Hello Alexandre,

You can utilize the CellEditEnded event of the RadGridView. It is called after the validation is passed and the new data is committed to the ItemsSource. 

Please give this a try and let me know if I can be of any further assistance.

Regards,
Vladimir Stoyanov
Progress Telerik
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.
Tags
GridView
Asked by
Alexandre
Top achievements
Rank 1
Answers by
Vladimir Stoyanov
Telerik team
Share this question
or