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
515
Highlith a row/col Changed
posted

How can I highlight a row or column of a grid when it is changed in value compared to a previous itemsource?
Should I use CellControlAttached? If so, you have an example in vb?
Thanks

Alex

Parents
  • 40030
    Offline posted

    Hi Alex, 

    You can use our ConditionalFormatting feature, or you can use the CellControlAttached event:

    http://help.infragistics.com/NetAdvantage/Silverlight/2010.3/CLR4.0/?page=xamGrid_Conditional_Formatting.html

    As for the event. 

    I don't have a sample in VB, however, you simply just need to use the Cell from the EventArgs and validate against it:

    something like:

    if(e.Cell.Column.Key == "YourColKey")
    {
                YourDataObj data = (YourDataObj)e.Cell.Row.Data; 
                if(data.YourColKey == 4)
                {
                         e.Cell.Style = yourRedStyle
                }
    }

    basically all the code above is doing, is validating your on the column you want to check, 
    Grabbing the data from the row, and casting it into your object
    Then checking to see if the value is equal to 4, if so, then it sets the cell's style to a predefined style

    -SteveZ

     

Reply Children