Displaying two rows of database column data in one row of datagrid


I am trying to display two rows of an access column on one row of datagrid. Is that possible?

Example of my intended datagrid:

courseNo of course1
courseNo of course2

courseNo of course3
courseNo of course4

here's the HTML view of my aspx file:

<Asp:datagrid id="DataGrid1" style="Z-INDEX: 101; LEFT: 104px; POSITION: absolute; TOP: 40px"
    runat="server" AutoGenerateColumns="False" Height="320px" Width="488px">
       <asp:HyperLink id="Hyperlink2" runat="server">
        <h4>Session&nbsp;<%# DataBinder.Eval(Container.DataItem, "sessionNo") %></h4>
       <%# DataBinder.Eval(Container.DataItem, "classNo") %>
       <%# DataBinder.Eval(Container.DataItem, "classInCharge") %>
       <b>Class Time:</b>
       <%# DataBinder.Eval(Container.DataItem, "classTime") %>
       <b>Class Date:</b>
       <%# DataBinder.Eval(Container.DataItem, "classDate") %>
       <%# DataBinder.Eval(Container.DataItem, "classNo") %>
<%# DataBinder.Eval(Container.DataItem, "classInCharge") %>       

I tried to just put 2 lines of databinder.eval code, but they printed the same courseNo. I also tried doing up 2 Itemtemplates, but only the 2nd one got displayed. Any ideas?

3/26/2005 4:24:05 PM
asp.net.presentation-controls 72751 articles. 3 followers. Follow

2 Replies

Similar Articles

[PageSpeed] 41

Try the datalist control. I believe that you can set the RepeatColumns property.

Sonu Kapoor [MVP]
Feel free to ask me any .NET question | Ajax Data Controls Forum
3/26/2005 5:44:45 PM

Hi ,

that should not be a problem.. try remove the databinder.eval and replace as <%# Container.DataItem("datafield") %> only..

Don't Quote And Flame Me If I Am Wrong
3/27/2005 6:43:12 AM

Similar Artilces:

Displaying one of the columns in GridView data as GroupBy or similar data one after another row
Hi Would like to know the property or code that will Group data in one of the columns of GridView together. In other words i like to display the columns data in GridView that is repeated more than once together. Example: say Column heading Name John Jim Kevin Albert John Jim John You can see john or jim is displayed in Name Column at various rows. I like to get them displayed together such as John John Jim Jim Regards,-- "Mark As Answer" if my reply helped you -- Hi I am not too sure, but may be you can try a "Order by" clause at your SQL level. Say,...

Data of two rows in one row
  Emp-----ID Name1 x1 P2 y2 Q3 WEmp_DataId Name-1 Name-21 x P2 y Q3 wabove is my tables (Emp ),And the I want the Resulting Data in the (Emp_Data) format.is this possible Pls Help........Thanks in advance----- SELECT t.ID,MAX(CASE WHEN t.Seq=1 THEN t.Name ELSE NULL END) AS Name_1,MAX(CASE WHEN t.Seq=2 THEN t.Name ELSE NULL END) AS Name_2FROM (SELECT ROW_NUMBER() OVER(PARTITION BY ID Order BY Name) AS Seq,* FROM Emp)tGROUP BY t.ID Please click "Mark as Answer" if my reply solved your problem.CheersRammohan   Thanx it helped me a lot...

Two rows data dispaly in one row
 my data is fetching in two rows for one companyid yearly one row for current year and next row for nextyear. but my problem is i have to show data for one companyid in one row of gridview ex:compid,  year,hiprice,lowprice,year1 hiprice1,lowprice1                 2009   10   8            2010   34   12 ThanksShallu Hi.. this may be done by retrieving data in only one row from database only. can you post your query here. ...

I want to display data column names in more than one row in gridview for display
    Name   Age    Address data    data   data Phone    Mobile data       data I'm thinking a GridView is probably not the best approach for what you want to do. Instead, I'd probably use a Repeater as my parent control, and then use either embedded GridViews or a UserControl which contains GridViews in it.Thanks, EdMicrosoft MVP - ASP/ASP.NET...

SQL: mutiple rows one column to multiple columns one row
In InfoMaker SQL can you take a table with multiple rows for the same key and take a column from the rows and create mutiple columns with one report line with the key(no duplicate keys) on a report? For example Table books (key) (book title) 123 misery 123 titanic 123 roots 456 war 456 1984 456 giant The report I need would look like this Key title1 title2 title 3 123 misery titanic roots 456 war 1984 giant Thanks in advance. -- Kaye Hendry HealthInsight email:kaye.hendry@healthinsight.org ...

Display data in one row with many child rows
Hi all, Could i display data like this :                             DetailPerson        Column 1       Column 2                   name 1         address 1person 1      age 1         &nbs...

(DATAGRID)How to put 1st column in one row and the rest in the row below?
For example, I want to display a FIELD1,FIELD2,FIELD3,FIELD4 from a table in a datagrid this way: ---------------------------------------------- FIELD1("colspanning it") ---------------------------------------------- FIELD2 | FIELD3 | FIELD4 ---------------------------------------------- FIELD1("colspanning it") ---------------------------------------------- FIELD2 | FIELD3 | FIELD4...

Reduce rows displayed but putting 3 rows in one row
Hi all, I'm using PB6.5. I have an SQL DW that fetch some information from the DB but should display only two columns: a code and a value. Also they are displayed in the trailer of a group if that's actually important. In order to reduce displayed rows count, i would like to display each 3 rows in one row(Code,Value,Code,Value,Code,Value). The question is how can i do that?. I've tried to use computed fields and in the second and third pair values to use code[1],value[1],code[2],value[2] but only the code[1],value[1] are OK(Showing next row's data), the third ...

Arranging data on multiple rows into a sigle row (converting rows into columns)
Hello, I have a survey (30 questions) application in a SQL server db. The application uses several relational tables. The results are arranged so that each answer is on a seperate row: user1   answer1user1   answer2user1   answer3user2   answer1user2   answer2user2   answer3 For statistical analysis I need to transfer the results to an Excel spreadsheet (for later use in SPSS). In the spreadsheet I need the results to appear so that each user will be on a single row with all of that user's answers on...

how to display records as row wise in datagrid or any other data controls
Hi Reader I am developing an application in wich user write the keywords(which are the contants of the site) and search the result.now i want to show the result as row wise.how it may be possible. if you have any suggestion so please replly me.I will be thankfull to you. Thanks   Regards Susheel Kumar Singh  ...

(Fwd) How to loop through a database, row by row, and select and update one row at a time
----- Forwarded message from Troy Mulder <mulderta@gmail.com> ----- Date: Mon, 12 Apr 2010 17:48:37 -0400 From: Troy Mulder <mulderta@gmail.com> To: Tim.Bunce@pobox.com Subject: How to loop through a database, row by row, and select and update one row at a time Hello Tim (is it Dr. Bunce?), My name is Troy Mulder, and I am trying to get a perl script to interface with a PostgreSQL database. I am trying to step through each row of the database, and read one column of the row, and update another column of the row. When I follow the online tutorial a...

Datagrid problem, Display data from records into both rows and columns (C#)
Greetings people, I got a question about datagrids. I know how to load the information out of a access database into the datagrid, but my problem is that I want to load information into vertical direction and into horizontale(columns) direction. This is my database structure tabel1: Head >> Day - Part of Day - Time Rec 1 >> Mon - Evening - 20:00 Rec 2 >> Mon - Morning - 10:00 Rec 3 >> Mon - Midday - 10:00 Rec 4 >> Don - Morning - 10:00 Rec 5 >> Don - Midday - 16:00 Rec 6 >> Don - Evening - 20:00 etc.. Now I want that ...

Repeater display row w/ data when Row.count = 0 (i.e. add a row)
Hi, OK, working w/ nested repeaters - outer repeater will always have data but inner repeater may or may not have data - i.e: Record 1 (outer repeater) - Record 1a (inner repeater) - Record 1b - Record 1c Record 2 - no data Record 3 - Record 3a - Record 3b ... What I need to do is for each loop of the inner repeater where there is no data, force the inner repeater to display a single row that will be populated with previously-obtained data. This is a monthly report of active and inactive aircraft and while most will always have records in th...

select the row of the datagrid whose value is same as one of the value of row of datagrid
hellow all,  I have a datagrid which is bound to the ordertable,so all the orderdetails are shown on the page load. but my requirement is that,i have a textbox and a search button,when the user enter the order number in the text box and click on the search button the datagrid should show that record whose order number is entered by the user n most imp that the record may be in the 65th or 34th row of the datagrid,i wants to put it in the first row. how to do it. If there's a reason you can't filter down to just the one row, you'll have to come up with some paging algorithm that wil...

Web resources about - Displaying two rows of database column data in one row of datagrid - asp.net.presentation-controls

List of mammals displaying homosexual behavior - Wikipedia, the free encyclopedia
For these mammals, there is documented evidence of homosexual behavior of one or more of the following kinds: sexual behavior , courtship , affection ...

Facebook Displaying Page Insights On Page Admins’ Personal Pages?
Some Facebook page administrators are seeing modules on their personal pages displaying page insights ad, campaign , and like totals for pages ...

Facebook Displaying Unread Messages from Pages in a New Updates Module
Facebook is displaying a new “Updates” sidebar module which shows some users unread messages sent to them by Pages. Users will see the Updates ...

Don Lemon Holds Up Sign Displaying the N-Word, Uncensored, on Air CNN Live - YouTube
Don Lemon Holds Up Sign Displaying the N-Word, Uncensored, on Air Lemon held up a Confederate flag first before holding up the sign. He asked, ...

Hazelwood coal mine fire: Morwell residents displaying symptoms similar to cigarette smokers, expert ...
An expert says some locals near Victoria's Hazelwood mine fire have symptoms similar to cigarette smokers.

Police accused of displaying fake G20 weapons
Toronto's top police officer misled the public by displaying fake weapons used in a medieval-themed role-playing game to help justify their actions ...

No charges for U.S. host for displaying high-capacity magazine on TV
NBC television journalist David Gregory won't face charges for displaying a high-capacity ammunition magazine on his "Meet the Press" news program ...

Jays' Escobar suspended three games for displaying slur
Toronto Blue Jays shortstop Yunel Escobar has been suspended three games for displaying a homophobic slur on his eye-black during a game on Saturday. ...

Google Play Store now displaying age-based ratings
We reported back in May that Google was adding age-based ratings to all apps in the Play Store as determined by the International Age Rating ...

Apple displaying Ferraris & other cars at WWDC hinting at CarPlay announcements
... 2014 Filed under: AAPL Company , iOS Continue reading more about AAPL Company and iOS at 9to5Mac . What do you think? Discuss "Apple displaying ...

Resources last updated: 11/28/2015 2:53:23 PM