DataGrid and tableStyle

C

Carl

Hi, in the following code,

DataGridColumnStyle TextCol5 = new DataGridTextBoxColumn
();
TextCol5.MappingName = "fl_taxable";
TextCol5.HeaderText = "Taxable";
TextCol5.Width = 75;
ts1.GridColumnStyles.Add(TextCol5);

I will like to have a transformation done on the int
field fl_taxable from the dataset.

I will like to change the int value (enum) to is string
equivalent to be display on the grid with,
Enum.GetName(typeof(Form1.enumTAXABLE), field_value)

So how can I have that transformation function event
done/fired.

Any help will be appreciated.

Carl,
 
C

Carl

I was expecting to avoid looping trough the dataset to
perform this change, sometime the dataset could be huge.

I was expected kind of event code when display in the
grid.

I was thinking to use the datasourcechange event of the
grid to perform the change in the grid.

But I think changing the dataset itself will be easier,
I think this is the only way !

So I will do it.

Carl,
 
J

Jeffrey Tan[MSFT]

Hi Carl,

I think may be you can try another way of handling this:

You can inherit from the datagrid control, override its Paint method.
Then you can format the int value to the related enum string.

But I think handle dataset is simpler.

Hope this helps,
Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
| Content-Class: urn:content-classes:message
| From: "Carl" <[email protected]>
| Sender: "Carl" <[email protected]>
| References: <[email protected]>
<[email protected]>
| Subject: RE: DataGrid and tableStyle
| Date: Tue, 23 Sep 2003 08:49:49 -0700
| Lines: 16
| Message-ID: <[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="iso-8859-1"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
| Thread-Index: AcOB6lJHDRwtNcmrS5aWvSwtdkn6rw==
| Newsgroups: microsoft.public.dotnet.languages.csharp
| Path: cpmsftngxa06.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.csharp:186772
| NNTP-Posting-Host: TK2MSFTNGXA14 10.40.1.166
| X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
|
| I was expecting to avoid looping trough the dataset to
| perform this change, sometime the dataset could be huge.
|
| I was expected kind of event code when display in the
| grid.
|
| I was thinking to use the datasourcechange event of the
| grid to perform the change in the grid.
|
| But I think changing the dataset itself will be easier,
| I think this is the only way !
|
| So I will do it.
|
| Carl,
|
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top