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
95
XamGrid Selected Row ,alternative row color change
posted

Hi Team,

I am using Visual Studio 2019 and Infragistic Ultimate WPF version 20.2.16.

I am creating a simple application where I have two textbox,button and XamGrid on my page. When I press the button the data of two textbox added row in XamGrid.

I have few queries regarding the XamGrid.

  • How I change the background color of alternative rows.
  • How I change the background color of selected row.
  • I have editable cell in XamGrid so on change of the cell Value I want to update the Summary row.

Could you please provide with Example of above functionality in XamGrid.

Thanks in advance.

Dinesh

Parents
  • 1240
    Offline posted

    Hello Dinesh,

    Thank you for contacting us. We recommend you using the xamDataGrid control instead of the xamGrid control. The xamGrid is almost retired and doesn't provide any more bug fixes.

    You can refer to this online help document to understand the difference between the controls :

    www.infragistics.com/.../differences-between-xamgrid-and-xamdatagrid

    This article is a good point to start using XamDataGrid:

    www.infragistics.com/.../xamdatagrid-getting-started-with-xamdatagrid

    As for your questions regarding the alternate row colors and the selected row color as well as changing the values of the summaries once the cell values are changed I have prepared a small sample application using XamDataGrid that demonstrates how to achieve this.

    In it I have created a style targeting the DataRecordCellArea. There are a few properties that are set with setters such as: BackgroundSelected, BackgroundActive, BackgroundHover, BackgroundAlternate and BorderThickness. With this style both of the requirements you stated above are met – Chnaging the Alternate Row color and the Selected Row color.

    To apply RowSummeries, inside the FiledLayout, you need to include SummeryDefinitions and set the type of the summery with the SummeryCalculator, in the case of the sample I am attaching a summery for a Sum is added showing the total price of the “Price” field. Once the user changes the value of a certain cell inside the “Price” field the summary is automatically updated.

    Please test the sample on your side and let me know if this is an accurate demonstration of what you are trying to achieve.

    Regards,
    Ivan Kitanov

    AlternateRowColorAndSummeries.zip

Reply Children