How do I turn 2 columns of data into 6 columns of data?

I am pulling the Display Name and Fax Number from Active
Directory.  It gets put into a datatable, then fed to a
DataGrid.  I end up with a format like this:

dn fn
dn fn
dn fn
etc.

What I need to do is format it like this:

dn fn dn fn dn fn
dn fn dn fn dn fn

I can try a DataList and use <%# DataBinder.Eval(Container.DataItem, "cn" %>, but then the same values would be put in the same place as the code looped through the search results.

Does anyone know how to change the actual column layout of a DataGrid or DataList so the data is displayed horizontally, not vertically?

Thanks!

Ariston Collander
"No one person's opinions could be said to be 'truer' than another's. For each is the sole judge of his or her own experiences." - Protagoras
0
ThePharaoh
4/28/2005 11:07:51 PM
asp.net.presentation-controls 72751 articles. 3 followers. Follow

2 Replies
1050 Views

Similar Articles

[PageSpeed] 25

The datagrid shows only those columns which are available in the datasource. If there are only two columns, then you will see only two columns. Honeslty I dont understand why you need 6 cols. Maybe you can explain a bit more.
Sonu Kapoor [MVP]
Feel free to ask me any .NET question | Ajax Data Controls Forum
0
SonuKapoor
4/28/2005 11:59:15 PM

You can use the following code to display in three columns

<asp:DataList id="DataList1" Runat=server RepeatColumns=3 RepeatDirection=Horizontal GridLines=Both>
   <ItemTemplate>
       <td><%#DataBinder.Eval(Container.DataItem,"Col1") %></td> 
       <td><%#DataBinder.Eval(Container.DataItem,"Col2") %></td>
   </ItemTemplate>
  </asp:DataList> 

Feel free to contact for any queries.

Thanks

Karthik

0
KarthikMIT
4/29/2005 6:45:33 AM
Reply:

Similar Artilces:

Data presentation control in another Data presentation control
 Hello,I want to make a menu with datalist or gridview control.Basically,the menu will be like this,Categories     Sub Categories.For example, for COMPUTING category there will be NOTEBOOKS DESKTOPS etc.There will be a image for CATEGORIES and linkbuttons with Subcategories.If I put a datalist inside a datalist and a link button inside the second datalist visually it satisfies my need.However,CommandArguments come from database to linkbutton.Andwhen one of these command buttons is cliked it must go to proper page.I dont know how to wrie an event_handler ,specifically, for...

How to display a column data partially but need complete column data for update?
I have a column in my gridview that contains API KEYS for google maps. These keys are huge so i just need to display partial key for viewing purpose. But I need the complete key when user clicks on update button in gridview. How can I achieve this? Any ideas. I am copying part of my gridview aspx code. Rest of the code is coming from my class file for object datasource. <asp:GridView ID="gvDomains" runat="server" DataSourceID="odsDomains" AutoGenerateColumns="False" DataKeyNames="DomainID" Height="147px" Width="30...

The .Net Data SQL Provider (System.Data.SqlClient) requires Microsoft Data Access Components(MDAC) version 2.6 or later.
I am getting error like The .Net Data SQL Provider (System.Data.SqlClient) requires Microsoft Data Access Components(MDAC) version 2.6 or later. i am working with windowsXP. Already in my system i have MDAC 2.7. I donot know why am i getting error like this. anybody help me please...

i have work on gridview control.in that i have 3columns.name as subject,bookname,link. in this some link column data are very large.according to that data(no spaces in that data)gridview has changed.i
hi,i have work on gridview control.in that i have 3columns.name as subject,bookname,link. in this some link column data are very large.according to that data(no spaces in that data)gridview has changed.i want display half of the data and remaining display like this.(ex:http://ww.yahoo.com...........).how can i display like this,and one more thing is always the column size will constant. Try something like this: <asp:templatefield headertext="Link"> <itemtemplate> <asp:hyperlink id="HyperLink1" runat="server" navigateurl='<...

how to select particular data of a column from any data control at run time?[*-)]
I want to select series of data on a particular column, using mouse drag method in run time. Is it possible to get the values of selected data ? which data control shud i use? Does anyone know? Thankx in Advance...

Inserting BLOB Type column data with other columns data(normal Text)
In below code, SQL Statement is used to Insert BLOB Type data using Serialization. It is required to insert other (normal text) with BLOB Type data as well. Like to get below SQL statement amended so that all the columns(ID,name, blob) can be inserted. Just now below code working fine Inserting BLOB Type data. I think it is not stright forward way to insert all the columns(normal text) with BLOB?  1 protected void button2_Click(object sender, EventArgs e) 2 { 3 //Connection string 4 string oradb = datasource= mysource;userid="xyz" password="passwo...

.NET 2.0 Data Connection (.NET 2.0 Beta Data Provider)
I have installed the .NET 2.0 Beta Data Provider, in the server explorer in Visual Studio 2005 I have tried to connect to this provider but I can not see it in the list. Is there something else you need to do to see this other than what is in the instructions or is this not supported yet? Hi Dean, I assume you mean ASE ADO.NET 2.0 Beta. I'm attaching the html readme for this product that you should have from downloading it. Are you talking about using Server Explorer to see the Provider? This functionality isn't working yet and should be available on GA or shortly ...

Data Set ---- Data Row ( How to retrieve column data in a array )
Question regarding Dataset in ASP.NET ds = DBFunctions.RunSelect("select * from emp where Userid='" & vUserID & "'") If (ds.Tables(0).Rows.Count > 0) Then Dim dr As DataRow = ds.Tables(0).Rows(0)location= dr("location")  -- this statement only gives me the first locaitonMytable userid          location111              AAA111              BBB111         ...

Getting data from data columns
 for now if i want to say retrive a field from a row, i use 1 SQLDataSource, 1 GridViewThen in the code it will be like Dim temp as String = GridView.Rows(0),Cells(5).Text, works but i need quite alot of redundant controls isit? how do i do it with say just 1 SQLDataSource or something else, classic ASP with SQL code, is a bit complex sometimes, although if thats the only way i don't mind, but state how to do it? i get quite blur when it comes to ASP with SQL, they by itself is still ok. Hello my friend, The SQLDataSource is good for simple get and display, but when you need to i...

data, data, data
Hello, I need some advice on the best method to keep a database updated in this scenario. I have a local Solomon SQL Server where we keep our inventory. I want to build an application that will be hosted at a remote hosting location which provides a SQL database. I want to build the application to allow clients to access the inventory items and make requests based on the remote SQL data. The order will be sent to our fulfillment department via email; they will fiill the request and ship.  I'm not sure the method to do this while keeping the data current on the remote and the l...

Bind Data to an Image Control not in a Data Presentation Control
I've been searching for two days but I don't really know what to search for.I'm making a site for a photographer.  The Default.aspx page displays Albums by showing a title, image and description from the database table Albums. Click an album to view the contents and it passes the QueryString which is AlbumName.  The ViewAlbum.aspx page uses the QueryString to display an UpdatePanel holding a Large Image and a Repeater full of dynamically filled ImageButtons for thumbs.  Both are from the database table Photos and are retrieved using an ObjectDataSource. Click the ...

separate 1 column of retreived sql data into 2 evenly spaced columns
I have a DB call that pulls back a set of records containing X number of First Names.  Instead of listing them in one single row, I'd like to separate the records into 2 rows for a better visual interfeace.What's the best way to do this?I couldn't figure out how to do it with a Datagrid.Thanks in advance! Use a DataList. It lets you define how many columns of data you want to list....

datagrid with dropdownlist in a column
Hi, I am attempting to set the data in 2 template columns based on the selectedIndexValue of the dropdownlist. I am capturing the selectedindexchanged event and using that. The problem occurs when I attempt to use the value in the dropdownlist as an argument for the stored procedure that needs to run to retrieve the needed data for the other 2 columns. Any Suggestions? -Laeros  Here is my code...Public Sub dgDropDownProjects_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles dgUserList.SelectedIndexChanged Dim strConn As String strConn = ...

Issue with Template Columns & Bound Columns while updating the data in a GridView control
Hi, I'm facing the below problem (In general, ObjectDataSource is driving me crazy ! ) I have a simple gridview control and an ObjectDataSource is used to populate the grid. I'm trying to update a row and the corresponding tableadapter methods & stored procedure are in place. Each row has 2 checkboxes and 2 textboxes in edit mode. When the change the values in edit mode and hit update, the checkbox values changed are saved into the Database properly, whereas the textbox values are not being saved. If the textbox column is a bound column then the column is updated with <NULL> in...

Web resources about - How do I turn 2 columns of data into 6 columns of data? - asp.net.presentation-controls

Politics, Political News - The Capitol Column
Covering the politics of science, technology, business, entertainment, Capitol Hill, and health.

Column (typography) - Wikipedia, the free encyclopedia
In typography , a column is one or more vertical blocks of content positioned on a page, separated by gutters and/or rules . Columns are most ...

Column 8: 'Don't order anything'
A word of warning about the true meaning of Australia Post's 'Hold Mail' service from Brian Jeffrey, of Cook, ACT.

Column 8: 'I am the Jenny doll'
&quot;I am the Jenny doll, and was a flight attendant with Qantas for 13 years,&quot; writes Jennie Leroy (nee Tregaskis, Column 8, Monday). ...

Paris attacks: column in IS magazine warns of 9/11-scale attack to come
Under the byline of a hostage British journalist, Islamic State warns that it may attempt a terrorist attack even bigger than 9/11.

Column 8: More weird 'hotel signage'
&quot;I have more weird 'hotel signage',&quot; offers George Watson, of Grafton (Column 8, Thursday). &quot;The following was posted on the wall ...

The 10 Best Online Columns Of All Time . . .
Former Biglaw partner and inhouse columnist Mark Herrmann identifies the ten best online columns of all time.

Should the Washington Post’s Ties to Reagan Library Be Disclosed in Columns Attacking Bill O’Reilly?
Much has been discussed regarding the recent spat between Washington Post columnist and Fox News contributor George Will and Fox News host and ...

Tim O'Sullivan column: Giving thanks to our father figures on this holiday
Concord Monitor Tim O' Sullivan column: Giving thanks to our father figures on this holiday Concord Monitor That man would be Celtics basketball ...

Mark Bittman's "Fast Company" Column Starts Today
The best-selling author and Emmy award-winning TV personality is writing about his startup experiences exclusively for Fast Company . The influence ...

Resources last updated: 11/29/2015 1:18:31 PM