We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Setting Column appearance basestyle

Hello,

I''m trying to set the basestyle of a column as per the below code. However when I compile and run this the base style is not applied to the columns. However if I setup a static column and basestyle at design time and apply the basestyle to the column within the designer everything works as intended.
I''d like to avoid creating the columns at design time

private void initGrid(DataSet imDS)
{
this.ggc.BeginUpdate();

GridTableBaseStyle gtbs = new GridTableBaseStyle("Money");
gtbs.Name = "Money";
gtbs.StyleInfo.AllowEnter = true;
gtbs.StyleInfo.AutoSize = false;

gtbs.StyleInfo.CellType = "Currency";
gtbs.StyleInfo.CurrencyEdit.NullString = "99"; //Just to see if its working
gtbs.StyleInfo.CurrencyEdit.CurrencySymbol = "$";
this.ggc.BaseStyles.Add (gtbs);

this.ggc.DataSource = imDS;
this.ggc.DataMember = Constants.DATA_TABLE;

this.ggc.TableDescriptor.Columns["DOLLARS"].Appearance.AnyRecordFieldCell.BaseStyle = "Money";

this.ggc.EndUpdate(true);
}


Can you please give me some feedback as to whether I''m missing a step? Or if I need to take a different approach to this?

Thank you,
Paulo

5 Replies

PC Paulo Cristini September 5, 2006 11:07 PM UTC

Something I''ve found interesting is that if I do the following it does work (but almost defeats the purpose of what I was trying to do, because I was looking to reduce duplicated code)


this.ggc.TableDescriptor.Columns["DOLLARS"].Appearance.AnyRecordFieldCell.CellType = "Currency";
this.ggc.TableDescriptor.Columns["DOLLARS"].Appearance.AnyRecordFieldCell.BaseStyle = "Money";


Any insight into this?


PC Paulo Cristini September 12, 2006 03:50 PM UTC

I was just wondering if anyone has looked into this?


AD Administrator Syncfusion Team September 13, 2006 09:36 AM UTC

Hi Paulo,

I am sorry for the delay in getting back to you. We are able to see the issue and we have forwarded it to the development team and will get back to you with in a couple of days. Thanks for your patience.

Thanks,
Haneef.


PC Paulo Cristini September 13, 2006 09:12 PM UTC

Not sure if this will help or not but we''re using 3.301


PC Paulo Cristini October 5, 2006 04:16 PM UTC

any updates on this?

Loader.
Live Chat Icon For mobile
Up arrow icon