Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
ASP.NET 1.0 and 1.1 Professional For advanced ASP.NET 1.x coders. Beginning-level questions will be redirected to other forums. NOT for "classic" ASP 3 or the newer ASP.NET 2.0 and 3.5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 20th, 2005, 01:24 PM
Authorized User
 
Join Date: Aug 2004
Location: memphis, tn, .
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default DataGrid Column Width Problem

All:

I have one column out of eight on a DataGrid that seems impervious
to my settings before or during run-time. I have set it in the Property Builder to pixels and to a percentage; likewise in th HTML code. I set its HeaderStyle column width as well. I have tried to set it in the ItemDataBound and ItemCreated events i.e.
e.Item.Cells(2).Width = New Unit(80, UnitType.Pixel)

It remains way too large for for what is contained in it. The column's data is read from SQL server 2000 table. The field is defined as varchar, 35 bytes, allow nulls. The column is set to wrap.
My percentages add up to 100%, and when I try pixels I make sure they add up to the total width of the grid. My other columns behave normally.

I get the feeling that my problem is something simple. Something like a can't see the forest for the trees thing. I have run out of ideas. Does anyone here have any they could share?

Thanks in Advance,

Demivolt


 
Old July 22nd, 2005, 09:05 AM
Authorized User
 
Join Date: Aug 2004
Location: memphis, tn, .
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Problem Solved: I was clobbering the cell's width by adding a page footer in the ItemCreated event. I now understand why no one responded:)

Demivolt






Similar Threads
Thread Thread Starter Forum Replies Last Post
Align or increase width for 1 column in DataGrid remya1000 General .NET 1 June 17th, 2008 04:21 PM
Setting Column width in Datagrid anita General .NET 2 April 13th, 2005 02:25 AM
DataGrid column width johanyu VS.NET 2002/2003 0 October 30th, 2004 05:29 AM
Datagrid Column Width resize problem Deadseven VS.NET 2002/2003 0 September 28th, 2004 09:02 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.