Datagrid source= datarow array

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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
 
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
 
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
 
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
 
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" <[email protected]> >

On a form, my dropdown list is bound to a column in my master table. The
 
Back
Top