•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP.NET section within the Web Development category of DaniWeb, a massive community of 427,221 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,263 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP.NET advertiser: Lunarpages ASP Web Hosting
Views: 548 | Replies: 3
![]() |
•
•
Join Date: Dec 2007
Posts: 3
Reputation:
Rep Power: 0
Solved Threads: 0
Really having trouble with UI design using AJAX and Web Dev Express 2005. Designing systems for 25 years and finding the latest and greatest the biggest pain in the ass to figure out since JCL.
Anyway:
I have been trying to put controls such as the Gridview into a <DIV> instead it always positions itself all over the page in absolute placement. The control is bound and I cannot shrink the grid to fit the size of my <DIV> box either. I also had this problem with listbox and drop downs too. What am I missing?
Signed
The very dense developer
Anyway:
I have been trying to put controls such as the Gridview into a <DIV> instead it always positions itself all over the page in absolute placement. The control is bound and I cannot shrink the grid to fit the size of my <DIV> box either. I also had this problem with listbox and drop downs too. What am I missing?
Signed
The very dense developer
•
•
Join Date: Jul 2007
Posts: 25
Reputation:
Rep Power: 2
Solved Threads: 0
Do you know any CSS?
I haven't had too much experience with Microsoft's AJAX framework, but if you're dealing with div tags then you could resize those via CSS.
All you have to do is give the div tag an id or class(if you're going to use the same one more than onece). Something like this should work:
Then create an external CSS file(either in vs or your editor of choice) and insert the following code into it:
Save that as mainstyle.css into the directory your aspx page is in.
then in your aspx pages , insert this into the head tags:
You can change the href to match the location of your CSS file as if it was regular hypertext link.
The above code should change the size of your div tag which should influence the size of your grid control.
Or you can insert CssClass="gridview" into your grid view control asp tag.
then change the external style sheet that you just made from above to .gridview not #gridview
Alternatively you can also insert an inline style such as style="width:100px; height:100px;" into your div tag. l
For example:
<div style="width:100px; height:100px;"></div>
This changes the size of the div without using an external stylesheet that I just written above.
Also, the official site for Microsoft's AJAX framework offers excellent video tutorials on the same thing:
http://asp.net/learn/ajax-videos/
I haven't had too much experience with Microsoft's AJAX framework, but if you're dealing with div tags then you could resize those via CSS.
All you have to do is give the div tag an id or class(if you're going to use the same one more than onece). Something like this should work:
html Syntax (Toggle Plain Text)
<div id="gridview"> asp grid control here. </div>
Then create an external CSS file(either in vs or your editor of choice) and insert the following code into it:
css Syntax (Toggle Plain Text)
#gridview{ height:100px;/*change this to get the your ideal height in pixels*/ width:100px;/*change this to get the your ideal width in pixels*/ }
Save that as mainstyle.css into the directory your aspx page is in.
then in your aspx pages , insert this into the head tags:
html Syntax (Toggle Plain Text)
<link href="mainstyle.css" rel="stylesheet" type="text/css" media="all" />
You can change the href to match the location of your CSS file as if it was regular hypertext link.
The above code should change the size of your div tag which should influence the size of your grid control.
Or you can insert CssClass="gridview" into your grid view control asp tag.
then change the external style sheet that you just made from above to .gridview not #gridview
Alternatively you can also insert an inline style such as style="width:100px; height:100px;" into your div tag. l
For example:
<div style="width:100px; height:100px;"></div>
This changes the size of the div without using an external stylesheet that I just written above.
Also, the official site for Microsoft's AJAX framework offers excellent video tutorials on the same thing:
http://asp.net/learn/ajax-videos/
![]() |
•
•
•
•
•
•
•
•
DaniWeb ASP.NET Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- Previous Thread: i want to make video conference using ASP.NET & C#.
- Next Thread: editing Rows of the gridview, which is bounded with DataTable



Linear Mode