You will need to add them to a div (which can also be created dynamically if necessary) which has
overflow:auto set along with the required height and width.
I have read this post, but I think my question is a little different.
The gridview count is not determined until the runtime. So I just add a PlaceHolder control to the page, and add the GridView control into the PlaceHolder dynamically.
I use VS 2005 with c#. It's code behinde file. And I have no idea where to put <div> into page scripts.
You will need to add them to a div (which can also be created dynamically if necessary) which has
overflow:auto set along with the required height and width.
Is there any way to add the <div> to page scripts by code behind files?
Well you can always place a panel (panel translates to div) or div directly inside placeholder (placeholder doesnt translate to anything but gives direct code) and put the dynamic gridview inside it. Style the panel or div with Css as suggested and off you
go..
Please Mark Post that helped you as answer, also include a summary of what solved the problem as it helps others in similar situations
Marked as answer by lingz on Oct 23, 2007 08:38 AM
lingz
Member
20 Points
35 Posts
possible to add scrollbar to dynamically created gridview?
Oct 22, 2007 08:26 AM|LINK
I have read articles on adding scrollbar to gridview, but I didn't find any for dynamically created gridview.
I am currently creating gridviews at runtime, I want to add scrollbar to shorten the long list.
I am not sure it is possible to fulfill?
thanks,
scroll bar gridview dynamic
ca8msm
Star
12439 Points
2153 Posts
Re: possible to add scrollbar to dynamically created gridview?
Oct 22, 2007 08:43 AM|LINK
You will need to add them to a div (which can also be created dynamically if necessary) which has overflow:auto set along with the required height and width.
Website Design Darlington - http://lessthandot.com -
http://aspnetlibrary.com
naturehermit
Star
14610 Points
3046 Posts
Re: possible to add scrollbar to dynamically created gridview?
Oct 22, 2007 08:49 AM|LINK
Hi There,
Please look at this forum where this has already been answered http://forums.asp.net/p/1168493/1956130.aspx#1956130
Good luck
lingz
Member
20 Points
35 Posts
Re: possible to add scrollbar to dynamically created gridview?
Oct 22, 2007 09:42 AM|LINK
I have read this post, but I think my question is a little different.
The gridview count is not determined until the runtime. So I just add a PlaceHolder control to the page, and add the GridView control into the PlaceHolder dynamically.
I use VS 2005 with c#. It's code behinde file. And I have no idea where to put <div> into page scripts.
lingz
Member
20 Points
35 Posts
Re: possible to add scrollbar to dynamically created gridview?
Oct 22, 2007 09:43 AM|LINK
Is there any way to add the <div> to page scripts by code behind files?
ca8msm
Star
12439 Points
2153 Posts
Re: possible to add scrollbar to dynamically created gridview?
Oct 22, 2007 09:48 AM|LINK
Yes, in exactly the same way that you create any other dynamic control.
Website Design Darlington - http://lessthandot.com -
http://aspnetlibrary.com
naturehermit
Star
14610 Points
3046 Posts
Re: possible to add scrollbar to dynamically created gridview?
Oct 22, 2007 09:51 AM|LINK
Well you can always place a panel (panel translates to div) or div directly inside placeholder (placeholder doesnt translate to anything but gives direct code) and put the dynamic gridview inside it. Style the panel or div with Css as suggested and off you go..