473,763 Members | 1,356 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Setting column widths in DataList?

All,

I have a table with three rows, and within each row I have a DataList that
is set to use 3 columns. The problem I'm having is that each DataList sets
it's columns to be different widths so when the user is looking at the data,
the columns move back and forth among the DataLists. I don't know how well
this will appear in text, but it looks something like:

XXX XXXXX XXXXX
XXX XXXX XXXXX
XXX XXXXX XXXX

Where it should look like:
XXX XXXXX XXXXX
XXX XXXXX XXXXX
XXX XXXXX XXXXX

What I need is to be able to tell each DataList to make it's columns a fixed
width so that all three datalist have the same column sizes. I can't put all
of the data into a single datalist because I need to have a unique header
above each datalist.

Is this possible? Or am I going about this the wrong way?

Thanks for any info!
Nov 19 '05 #1
1 2569
There is no way to force the browser to show 3 different tables with the
same column width. You don't have full control over column widths, the
browser considers your instructions as recommendations . You have to put all
the datalists inside the same table and solve the header problem. You might
want to merge 3 datasources in 1 with header records in between, then in
ItemDataBound event catch the header records and format them differently.

Eliyahu

"Rachel Devons" <no*****@nonono n.com> wrote in message
news:el******** ******@TK2MSFTN GP14.phx.gbl...
All,

I have a table with three rows, and within each row I have a DataList that
is set to use 3 columns. The problem I'm having is that each DataList sets
it's columns to be different widths so when the user is looking at the data, the columns move back and forth among the DataLists. I don't know how well
this will appear in text, but it looks something like:

XXX XXXXX XXXXX
XXX XXXX XXXXX
XXX XXXXX XXXX

Where it should look like:
XXX XXXXX XXXXX
XXX XXXXX XXXXX
XXX XXXXX XXXXX

What I need is to be able to tell each DataList to make it's columns a fixed width so that all three datalist have the same column sizes. I can't put all of the data into a single datalist because I need to have a unique header
above each datalist.

Is this possible? Or am I going about this the wrong way?

Thanks for any info!

Nov 19 '05 #2

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

Similar topics

3
4393
by: cpt | last post by:
I read that if one uses "table-layout:fixed" then table rendering is speeded by setting row height. All my rows are 285 px high. 1) Is this true? 2) If true, how does one set row-height for the table, preferable with a CSS style? Thanks, CMA
1
6175
by: Will | last post by:
I have a combo box on a form which is based on table tblMachine. On that combo box I have four columns visible MachineNumber, description, location and type. The bound column is the MachineNumber and this is not set to 0 as the machines have its number on which means the user should know the machine number. My problem is if the user doesn't know the number. I have a button which changes the row source of the combo box to order by...
5
5296
by: nimdez | last post by:
Hi, I am working on an existing code base in which a lot of data displayed to the user is formatted in tables. Most tables are printed row-by-row using printf() with "%s" print conversion specification for each column (e.g. printf(%10s %25s %15s\n", pszCol1, pszCol2, pszCol3)). My problem is that when a string is longer the column's width, it overflows the column and takes the table out of alignment. What I want it to do is word-wrap...
6
7108
by: cr113 | last post by:
I'm trying to set the column widths for a datagrid. You'd think it would be easy. I looked it up in google and the first thing I found looked promising: datagrid1.columns(0).width = 2000 datagrid1.columns(1).width = 1000 Except that there is no such things as a columns collection in a datagrid.
4
4194
by: Rich | last post by:
Hello, I have a one datagrid that will be based on different datatables. One datatable may have 7 columns, another 15... With the tables that have more columns, I have been manually dragging column widths to narrow them. I want to record these widths so I can reapply them when I bind the datagrid to the table with 15 columns. I have searched around for articles on this and saw some that talked about...
5
10285
by: Steve Bugden | last post by:
Hi, I would like to set the column widths in the ASP.NET GridView control at runtime I have tried the following: http://msdn2.microsoft.com/en-us/library/ms178296.aspx Which uses the following code on a button: Protected Sub Button1_Click(ByVal sender As Object, _
4
15432
by: Chuck | last post by:
I'm setting the column with for a gridview (25+- columns) and have paging turned on. When the gridview is first displayed, the column widths are all set to the default. But after paging to another page, the widths are set as they should be. Going back to page one, the widths are still correct. Not a clue what's going on here!
2
2186
by: Midsomer | last post by:
Hi. I have an Access database with a form containing 4 datasheets and I allow the user to change column widths. On closing the form, a routine is fired that saves each column width to an INI file. When the form is opened, the INI file is read and sets up the column widths for the user. Works well, but there is a slight delay on closing the form, so I would like to detect if any column widths have been changed and save them only if...
3
6756
by: =?Utf-8?B?bWljaGFlbCBzb3JlbnM=?= | last post by:
I am wondering what is considered a best practice for setting column widths to fit the data for a DataGridView (.Net 2.0) that was created on-the-fly from an arbitrary query. What I would probably do is scan the width of each column for the first couple hundred or so rows and find the largest. (But how does one convert character counts to field widths in pixels?) More generally, however, is there a better approach to accomplish this?
0
9563
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9386
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10145
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9938
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9822
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5406
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3917
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3523
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2793
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.