filling the grid

D

dirk van waes

Hello,
I fill an arraylist (ALstudents) with data from a dataset
Therefor, I first made a structure :
Public Structure lldata
Dim NameForname As String
Dim points As String
Dim llremark As String
Dim llnr As Integer
End Structure
Then I filled Alstudents with the data from the dataset, transformed in
lldata

I can adress the data now as follows : Alstudents(2).NameForname

Now I want to bind this arraylist to a dynamic datagrid.
dgstudents.recordsource = Alstudents

Problem is, I get an runtime-error defining new colums in the grid as
folows:
datagridcol.DataField ="NameForname" (as with a dataset)

I get : "A field or property with the name 'NameForname' was not found on
the selected datasource."
I suppose it has something to do with adressing the lldata-structure. I
changed the syntax many times, but nothing seems to work.Can somebody point
me in the right direction on this one?
TIA
Dirk
 
D

dirk van waes

Hello Alvin,
Thxs for answering.
, transformed in lldata
I read the dataset row per row, and put each row in the structure lldata .
Then I put the structure in the arraylist Alstudents

datagridcol.DataField ="NameForname"
it is a brand new column. The recordsource is an arraylist (Alstudents) with
members of the defined structure lldata. I think the structure is the cause
of my problem!

TIA
Dirk

Alvin Bruney - ASP.NET MVP said:
, transformed in lldata
What does that mean within the context of your problem?
datagridcol.DataField ="NameForname"
How is datagridcol defined? This would work if datagridcol was a brand new
column attached to a new datagrid. However, it will fail if it is a clone
of
an existing datasource.

--
Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @ www.lulu.com/owc
Forth-coming VSTO.NET - Wrox/Wiley 2006
-------------------------------------------------------



dirk van waes said:
Hello,
I fill an arraylist (ALstudents) with data from a dataset
Therefor, I first made a structure :
Public Structure lldata
Dim NameForname As String
Dim points As String
Dim llremark As String
Dim llnr As Integer
End Structure
Then I filled Alstudents with the data from the dataset, transformed in
lldata

I can adress the data now as follows : Alstudents(2).NameForname

Now I want to bind this arraylist to a dynamic datagrid.
dgstudents.recordsource = Alstudents

Problem is, I get an runtime-error defining new colums in the grid as
folows:
datagridcol.DataField ="NameForname" (as with a dataset)

I get : "A field or property with the name 'NameForname' was not found on
the selected datasource."
I suppose it has something to do with adressing the lldata-structure. I
changed the syntax many times, but nothing seems to work.Can somebody point
me in the right direction on this one?
TIA
Dirk
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,143
Latest member
DewittMill
Top