473,472 Members | 1,717 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Datagrid source= datarow array

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
Jul 21 '05 #1
6 2645
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 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

Jul 21 '05 #2
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" <ro*****@discussions.microsoft.com>
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:
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
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


Jul 21 '05 #3
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
Jul 21 '05 #4
ok, that worked. Now, how do I sync the datagrid with the drop down list?

"Cor Ligthert" wrote:
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

Jul 21 '05 #5
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
Jul 21 '05 #6
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" <ro*****@discussions.microsoft.com> >

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:
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

Jul 21 '05 #7

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

Similar topics

7
by: TT (Tom Tempelaere) | last post by:
Hi there, I'm struggling to get the right event. I want to be notified of a change in a cell in a DataGrid made by a user. I need following information about the change: * the row index * the...
2
by: pei_world | last post by:
I want to implement a key hit with enter to dropdown a combobox that is in the datagrid. in this case I need to override its original behaviours. I found some codes from the web. Does anyone know...
7
by: localhost | last post by:
A DataGrid with shows a label in one of the columns when in view mode. When in edit mode, I want to show a dropdown, and have the default selection set to what the textbox used to be. Right now...
4
by: tshad | last post by:
I am having trouble with links in my DataGrid. I have Links all over my page set to smaller and they are consistant all over the page in both Mozilla and IE, except for the DataGrid. Here is a...
5
by: Lie | last post by:
Hi all, I have problem in getting selectedindex of multiple listbox selection in a datagrid. I have a listbox with multiple selection mode inside datagrid. In Edit mode, I need to get back all...
4
by: Jan Nielsen | last post by:
Hi all I'm a former Access developer who would like to implement a many-to-many relation in about the same way you do in Access: With a subform and a combo box. Is it possible to use a...
6
by: rodchar | last post by:
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...
0
by: Familjen Karlsson | last post by:
Hi I have downloaded some code and tried it and nothing happens with the datagrid. Explain what is wrong and what I have to do please. I have tried to Import the namespace Hamster and it didn't...
3
by: joelzn | last post by:
I have a hand built dataset where some columns come from a sql database and others are calculated and eventually I will have two different query results going into one table because its impossible...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.