Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
130
XamGrid Columns Calculation - Silverlight app
posted

Have XamGrid with 1 bound column, 3 unbound columns

 for example: Product, UnitPrice, Quantity, Total

As the user enters quantity the Total has to get updated.

When the screen comes it has 10 rows with 10 products, unitprice filled in, and quantity and total are empty

Please give me a sample how to achieve this. total shouls get updated as user moves along the quantity column.

<ig:XamGrid Name="xg1">
<ig:TextColumn Key="Producutde" HeaderText="Producut"/>
<ig:UnboundColumn HeaderText="Unit Price" Key="UnitPrice" >
    <ig:UnboundColumn.ItemTemplate>
        <DataTemplate>
            <TextBox x:Name="UnitPrice"  />
        </DataTemplate>
    </ig:UnboundColumn.ItemTemplate>
</ig:UnboundColumn>
..similar to Quantity and Total
 Need the xaml and c# code for this
 
Parents
No Data
Reply
  • 4475
    Verified Answer
    posted

    Hello Ray,

     

    I have been looking into your issue and I have created a sample project that achieves the desired goal. Please notice that in the body of UnitPrice_TextChanged handler, I have not added any validations like checking if the cells are null, or if conversion from string to int is possible and so on. This is because my intend is only to demonstrate the custom approach, not to create the whole implementation. It is highly recommendable that you add these validations in your code.

     

    Please let me know if my sample meets your requirements or I have misunderstand you at some point.

     

    Sincerely,

    Ekaterina

    Developer Support Engineer

    Infragistics, Inc.

    www.infragistics.com/support

     

    xamGrid_summColumn.zip
Children