Search:
Namespaces
Discussions
.NET v1.1
Feedback
Datagrid source= datarow array
Messages
Related Types
This message was discovered on
microsoft.public.dotnet.general
.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.
Post a new message to this list...
rodchar (VIP)
Hey all,
I have an array of data rows that when I bind it to a datagrid it shows all
those extra rows in addition to my fields. How do I hide those fields?
I tried using the TableStyles property but seems like it's getting overridden.
Any ideas?
Thanks in advance,
rodchar
Reply to this message...
Cor Ligthert
Rodchar,
An array of datarows seems difficult to me to bind that to the columnstyles.
Normally is used the normal container for datarows "the datatable" with as
view the dataview which are make it so simple to select the proper columns
or rows.
I think you take the hard way, I am as well curious if somebody did that as
well.
It is such a nice build in feature ADONET.
Cor
> I have an array of data rows that when I bind it to a datagrid it shows
all
[Original message clipped]
Reply to this message...
rodchar (VIP)
What I'm using is the GetChildRows method which returns an array of datarows.
How do I get those rows into an empty table and then bind to my datagrid?
"Cor Ligthert" wrote:
[Original message clipped]
Reply to this message...
Cor Ligthert
Rodchar,
Just clone the original table and add the datarows to that by looping
through it, you can use for that the datarow.itemarray
I hope this gives an idea?
Cor
"rodchar" <
Click here to reveal e-mail address
>
> What I'm using is the GetChildRows method which returns an array of
datarows.
[Original message clipped]
Reply to this message...
rodchar (VIP)
Once I clone the table, how would I propagate the changes back into the
original dataset?
"Cor Ligthert" wrote:
[Original message clipped]
Reply to this message...
Cor Ligthert
Why do you than not use the relation to set the databinding of the datagrid?
Sample changed from an original program so watch typos
\\\
DataRelatieGF = New
DataRelation
_
("Gfunct", dsG.Tables("g").Columns("ng"), _
dsG.Tables("gf").Columns("ng"))
dsG.Relations.Add(DataRelatieGF)
dgGroepen.SetDataBinding(dsG, "g")
dgGroepFuncties.SetDataBinding(dsG, "g.gf")
///
Cor
Reply to this message...
rodchar (VIP)
ok, that worked. Now, how do I sync the datagrid with the drop down list?
"Cor Ligthert" wrote:
[Original message clipped]
Reply to this message...
Cor Ligthert
You nowhere told you where using a dropdownlist, do I understand that this
is a Webform application. However this confuses me, because in that do as
far as I know not exist tablestyles?
Cor
Reply to this message...
rodchar (VIP)
On a form, my dropdown list is bound to a column in my master table. The
datagrid is now, thanks to you, bound to the data relation name. However, I
don't know how to sync the datagrid to the drop down list selected value.
"Cor Ligthert" wrote:
[Original message clipped]
Reply to this message...
Cor Ligthert
Rodchar,
You are probable talking about a combobox (dropdown and dropdownlist are
controls from a webform).
Probably you can use binding the combobox text to the column in your
datasource table using something as
combobox.DataBindings.Add(New Binding("Text", dataset1.Tables(0),
"Mycolumname"))
(know that the combobox in my opinion acts sometimes strange with binding)
I hope this helps?
Cor
"rodchar" <
Click here to reveal e-mail address
> >
On a form, my dropdown list is bound to a column in my master table. The
> datagrid is now, thanks to you, bound to the data relation name. However,
I
[Original message clipped]
Reply to this message...
rodchar (VIP)
Thank you very much, that worked great!! You have been very helpful.
rodchar
"Cor Ligthert" wrote:
[Original message clipped]
Reply to this message...
System.Data.DataRelation
Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us
-
Terms of Use
-
Privacy Policy
-
www.dotnet247.com