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
2335
XamWebGrid Cell Style Setter Values are not read able
posted

Hi,
I am trying to provide rich formating to the XamWebGrid. I am trying to add mutiple formating to a single cell like bold, italic, font size and etc. As

((

Setter)myGrid.ActiveCell.Style.Setters[0]).Property gives the proper results as per assigned property
But ((Setter)myGrid.ActiveCell.Style.Setters[0]).Value always return null after applying the style to cell.

Is there any way to get value of applied style.Setter?

And can you also help me to apply TextAlignment and underling the text in editable mode?

I tried a lot but failed to find detailed documentation about Cell.Style.Setters, Please also provide me some url to get in depth details about Style and Setter documentation with applicable properties and related values like following

 

 

myGrid.ActiveCell.Style.

 

 

Setters.Add(

new Setter(CellControl.FontStyleProperty, FontStyles

.Italic));

Thanks.

 

 

 

Parents
No Data
Reply
  • 40030
    Verified Answer
    Offline posted

    Hi, 

    So, the issue you're seeing where the value of the setter disappears is just some weird thing that Styles do. 

    We've noticed it as well, however there isn't anything that can be done to avoid it. 

    You can even see the same thing happen with a TextBox:

    TextBox tb = new TextBox();

    Style s = new Style(typeof(TextBox));

    s.Setters.Add(new Setter(TextBox.BackgroundProperty, new SolidColorBrush(Colors.Red)));

    tb.Style = s;

    To see what properties can be set in a style, simply look at the properties associated with the CellControl. Any DependencyProperty is settable via the setter. You can look at the Static members to see which Dependency properties are available. 

    Hope this helps clear some things up. 

    -SteveZ

     

Children