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
Xam Grid Conditional Formatting Cell Control Cursor Property not working in code behind
posted

Hi all. 

 

I'm working with  a conditional format trying to change the cell's style to make it look like a link (blue, underline, cursor hand) based on a condition.

 

The only thing that works is ForegroundProperty = blue

 

this is a snippet of my code:

 

public class MyConditionalFormatRuleProxy : ConditionalFormattingRuleBaseProxy

   {

      private Style LinkText { get; set; }

 

      public MyConditionalFormatRuleProxy()

      {

         Style oLinkStyle = new Style(typeof(ConditionalFormattingCellControl));

         oLinkStyle.Setters.Add(new Setter() { Property = ConditionalFormattingCellControl.ForegroundProperty, Value = new SolidColorBrush(Colors.Blue) });

         oLinkStyle.Setters.Add(new Setter() { Property = ConditionalFormattingCellControl.CursorProperty, Value = Cursors.Hand });

         //Add text decoration to underline possible?

         this.LinkText = oLinkStyle;

      }

 

      protected override Style EvaluateCondition(object sourceDataObject, object sourceDataValue)

      {

 

         List<string> oList = (List<string>)sourceDataObject;

 

         if (oList[0].StartsWith("Pro"))

            return this.LinkText;

 

         return null;  // leave it unstyled;

 

      }

   }

 

I also noticed that ConditionalFormattingCellControl doesn't have a way to set TextDecoration to Underline.

 

So, how can I set Cursors = Hand and underline to a Conditional Formatting dell control?.

 

Rodolfo.