473,382 Members | 1,380 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,382 software developers and data experts.

Alter Data DataSet of one DataGrid (urgent)


Hi all;

I have an application in which I use dataset - dataview pair to show some
values
to users.

On database this is my sample table named members

no type name
---- ------ ---------
1 N name value
2 S xyz value

and on my program I have some hard coded values about type descriptions like
N -> Never
Y -> Sometimes etc
....
...

My probmel is that I must show the description values on datagrid instead of
showing
type values.
I mean when I create dataset and bind it to datagrid, on grid Iwant to show
"Sometimes"
not "S"

Is there any effective way to do this ?
ps: Adding hardcoded values to a new table on database and joining these two
tables is
not desired solution :(


Nov 15 '05 #1
5 1253
Create another talbe called lookup

In that put the keys between the 2... that way, you don't need to create a
new table in your database, even though that would probably be the best
idea....

-CJ
"Ahmet" <ak*********@hotmail.com> wrote in message
news:O8**************@TK2MSFTNGP11.phx.gbl...

Hi all;

I have an application in which I use dataset - dataview pair to show some
values
to users.

On database this is my sample table named members

no type name
---- ------ ---------
1 N name value
2 S xyz value

and on my program I have some hard coded values about type descriptions like N -> Never
Y -> Sometimes etc
...
..

My probmel is that I must show the description values on datagrid instead of showing
type values.
I mean when I create dataset and bind it to datagrid, on grid Iwant to show "Sometimes"
not "S"

Is there any effective way to do this ?
ps: Adding hardcoded values to a new table on database and joining these two tables is
not desired solution :(

Nov 15 '05 #2

Could you please show me how to join this table in memory and show them in
dataset ?
Thanksin advance..
"CJ Taylor" <no****@blowgoats.com> wrote in message
news:vn************@corp.supernews.com...
Create another talbe called lookup

In that put the keys between the 2... that way, you don't need to create a
new table in your database, even though that would probably be the best
idea....

-CJ
"Ahmet" <ak*********@hotmail.com> wrote in message
news:O8**************@TK2MSFTNGP11.phx.gbl...

Hi all;

I have an application in which I use dataset - dataview pair to show some values
to users.

On database this is my sample table named members

no type name
---- ------ ---------
1 N name value
2 S xyz value

and on my program I have some hard coded values about type descriptions like
N -> Never
Y -> Sometimes etc
...
..

My probmel is that I must show the description values on datagrid

instead of
showing
type values.
I mean when I create dataset and bind it to datagrid, on grid Iwant to

show
"Sometimes"
not "S"

Is there any effective way to do this ?
ps: Adding hardcoded values to a new table on database and joining these

two
tables is
not desired solution :(


Nov 15 '05 #3
Ahmet,

Create a custom DataGridColumnStyle inherited from
System.Windows.Forms.DataGridTextBoxColumn. Override its SetColumnValueAtRow
and GetColumnValueAtRow methods to perform this translation on the fly.

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

"Ahmet" <ak*********@hotmail.com> wrote in message
news:O8**************@TK2MSFTNGP11.phx.gbl...

Hi all;

I have an application in which I use dataset - dataview pair to show some
values
to users.

On database this is my sample table named members

no type name
---- ------ ---------
1 N name value
2 S xyz value

and on my program I have some hard coded values about type descriptions like N -> Never
Y -> Sometimes etc
...
..

My probmel is that I must show the description values on datagrid instead of showing
type values.
I mean when I create dataset and bind it to datagrid, on grid Iwant to show "Sometimes"
not "S"

Is there any effective way to do this ?
ps: Adding hardcoded values to a new table on database and joining these two tables is
not desired solution :(


Nov 15 '05 #4

Thanks Dimitry this will work;
Could you please tell me how can I override SetColumnValueAtRow ?


"Dmitriy Lapshin [C# / .NET MVP]" <x-****@no-spam-please.hotpop.com> wrote
in message news:3f********@nexus.validio.com.ua...
Ahmet,

Create a custom DataGridColumnStyle inherited from
System.Windows.Forms.DataGridTextBoxColumn. Override its SetColumnValueAtRow and GetColumnValueAtRow methods to perform this translation on the fly.

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

"Ahmet" <ak*********@hotmail.com> wrote in message
news:O8**************@TK2MSFTNGP11.phx.gbl...

Hi all;

I have an application in which I use dataset - dataview pair to show some values
to users.

On database this is my sample table named members

no type name
---- ------ ---------
1 N name value
2 S xyz value

and on my program I have some hard coded values about type descriptions like
N -> Never
Y -> Sometimes etc
...
..

My probmel is that I must show the description values on datagrid

instead of
showing
type values.
I mean when I create dataset and bind it to datagrid, on grid Iwant to

show
"Sometimes"
not "S"

Is there any effective way to do this ?
ps: Adding hardcoded values to a new table on database and joining these

two
tables is
not desired solution :(

Nov 15 '05 #5
In C#:

internal class MyColumn: DataGridTextBoxColumn
{
// ...

public override void SetColumnValueAtRow(
CurrencyManager source,
int rowNum,
object value)
{
// Your code here.
}
}

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

"Ahmet" <ak*********@hotmail.com> wrote in message
news:eG****************@TK2MSFTNGP11.phx.gbl...

Thanks Dimitry this will work;
Could you please tell me how can I override SetColumnValueAtRow ?


"Dmitriy Lapshin [C# / .NET MVP]" <x-****@no-spam-please.hotpop.com> wrote
in message news:3f********@nexus.validio.com.ua...
Ahmet,

Create a custom DataGridColumnStyle inherited from
System.Windows.Forms.DataGridTextBoxColumn. Override its

SetColumnValueAtRow
and GetColumnValueAtRow methods to perform this translation on the fly.

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

"Ahmet" <ak*********@hotmail.com> wrote in message
news:O8**************@TK2MSFTNGP11.phx.gbl...

Hi all;

I have an application in which I use dataset - dataview pair to show some values
to users.

On database this is my sample table named members

no type name
---- ------ ---------
1 N name value
2 S xyz value

and on my program I have some hard coded values about type
descriptions like
N -> Never
Y -> Sometimes etc
...
..

My probmel is that I must show the description values on datagrid instead
of
showing
type values.
I mean when I create dataset and bind it to datagrid, on grid Iwant to

show
"Sometimes"
not "S"

Is there any effective way to do this ?
ps: Adding hardcoded values to a new table on database and joining

these two
tables is
not desired solution :(



Nov 15 '05 #6

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

Similar topics

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...
3
by: John | last post by:
Hi all, I did post this earlier but I do need a fairly urgent resolution to this problem of mine. My web app contains a datagrid with a dataset within. The dataset is the result of two other...
1
by: Luis Esteban Valencia | last post by:
Compilation Error Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source...
5
by: Ahmet | last post by:
Hi all; I have an application in which I use dataset - dataview pair to show some values to users. On database this is my sample table named members no type name ---- ------ ...
0
by: Eric Sabine | last post by:
OK, I'm trying to further my understanding of threading. The code below I wrote as kind of a primer to myself and maybe a template that I could use in the future. What I tried to do was pass data...
1
by: Anonieko | last post by:
Here are some of the approaches. 1. Transform DataGrid http://www.dotnetjohn.com/articles.aspx?articleid=36 3. Use the Export approach ...
4
by: michael sorens | last post by:
I have successfully bound an XmlDocument to a DataGridView but all fields seem to be strings. I want to retrofit appropriate datatypes on some of the fields. Let me take this in 2 parts. Part...
3
by: dbuchanan | last post by:
How, at rundime, do I capture the fact that the parametrized query that fills a CheckBoxList results in an empty set. When the dataset is empty the CheckBoxList does not appear. I would like to...
8
by: Brock | last post by:
I am trying to populate a Crystal Report from data in my DataGrid. The reason for this is that I want the user to be able to change values without updating the database, but still have their report...
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: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.