Connecting Tech Pros Worldwide Forums | Help | Site Map

Setting GridView width to %

David C
Guest
 
Posts: n/a
#1: Nov 21 '08
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%"



Christiano Donke
Guest
 
Posts: n/a
#2: Nov 21 '08

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%"
>

David C
Guest
 
Posts: n/a
#3: Nov 21 '08

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%"
>>
>
>

Mark Rae [MVP]
Guest
 
Posts: n/a
#4: Nov 21 '08

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

David C
Guest
 
Posts: n/a
#5: Nov 21 '08

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