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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Setting the Format for a columns in a DataBoundGrid

Thread ID:

Created:

Updated:

Platform:

Replies:

20678 Oct 22,2004 01:24 PM UTC Oct 22,2004 07:22 PM UTC WinForms 3
loading
Tags: GridControl
Rick Davis
Asked On October 22, 2004 01:24 PM UTC

I am trying to format a column of data in a grid. If I do not try to set the format of the column the data shows in the grid. Using the debugger I have checked the InternalColumns collection and there are no columns defined. What else do I need to check? ================================================== aGrid.DataSource = fact.DefaultView; // works OK GridStyleInfo style = aGrid.Binder.InternalColumns["TotalProbability"].StyleInfo; // Fails see below style.CellValueType = typeof(System.Double); style.Format = "P"; ================================================== Error Message. Object reference not set to an instance of an object.

Administrator [Syncfusion]
Replied On October 22, 2004 01:44 PM UTC

The grid.Binder.InternalColumns are only used if you have not explicitly added GridBoundColumns to the grid.GridBoundColumns collection. If you have added such GridBoundCOlumns, then then you woul duse that collection to get the GridBoundColumn.StyleInfo. The other thing to check is that the column name is exactly correct, including case. Here is a little sample showing things working. If you cannot spot the problem, can you post a little sample showing it. GridBoundColumns_1086.zip

Rick Davis
Replied On October 22, 2004 01:58 PM UTC

I have not explicted added the columns, but on the form I have a total of 6 different girds on different tabs. I have been able to duplicate the problem by creating a new form with a tab control with 6 tabs and a grid on each tab. When I try format the column on the any of the grids I get the same error. >The grid.Binder.InternalColumns are only used if you have not explicitly added GridBoundColumns to the grid.GridBoundColumns collection. If you have added such GridBoundCOlumns, then then you woul duse that collection to get the GridBoundColumn.StyleInfo. > >The other thing to check is that the column name is exactly correct, including case. > >Here is a little sample showing things working. If you cannot spot the problem, can you post a little sample showing it. > >GridBoundColumns_1086.zip > >

Administrator [Syncfusion]
Replied On October 22, 2004 07:22 PM UTC

You did not include your sample. Here is a sample showing a tabcontrol and 6 grids without a problem. I am using 2.1.0.9. What version are you using? Can you post your sample? GridBoundColumns_8343.zip

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;