|
-
Mar 6th, 2006, 07:49 PM
#1
Thread Starter
Fanatic Member
ASP.Net Datagrid width ...
Hi,
This should be simple, but, alas, it's not. I'm creating a datagrid dynamically in VB.net. I would like to increase the width of the datagrid after it has been created to put some spacing between the columns.
I've tried to accomplish this like so:
VB Code:
dGrid.Width = Web.UI.WebControls.Unit.Percentage(dGrid.Width.Value * 1.5)
; however, dGrid.Width.Value is 0.0 even after my datagrid has been populated with data. How can I increase the width of the datagarid without assigning some arbitrary value like this:
VB Code:
dGrid.Width = Web.UI.WebControls.Unit.Percentage(60)
? I want to size the datagrid dynamically based on it's width after it's populated.
Thanks,
1Source
-
Mar 9th, 2006, 01:07 PM
#2
Thread Starter
Fanatic Member
Re: ASP.Net Datagrid width ...
-
Mar 9th, 2006, 02:26 PM
#3
Re: ASP.Net Datagrid width ...
The true dataGrid width cannot be read at the server end.
Even when you specify a width, the browser might ignore it and assign a different width (like if the content is too long to fit).
Your best bet is to make it not dependant on a specified width.
That said, what is the aversion to using width="100%" ?
Need to re-register ASP.NET?
C:\WINNT\Microsoft.NET\Framework\v#VERSIONNUMBER#\aspnet_regiis -i
(Edit #VERSIONNUMBER# as needed - do a DIR if you don't know)
-
Mar 10th, 2006, 07:07 AM
#4
Re: ASP.Net Datagrid width ...
If you want cellspacing, set the cellspacing value of the asp:datagrid tag.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|