473,385 Members | 1,400 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

DataGrid and tableStyle

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,


Nov 15 '05 #1
2 2497
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,

Nov 15 '05 #2

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" <ca**@cb-cinc.om>
| Sender: "Carl" <ca**@cb-cinc.om>
| References: <14****************************@phx.gbl>
<Or**************@cpmsftngxa06.phx.gbl>
| Subject: RE: DataGrid and tableStyle
| Date: Tue, 23 Sep 2003 08:49:49 -0700
| Lines: 16
| Message-ID: <c1****************************@phx.gbl>
| 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,
|
|

Nov 15 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: oscar | last post by:
i currently have a dataset with a built, code and description fields. the built field is either a 1 or 0 and i would like it to display as a checkbox in the datagrid. i can get the checkboxes to...
2
by: Dino L. | last post by:
Hi guys I fill my datagrid like this --- komanda.CommandText ="SELECT IDKlasa AS ID, IDslova, IDbroj, Naziv, JM, Normativ FROM Klase WHERE IDslova LIKE('" + cmbIDslova.SelectedItem + "%') AND...
2
by: Hajash | last post by:
hi all, how do i set the width of a column in a datagrid.Please help.Thanks in advance. regards, hajash
2
by: Josef Meile | last post by:
Hi, I'm using a ComboBox, some Textboxes, and a DataGrid to represent a many-to-many relationship between Person and Course. Each time that I change the value in the ComboBox (which for now is...
2
by: CSL | last post by:
I am using the DataGrid in a Windows Application, how can I adjust the widths of each column individually.
14
by: Brett Sinclair | last post by:
Hello everybody I'm still on the learning curve here...and from what I read, I created inherited datagrid class so I could have icons, combobox...etc in the columns of my datagrid. The grid...
6
by: Ron L | last post by:
I have a dataset whose source is a SQL 2k stored procedure that I am trying to display in a datagrid. This datasource has 4 columns that I am interested in here, a text column and 3 value columns...
7
by: Earl | last post by:
Any known fixes for the wacky right-alignment bug in the WinForms datagrid (VS2003)? I've tried Ken's workaround...
4
by: Jeff | last post by:
I am stuck on trying to generate two columns headers for a datagrid on form load. I can use a datatable as the datasource and get the results I want, but I want to set different column widths and...
4
by: Localbar | last post by:
hi all, If I have a datagrid, actually has 5 column. but I would like in run time hidden last column. The reason is the form also have combobox for filter datagrid row. my problem is that I...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.