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

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 2641
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: 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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
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: 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
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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.