Populate grid control using Container.DataItem command

C

csgraham74

Hello,

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
information.

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.
 

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,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top