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 propertyBut ((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.
new Setter(CellControl.FontStyleProperty, FontStyles
.Italic));
Thanks.
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
Hi SteveZ, Yes you are absolutely right that setters don't show their values after applied to control style. It means there is no way to get value of applied property. Can you suggest me some work around for this? I am not eager to maintain a separate collection of styles Applied on each and every cell.
One more thing is there some way to make text underlign and text alignment of indvidual cell (not column level).
ThanksImran Javed Zia