473,396 Members | 1,860 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,396 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 20 '05 #1
5 2247
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 20 '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 20 '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 20 '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 20 '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 20 '05 #6

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

Similar topics

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 ---- ------ ...
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: tshad | last post by:
Is there a way to carry data that I have already read from the datagrid from page to page? I am looking at my Datagrid that I page through and when the user says get the next page, I have to go...
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...
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: 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?
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...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.