By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,611 Members | 1,642 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,611 IT Pros & Developers. It's quick & easy.

Setting GridView width to %

P: 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%"
Nov 21 '08 #1
Share this Question
Share on Google+
4 Replies


P: n/a
maybe manually converting it...
considering that the GV requires an integer...

gvWeeklyPlanner.Width = CInt(900*0.95)
"David C" <dl*****@lifetimeinc.comescreveu na mensagem
news:%2****************@TK2MSFTNGP02.phx.gbl...
>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%"

Nov 21 '08 #2

P: n/a
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" <cd****@digiexpress.com.brwrote in message
news:Oy**************@TK2MSFTNGP06.phx.gbl...
maybe manually converting it...
considering that the GV requires an integer...

gvWeeklyPlanner.Width = CInt(900*0.95)
"David C" <dl*****@lifetimeinc.comescreveu na mensagem
news:%2****************@TK2MSFTNGP02.phx.gbl...
>>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%"


Nov 21 '08 #3

P: n/a
"David C" <dl*****@lifetimeinc.comwrote in message
news:ep**************@TK2MSFTNGP05.phx.gbl...
>>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

Nov 21 '08 #4

P: n/a
You saved me again, Mark. Thank you so much.
David
"Mark Rae [MVP]" <ma**@markNOSPAMrae.netwrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
"David C" <dl*****@lifetimeinc.comwrote in message
news:ep**************@TK2MSFTNGP05.phx.gbl...
>>>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

Nov 21 '08 #5

This discussion thread is closed

Replies have been disabled for this discussion.