Hi Cor,
Thanks for the quick response. This code sample highlights the problem
I am dealing with. There is a problem, though. Lets say that table1
contains just foreign key information. If I change your code to read
this:
dtName.LoadDataRow(New Object() {"0", "Herfried K. Wagner",
"0"}, True)
dtName.LoadDataRow(New Object() {"1", "Cor Ligthert", "2"},
True)
dtName.LoadDataRow(New Object() {"2", "Armin Zingler", "1"},
True)
dtName.LoadDataRow(New Object() {"3", "Ken Tucker", "4"}, True)
dtName.LoadDataRow(New Object() {"5", "Terry Burns", "5"},
True)
Where your first table has just the key, how do I then display in my
grid the user-friendly description of the number. The number is
meaningless to the end user. How do I do this without a join?
Jeremy - 16 May 2005 20:06 GMT
The other problem I have which this does not address is that I am only
updating one table in the database, but am displaying data from 2. So I
need to choose a value in the combo box, then update the hidden field
with the correct id to write to the database while showing the correct
user-friendly value. I used to do this in VB6 all the time, but I am
trying to do this "the .NET way" I am wondering if I just need to write
all the plumbing code that I had to before. I was hoping there was a
way that ADO.NET handled this kind of situation.
Cor Ligthert - 16 May 2005 20:14 GMT
Jeremy,
> Where your first table has just the key, how do I then display in my
> grid the user-friendly description of the number. The number is
> meaningless to the end user. How do I do this without a join?
Do you know what was one of the greatest changes with the old sample, beside
a what clumsy adding of rows in the old: I removed the datagridstyles,
because therefore the sample looked more on a style sample than a sample for
this problem. Therefore do I advice you to use those styles for your problem
as you describe it now.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlr
fSystemWindowsFormsDataGridTableStyleClassTopic.asp
By the way. I answered 5 minutes ago as well a question from Jeremy in the
newsgroup VBNet. I expected it was the same Jeremy, now I saw from the mail
address that it are two different persons. (My assumption was direct that
you were using VBNet)
I hope this helps,
Cor
Jeremy - 16 May 2005 20:59 GMT
It looks like the grid styles are not going to help me since i am using
an Infragistics grid to do this. they have completely changed the model
for alot of stuff. There doesn't seem to be an easy way to do this.
On a somewhat related topic, I am reading the ADO.NET book by David
Sceppa published by Microsoft. They seem to be recommending moving away
from joined queries. If I can't get a VERY simple example of grid to
combo mapping working in this new scheme, I will have no choice but to
force some kind of ugly solution to this problem. Especially once I
start coding complex data entry forms that could have 3 or 4 related
tables. Any thoughts on this? Surely I can't be the only one trying to
do this!?!