473,386 Members | 1,752 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Different columns for alternating rows in gridview

I am creating a databound gridview. The last cell of each row can,
and usually does, contain a lot of text. Is there any way that I
could drop this last cell down into the next line on the gridview?
This would mean that every other row would ignore the columns and
consist of one large column. Is this possible?

Apr 13 '07 #1
3 2092
Yes, you can do this by intercepting the data binding event and writing a
second row when it binds that row.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
http://gregorybeamer.spaces.live.com

*********************************************
Think outside the box!
*********************************************
<ts******@wingate.eduwrote in message
news:11*********************@b75g2000hsg.googlegro ups.com...
>I am creating a databound gridview. The last cell of each row can,
and usually does, contain a lot of text. Is there any way that I
could drop this last cell down into the next line on the gridview?
This would mean that every other row would ignore the columns and
consist of one large column. Is this possible?
Apr 13 '07 #2
Consider using a repeater instead of a gridview. You can make the item
template out of two rows and databind in a regular way.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
<ts******@wingate.eduwrote in message
news:11*********************@b75g2000hsg.googlegro ups.com...
>I am creating a databound gridview. The last cell of each row can,
and usually does, contain a lot of text. Is there any way that I
could drop this last cell down into the next line on the gridview?
This would mean that every other row would ignore the columns and
consist of one large column. Is this possible?

Apr 15 '07 #3
Thanks for both replies. The repeater worked great.

Apr 17 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Eirik Eldorsen | last post by:
I'm trying to set alternating bgcolor for a datalist with 2 columns. My problem is that its the alternating cell that get the bgcolor, not the row. Is it possible to set alternating color of rows?...
1
by: Stuart Shay | last post by:
Hello All: I am working on a ASP.NET GridView, I am not sure to correctly define the condition so Alternating Rows are fired with in the event. My Code only works on Item Rows in both Normal and...
2
by: =?Utf-8?B?dmFuZGls?= | last post by:
I have a web app that I have been working on for the last couple of weeks trying to solve this problem. One page contains a GridView with four base columns, and an unknown number of columns to be...
1
by: Sachin | last post by:
Hi All, I am using ASP.NET Repeater Web Control. I want to use different stylesheets for alternating rows similar to DataGrid contorl. How can I do this? Thanks In Advance Sachin
3
by: Emma Middlebrook | last post by:
Hi there, I've been trying to implement a repeater control in an ASP.NET 2 page but I can't seem to get the layout exactly how I want and I'm not sure if it's something that I am doing wrong or...
3
by: nguyenlh | last post by:
code: I have read a example :The use girdview without datasource <asp:GridView AutoGenerateColumns="false" ID="GridView1" runat="server" OnRowCancelingEdit="GridView1_RowCancelingEdit"...
1
by: neobonzi | last post by:
Hello! I'm dynamically creating a GridView bound to a datatable using custom template columns using the following method: protected void ShowGrid(DataTable dt) { ...
2
by: Ralf | last post by:
I have a custome request to print a gridview with lots of columns, 31 to be exact. I know how to print out a gridview, done it already for a GV with 6 columns. But, this GV is very wide and will...
1
by: hamidawan | last post by:
Hi I have a problem with my ASP.Net Gridview Control. I have a GridView that has a variable number of columns. First two columns are permanent. Remaining CheckBox columns that contain...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.