Connecting Tech Pros Worldwide Help | Site Map

Setting GridView width to %

  #1  
Old November 21st, 2008, 06:15 PM
David C
Guest
 
Posts: n/a
I am emailing a GridView and setting its Width property to 900 before
rendering and it works great. However, when the rendering is done, I want to
reset the Width back to 95% like it was. When I try to do that it throws an
error "Conversion from string "95%" to type 'Integer' is not valid."
My code causing the error is below. Is there a work around? Thanks.

David

gvWeeklyPlanner.Width = "95%"


  #2  
Old November 21st, 2008, 06:25 PM
Christiano Donke
Guest
 
Posts: n/a

re: Setting GridView width to %


maybe manually converting it...
considering that the GV requires an integer...

gvWeeklyPlanner.Width = CInt(900*0.95)


"David C" <dlchase@lifetimeinc.comescreveu na mensagem
news:%23KNStQATJHA.1560@TK2MSFTNGP02.phx.gbl...
Quote:
>I am emailing a GridView and setting its Width property to 900 before
>rendering and it works great. However, when the rendering is done, I want
>to reset the Width back to 95% like it was. When I try to do that it
>throws an error "Conversion from string "95%" to type 'Integer' is not
>valid."
My code causing the error is below. Is there a work around? Thanks.
>
David
>
gvWeeklyPlanner.Width = "95%"
>

  #3  
Old November 21st, 2008, 06:45 PM
David C
Guest
 
Posts: n/a

re: Setting GridView width to %


The problem with this idea is that it will then be 95% of 900 (855) instead
of 95% of the screen width.

-David
"Christiano Donke" <cdonke@digiexpress.com.brwrote in message
news:OyL9gUATJHA.6060@TK2MSFTNGP06.phx.gbl...
Quote:
maybe manually converting it...
considering that the GV requires an integer...
>
gvWeeklyPlanner.Width = CInt(900*0.95)
>
>
"David C" <dlchase@lifetimeinc.comescreveu na mensagem
news:%23KNStQATJHA.1560@TK2MSFTNGP02.phx.gbl...
Quote:
>>I am emailing a GridView and setting its Width property to 900 before
>>rendering and it works great. However, when the rendering is done, I want
>>to reset the Width back to 95% like it was. When I try to do that it
>>throws an error "Conversion from string "95%" to type 'Integer' is not
>>valid."
>My code causing the error is below. Is there a work around? Thanks.
>>
>David
>>
>gvWeeklyPlanner.Width = "95%"
>>
>
>

  #4  
Old November 21st, 2008, 09:05 PM
Mark Rae [MVP]
Guest
 
Posts: n/a

re: Setting GridView width to %


"David C" <dlchase@lifetimeinc.comwrote in message
news:epjtuiATJHA.5812@TK2MSFTNGP05.phx.gbl...
Quote:
Quote:
Quote:
>>gvWeeklyPlanner.Width = "95%"
>>
>Maybe manually converting it...
>considering that the GV requires an integer...
>>
>gvWeeklyPlanner.Width = CInt(900*0.95)
>
The problem with this idea is that it will then be 95% of 900 (855)
instead of 95% of the screen width.
gvWeeklyPlanner.Width = Unit.Percentage(95);


--
Mark Rae
ASP.NET MVP
http://www.markrae.net

  #5  
Old November 21st, 2008, 09:55 PM
David C
Guest
 
Posts: n/a

re: Setting GridView width to %


You saved me again, Mark. Thank you so much.
David
"Mark Rae [MVP]" <mark@markNOSPAMrae.netwrote in message
news:%23rbfoyBTJHA.5364@TK2MSFTNGP05.phx.gbl...
Quote:
"David C" <dlchase@lifetimeinc.comwrote in message
news:epjtuiATJHA.5812@TK2MSFTNGP05.phx.gbl...
>
Quote:
Quote:
>>>gvWeeklyPlanner.Width = "95%"
>>>
>>Maybe manually converting it...
>>considering that the GV requires an integer...
>>>
>>gvWeeklyPlanner.Width = CInt(900*0.95)
>>
>The problem with this idea is that it will then be 95% of 900 (855)
>instead of 95% of the screen width.
>
gvWeeklyPlanner.Width = Unit.Percentage(95);
>
>
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
Gridview Row Height in Opera =?Utf-8?B?UGhpbCBKb2huc29u?= answers 2 March 19th, 2008 10:25 AM
Gridview Column Width Yin99 answers 4 December 11th, 2007 04:15 AM
Responding to LinkButton within a Gridview CJM answers 2 July 6th, 2007 05:05 PM
Setting GridVIew column widths at runtime Steve Bugden answers 5 March 7th, 2006 12:15 PM