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
<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
Hello,
Thank you for your post.
I am glad that my sample helped in solving your issue.
The valueConverter was there only for debugging purpose and is not needed for the solution’s implementation.
Thank you for choosing Infragistics components.
Sincerely,
Ekaterina
Developer Support Engineer
Infragistics, Inc.
www.infragistics.com/support
Eksraneva,
Thanks for the sample. its working
I see you used Conv: IValueconverter not used, is this needed.
The logic for getting index and cells is good and will be usefule for me
I will be using the cells["colKey"] instead of Cells[1] numbers/indexes , that will help if user moves around the columns.
Thanks
Ray A
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.