We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

How to update columns in datagrid

Hi,

I am trying to update my columns in the below figure but the update is not happening.


whenever I update the quantity, the total rate should also get updated. But this isn't happening. what is the appropriate way to do it?

Thanks in Advance


1 Reply

SC Saravanan C Syncfusion Team May 23, 2014 08:20 AM UTC

Hi Madhu,

 

Thank you for contacting Syncfusion Support.

 

We have analyzed your requirement and you can achieve your datagrid columns like in the figure you attached by using GridUnBoundColumn and setting the Expression=Quantity*Unit rate. And if you are dynamically changing the Quantity or Unit rate values, then you need to set the property  LiveDataUpdateMode=”AllowDataShaping” for updating the Expression value. Please find the code snippet in below:

 

Code Snippet[XAML]:

 

<Grid Background=”{StaticResource ApplicationPageBackgroundThemeBrush}”>

    <yncfusion:SfDataGrid  AllowDraggingColumns=”True” AutoGenerateColumns=”False”

                            ColumnSizer=”Star” AllowEditing=”True”

                            ItemsSource=”{Binding Detailscollection}”

                            LiveDataUpdateMode=”AllowDataShaping”

                            AllowFiltering=”True”>

        <yncfusion:SfDataGrid.Columns>

            <yncfusion:GridUnBoundColumn Expression=”Quantity*Amount”                      MappingName=”Total”/>

        </yncfusion:SfDataGrid.Columns>

    </yncfusion:SfDataGrid>

</Grid>

 

We have prepared a sample based on your requirement. Please find the sample in the attachments.

 

Please let us know if  this solution helps you.

 

Thanks,

Saravanan C


Attachment: UnBoundColumnExpression_61dcef73.zip

Loader.
Live Chat Icon For mobile
Up arrow icon