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
close icon

Losing Scrollbars when setting GridTableCellStyleInfo properties

I have a custom datasource that I bind to a GridGroupingControl. Before binding to the Custom Source I set some properties on the TableControl for example: this.TableControl.HScrollBehavior = GridScrollbarMode.Enabled During my custom DataBinding method I make changes to each GridColumnDescriptor''s Style - for example: GridTableCellStyleInfo gsi = column.Appearance.AnyRecordFieldCell; gsi.Format = "G"; gsi.CellType = "TextBox"; After setting these proerties my Scrollbars dissapear? If I comment out the gsi.Format or gsi.CellType part I can see my Scrollbars. In Fact setting ANY property on the GridTableCellStyleInfo causes me to loose my Scrollbars. What am I doing wrong? This is a BIG problem - I cant comment out the part where I Set the GridTableCellStyleInfo becuase then All my Data will be "unformatted" and When putting the code in I loose my scrollbars - then I cant see my data. Please could you help me ASAP. Regards, Theo Danzfuss

5 Replies

AD Administrator Syncfusion Team March 22, 2005 06:17 PM UTC

Can you tell us how to reproduce this behavior in any of our samples? Or, can you upload a sample showing the problem? If you have a problem uploading, you can email it to support@syncfusion.com and mention this forum thread in the subject line.


AD Administrator Syncfusion Team March 22, 2005 06:25 PM UTC

Do you see any exceptions noted in your output window?


TD Theo Danzfuss March 23, 2005 11:47 AM UTC

Hi, No there are no Exceptions in the output window. Ill try to replicate it from one of your examples - but Im bit pushed for time right now so I cant promise anything now. Can you think of any reason why this is happening? Regards TD


AD Administrator Syncfusion Team March 23, 2005 12:15 PM UTC

To set a format like G in style.Format, the style.CellValueType should also be set to the appropriate system type like typeof(double). Usually, type problems throw exceptions when you try to put a string into a double or a double into an int, etc.


TD Theo Danzfuss March 24, 2005 08:44 AM UTC

Hi, I manage to get my grid to work. Here is what happens: The following piece of code throws away my scrollbars: TableControl.TableDescriptor.Columns.Clear ( ); foreach ( PropertyDescriptor pd in view.GetItemProperties(null)) { GridColumnDescriptor gcd = TableControl.TableDescriptor.Columns [TableControl.TableDescriptor.Columns.Add (pd.Name)]; gcd.Appearance.AnyRecordFieldCell.BackColor = System.Drawing.Color.Brown; } This piece of code works fine: TableControl.TableDescriptor.Columns.Clear ( ); foreach ( PropertyDescriptor pd in view.GetItemProperties(null)) { GridColumnDescriptor gcd = new GridColumnDescriptor ( ); gcd.Appearance.AnyRecordFieldCell.BackColor = System.Drawing.Color.Brown; TableControl.TableDescriptor.Columns.Add ( gcd ); } I don''t know why this happens but it seems that when changing a GridTableCellInfoStyle after the GridColumnDescriptor has been added to the Columns collection it "ignores" the scrollbar settings? Regards TD

Loader.
Live Chat Icon For mobile
Up arrow icon