Adding a new row to a datagrid without a dataset

G

Guest

Hi

I'm on version 1.1.

Not sure if this is possible. I've got a datagrid on a webpage with 3
columns, ID, Name and Email. The datagrid does not need to be connected to a
datasource. I just want it to be populated by user selection from a drop down
list. So each time the user selects a name from the drop down list I want a
row to be added to the datagrid with the from the drop down list inserted
into the columns.

Any ideas how I can do this. I have quite a bit of experience populating
datagrids with datasets that are filled from a backend database, but have no
idea how to populate them manually in code.

Thanks
Julia
 
E

Eliyahu Goldin

The datagrid does need to be connected to a datasource. It is the datasource
that doesn't need to be connected to a database.Organize your data to any
in-memory collection, like an array etc, and it will be your datasource.
Databind the grid to it.

--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
 
G

Guest

Thanks for that.

Eliyahu Goldin said:
The datagrid does need to be connected to a datasource. It is the datasource
that doesn't need to be connected to a database.Organize your data to any
in-memory collection, like an array etc, and it will be your datasource.
Databind the grid to it.

--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net


Julia B said:
Hi

I'm on version 1.1.

Not sure if this is possible. I've got a datagrid on a webpage with 3
columns, ID, Name and Email. The datagrid does not need to be connected to
a
datasource. I just want it to be populated by user selection from a drop
down
list. So each time the user selects a name from the drop down list I want
a
row to be added to the datagrid with the from the drop down list inserted
into the columns.

Any ideas how I can do this. I have quite a bit of experience populating
datagrids with datasets that are filled from a backend database, but have
no
idea how to populate them manually in code.

Thanks
Julia
 

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

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top