Adding a new row to a datagrid without a dataset

Discussion in 'ASP .Net' started by =?Utf-8?B?SnVsaWEgQg==?=, Oct 9, 2007.

  1. 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
     
    =?Utf-8?B?SnVsaWEgQg==?=, Oct 9, 2007
    #1
    1. Advertising

  2. 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" <> wrote in message
    news:...
    > 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
     
    Eliyahu Goldin, Oct 9, 2007
    #2
    1. Advertising

  3. Thanks for that.

    "Eliyahu Goldin" wrote:

    > 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" <> wrote in message
    > news:...
    > > 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

    >
    >
    >
     
    =?Utf-8?B?SnVsaWEgQg==?=, Oct 9, 2007
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Craig
    Replies:
    2
    Views:
    2,885
    =?Utf-8?B?QmlsbCBCb3Jn?=
    Nov 2, 2004
  2. =?Utf-8?B?U3VyZXNo?=
    Replies:
    1
    Views:
    474
    Saravana
    Nov 22, 2004
  3. IK

    How to find grid's row that matches row in dataset

    IK, Sep 15, 2003, in forum: ASP .Net Datagrid Control
    Replies:
    0
    Views:
    183
  4. Devin Wood

    Adding Row to a datagrid Without do a PostBack

    Devin Wood, Mar 22, 2005, in forum: ASP .Net Datagrid Control
    Replies:
    0
    Views:
    137
    Devin Wood
    Mar 22, 2005
  5. Prabakar Samiyappan

    Adding New Row in Asp.Net Datagrid ,Without using dataset

    Prabakar Samiyappan, Mar 10, 2007, in forum: ASP .Net Datagrid Control
    Replies:
    0
    Views:
    722
    Prabakar Samiyappan
    Mar 10, 2007
Loading...

Share This Page