How to divide 1 GridView Row with 1 column in 2 Rows with 5 columns?

Hi;

I have a GridView with 10 rows and 1 column. How can I do to this GridView show the same data, but with 2 rows and 5 columns? In classic ASP, I made it this way:

While (NOT rsFotos.EOF)
if i mod 5 = 0 then
Response.Write "</tr><tr>"
end if
...

Someone can help? :)
 

0
rkaveski
4/12/2008 5:01:36 AM
asp.net.presentation-controls 72751 articles. 3 followers. Follow

4 Replies
1362 Views

Similar Articles

[PageSpeed] 18

You have to use a custom template and lay the table out the way you want, either dropping controls in the template or creating a custom ITemplate that takes care of it for you.

http://professionalaspnet.com/archive/2006/06/15/Useing-ITemplate-in-the-Data-Controls.aspx


Chris Love
ASP.NET 2.0 Your Visual Blueprint for developing Web Applications
0
docluv
4/12/2008 9:28:51 AM

Hi docluv and thanks for your answer.

I'm relatively new to ASP.NET and I don't know much about interfaces. Do you have a realy simple example, just to I get the way to go? Anyway I'm looking for some information about Interfaces too.

 Thanks.
 

0
rkaveski
4/12/2008 5:27:57 PM

Hi rkaveski,

I suggest you can use DataList to do your requirement.

Here is a link for doing this: http://quickstarts.asp.net/QuickStartv20/aspnet/doc/ctrlref/data/datalist.aspx

Thanks,


Qin Dian Tang
Microsoft Online Community Support

Please remember to mark the replies as answers if they help and unmark them if they provide no help.
0
Qin
4/15/2008 8:41:09 AM

 Just great!

 Thanks
 

0
rkaveski
4/15/2008 1:58:20 PM
Reply:

Similar Artilces:

GridView.Rows(Column=ID_PK) to GridView.Rows(Column=DropDownListTeamplteField)
Hi Guys,I wonder how I can assign the PrimaryKey in each GridView Row to the template field in the same row. whereas the template field is filled with a dropdownlist thatshould show the values for retrieved in a different table through the GridView Row primary key (which serves as the SELECT parameter to get these values) The GridView looks like this:<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="C_ID" DataSourceID="GetC_IDs"> <Columns> <asp:BoundField D...

is it possible to turn 1 column,many rows into one row,many columns in sql ?
 Hi AllI have the following query:Select CategoryName From Category Where CategoryId In(Select SkillId From SpecialitySkills Where CopywriterId = 13) It gives me the correct results but not in the form that i want, i would like it to be in one row, many columns. its in 1 column, many rows.Any ideas?  You must be talking about displaying it on a web page? Just create a loop that runs through the rows of the data that is returned then just make html table:dim tablestring as string = "<table><tr>" for i as integer = 0 to dt.rows.count - 1 tablestring += &...

dw.Rows and dw.Columns in dw.NET 1.5
Hi, I have extended (in VB.NET) the datawindow.NET 1.5 by adding 2 simple collections : Columns and Rows. I can now use the datawindow / datastore just like the .NET DataTable. For example (VB.NET) : To enumerate columns and set the backcolor to red : For each col As DatawindowColumn in dw.Columns Debug.WriteLine("column " & col.ColumnName & " type " & col.ColumnType) col.BackColor = Color.Red Next To set the value of 0 to column "foo" of each rows : For each row As DatawindowRow in dw.Rows row("foo") = 0 Next ...

highlight 1 column, 1 row!
I have the syntax in my datawindow's itemfocuschanged event to hightlight the cell with focus: this.modify (dwo.name + "background.color='" + string(rgb(255,255,0)) + "'") The problem is this is a multi-row datawindow, so when the highlighting is done, it highlights the column with focus on ALL rows, not just one row. How do I restrict the highlighting to just the row being worked on, not all of them?? Cameron -- You need to specify a conditional expression for the background color in order for it to work on a specific row. Something like t...

VB.NET 1.1 Searching through DataList Column by Column
Hi,I am trying to search through a DataList column by column.  I am doing this so that if each cell within that sector is empty then I will hide that column.  I have implemented a quick function in order to do this, however, it is searching through the datalist row by row.  Below is my code, with explanations of what the code is trying to do.  I think the problem is to do with the String sector.  Is there anyway that I can change the sector string so that it will iterate through the table (dataset) column by column.Code:Dim myData As Data.DataSet = dbAccess.getChildr...

Differences between .net 1, .net 1.1, .net 2.0 and .net 3.0 #2
Hi, This seems to be a common question, but i havent got an answer yet:(Can, any one please explain me the differences between these versions.If you keep your feet firmly on the ground, you'll have trouble putting on your pants! There are too many differences for one email - - from 1.0 to 1.1 (not a whole lot of real change, other than fixes, at least compared to 1.1 to 2.0) With 2.0, there were many new declarative controls, with many new ideas added in With 3.0, it's a superset of 2.0 - instead of replacing the installation completely, it just 'added on' new functionality - I would...

Code only reads 1 Column and 1 Row in DataBase
Edited by tmorton. Please post code between <code> and </code> tags. Hello All, I have a problem I do not know if it's in my project code or stored procedure. I have a form and once the students enters their social security number inside of textbox. The database reads the number and display that student's first and last name in a textbox on another form that I created. But when I type in a SSN it will read only the 1st columnn and 1st row of my database table. It accepts the SSN but the student's name doesn't match. It will keep giving the same student's name of t...

Smoke [5.10.1] perl-5.10.1-1-gca8de22 FAIL(F) MSWin32 WinXP/.Net SP3 (x86/2 cpu) #2
Automated smoke report for 5.10.1 patch ca8de220718ba91d5a5fdd9779497cd5b02= 50258 perl-5.10.1-1-gca8de22 maldoror.bath.planit.group: Intel(R) Core(TM)2 CPU 6700 @ 2.66GHz(~2660 MHz= ) (x86/2 cpu) on MSWin32 - WinXP/.Net SP3 using cl version 15.00.30729.01 smoketime 4 hours 39 minutes (average 27 minutes 58 seconds) Summary: FAIL(F) O =3D OK F =3D Failure(s), extended report at the bottom X =3D Failure(s) under TEST but not under harness ? =3D still running or test results not (yet) available Build failures during: - =3D unknown or N/A c =3D Config...

Datagrid(.net 1.1) to GridView(.net 2.0) and using the RowUpdating event how to extract the values from the controls.
Ok  This is the settings: I use a Viewgrid with only itemtemplate colums for example. <asp:TemplateField HeaderText="Test"><ItemTemplate><asp:Label id="LBL_Test" text='<%# DataBinder.Eval(Container.DataItem, "Test1") %>' runat="server" meta:resourcekey="LBL_TestResource1"></asp:Label></font></ItemTemplate> <EditItemTemplate><asp:TextBox ID="HDN_Test" Text='<%# DataBinder.Eval(Container.DataItem, "Test1") %>' Runat="server" meta:resourcekey="HDN_TestResource1" /></EditItemTemplate></asp:TemplateField>  The ...

WHERE COLUMN=1 AND COLUMN=2
I have a table that I need to select ALL values that are submitted, so I can't use COLUMN IN (1,2) as this would return all rows with either 1 or 2. Same goes for using OR. So how do I transform the impossible query "WHERE COLUMN=1 AND COLUMN=2" into one that actually returns a result? In this example what I want to return would be all id's that have 1 AND 2 in the column in question, just to be be clear. Cheers! /Eskil   A column can only have ONE value. It can't be both 1 and 2. -- "Mark As Answer" if my reply helped you -- ...

Smoke [5.10.1] perl-5.10.1-1-gca8de22 FAIL(F) MSWin32 WinXP/.Net SP3 (x86/2 cpu) #5
Automated smoke report for 5.10.1 patch ca8de220718ba91d5a5fdd9779497cd5b02= 50258 perl-5.10.1-1-gca8de22 maldoror.bath.planit.group: Intel(R) Core(TM)2 CPU 6700 @ 2.66GHz(~2660 MHz= ) (x86/2 cpu) on MSWin32 - WinXP/.Net SP3 using cl version 13.10.3077 smoketime 4 hours 39 minutes (average 27 minutes 56 seconds) Summary: FAIL(F) O =3D OK F =3D Failure(s), extended report at the bottom X =3D Failure(s) under TEST but not under harness ? =3D still running or test results not (yet) available Build failures during: - =3D unknown or N/A c =3D Configure,...

How to go through a datatable row by row and column by column
Hello, I have a dataset with a datatable and I need to insert each row from the datatable on my sql table, anyway there may be errors, so some rows may not be inserted because primary key constraints,  So I need to show the rows that are not inserted in a gridview, the hard thing to do is to go through all the datatable,  is there an wasy way to do it?MCPD ENTERPRISE APPLICATION DEVELOPER Start by looking herehttp://msdn2.microsoft.com/en-us/library/system.data.common.dataadapter.update.aspxPerform an update of your dataset, and if a row fails, you can mark it as invalid.You can ...

getting Grand Total (from stored proc, just 1 row, 1 column)
1. I want to write a class that will give me the grand total from a stored procedure. The sp works fine and gives me totalSales.2. Can someone please verify my code below and make appropriate change?3. Can someone please provide frontend code to read this? (labelTotal.text = totalsales) public int get_pto_granted(int emp_id) { SqlConnection conn = new SqlConnection(connStr); string sp = "sp_getPTOGranted"; SqlCommand cmd = new SqlCommand(sp, conn); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("emp...

Differences between .net 1, .net 1.1, .net 2.0 and .net 3.0
Hi, This seems to be a common question, but i havent got an answer yet:(Can, any one please explain me the differences between these versions.If you keep your feet firmly on the ground, you'll have trouble putting on your pants! Have a look into this links http://en.wikipedia.org/wiki/.NET_Framework http://blogs.msdn.com/mohammadakif/archive/2006/12/03/net-3-0-different-versions-of-the-net-framework.aspx http://www.codeproject.com/aspnet/ComparisonASP1xASP20.aspAshok Rajawww.iGold.inDon't forget to click "Mark as Answer" on the post that helped you. This credits that m...

Web resources about - How to divide 1 GridView Row with 1 column in 2 Rows with 5 columns? - asp.net.presentation-controls

GridView SelectedItem Binding Gotcha in WinRT
Last night when I was doing some WinRT hacking I was trying to setup databinding to the selected item in the GridView control and I ran into ...

CNW Group
Home Services Beyond the Wire About CNW Financials Webcasts Events My CNW All News Releases Advanced Search Gridview Latest News Releases All ...

CNW Group
... Services Beyond the Wire About CNW my CNW CNW Access CNW Directories Financials Webcasts Events my CNW All News Releases Advanced Search Gridview ...

CNW Group
Home Services Beyond the Wire About CNW Financials Webcasts Events My CNW All News Releases Add a Filter Gridview Latest News Releases All Today ...

New CmdLets of Powershell 2.0
New CmdLets of Powershell 2.0

Price Drop: Softbox
... objects- create product reflection- changing the background with something more interestingUse it as:- softbox- honeycomb softbox- gridview ...

Profile.aspx: ASP Alliance
.NET,ASP,ASP.NET,SQL,XML,HTML,ADO,ADO.NET,JavaScript,JScript,CSharp,VBScript and VB tutorials from AspAlliance.

Quick Answers - CodeProject
Questions - Free source code and tutorials for Software developers and Architects.; Updated: 25 Oct 2012

DotNetKicks.com - Upcoming stories
DotNetKicks.com is a community based news site edited by our members. It specialises in .NET development techniques, technologies and tools including ...

View Features - ExtendASP
Call 847-681-9827 or Request a Demo View Features Testimonials Pricing About Us Coming Soon ExtendASP exposes every feature, more than any other ...

Resources last updated: 12/22/2015 10:13:43 AM