Populate grid control using Container.DataItem command

Discussion in 'ASP .Net Web Controls' started by csgraham74, Sep 14, 2005.

  1. csgraham74

    csgraham74 Guest


    Im developing an application in ASP.Net and im just attempting to
    develop my first control.

    What im trying to do is to create a control that has a datagrid with
    four rows. The top row will be slighlty different than the other 3 rows
    in terms of how the data is displayed therefore i dont think i can use
    a datagrid with repeating rows. I was thinking of using one cell in the
    grid with a table inside it.

    To do this i want to select 4 records fom my database, insert into a
    dataset and bind to my grid. My problem is how to populate the fields
    of the datagrid with the correct information. i know how to use the
    DataBinder.Eval(Container.DataItem,"val1") command but i dont know how
    to iterate the dataset using this command to extract the correct

    What i want to do is the following :-
    Extract data from record 1 into the top row / data from record 2 into
    the second row / data from record 3 into the third row / data from
    record 4 into the fourth row.

    How do i do this loop using the
    DataBinder.Eval(Container.DataItem,"val1") command.

    Any ideas on how to do this greatly appreciated

    Thanks in advance.
    csgraham74, Sep 14, 2005
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.