By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,119 Members | 2,064 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,119 IT Pros & Developers. It's quick & easy.

DataGridView question!

P: n/a
Hi All,

I am using a database which doesn't suppport and since I am using ORM I
can not use join query to create table object mapping. So my question
is

I have a master table which has bunch of columns I want to display. Of
those 3 of them are integer columns, which needed to be translated into
string by looking up on a reference table. How can I translate the
integer values to string after the table is fetched and put in the
datagridview?? I can read the reference table and put it in memory for
look up but I couldn't translate the columns in the datagridview to
string.. Any help please??

Thanks.

Jun 5 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
I would recommend using the DataGridViewComboBoxColumn class. Here is
the link to the documentation:

http://msdn2.microsoft.com/en-us/lib...boxcolumn.aspx

To elaborate on the list of steps in order to use the class:

Create a DataGridView.
Set the DataSource property of the DataGridView.

- This is the source of the data on the grid view.

Create a DataGridViewComboBoxColumn.
If the data source contains multiple properties or columns, set the
DataPropertyName property to the name of the property or column for
populating the cell values.
Use the DataSource or Items properties to establish the selections.

- This is the source of the list data (from which your values come from)
on the DataGriViewComboBoxColumn.

Use the ValueMember and DisplayMember properties to establish a mapping
between cell values and what will be displayed on the screen.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"DBC User" <db*****@gmail.com> wrote in message
news:11**********************@g10g2000cwb.googlegr oups.com...
Hi All,

I am using a database which doesn't suppport and since I am using ORM I
can not use join query to create table object mapping. So my question
is

I have a master table which has bunch of columns I want to display. Of
those 3 of them are integer columns, which needed to be translated into
string by looking up on a reference table. How can I translate the
integer values to string after the table is fetched and put in the
datagridview?? I can read the reference table and put it in memory for
look up but I couldn't translate the columns in the datagridview to
string.. Any help please??

Thanks.

Jun 5 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.