[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

GridView width and height - ASP.net

Posted on 2006-07-20
4
Medium Priority
?
6,655 Views
Last Modified: 2012-08-13
Hi,

I have got this simple Grid:
            <asp:GridView ID="ExcelGrid" runat="server"  RowStyle-Wrap="false" CellPadding="4" ForeColor="#333333" GridLines="None">
                <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                <RowStyle BackColor="#F7F6F3" ForeColor="#333333" Wrap="False" />
                <EditRowStyle BackColor="#999999" />
                <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
            </asp:GridView>

But when I display the page, it autosizes itself. I want to define width and height for this GridView. If data is more than they will have to scroll left or down to see it.

So how i can set width and height for this grid view.

Regards
0
Comment
Question by:radhakrishan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 6

Expert Comment

by:e1v
ID: 17145088
Gridview have widht and height properties, like

<asp:GridView ID="ExcelGrid" runat="server"  RowStyle-Wrap="false" CellPadding="4" ForeColor="#333333" GridLines="None" Height="300" Width="500">
....
0
 

Author Comment

by:radhakrishan
ID: 17145143
I have tried this, but doesn't seem to work.

GridView still autosizes itself to full width and height (not to what I mentioned).

Any more advise or do you think Im doing anything wrong. I have developed my project by using TIME TRACKER starter kit (available from asp.net website)

Regards
0
 
LVL 6

Expert Comment

by:e1v
ID: 17145215
Sounds like it might be a skinfile or a css stylesheet that overrides your settings (look under the App_Themes folder for .skin files)

Try to view the page without using themes (remove the Theme=".." from the <%@ Page directive)
0
 
LVL 39

Accepted Solution

by:
Pratima Pharande earned 1500 total points
ID: 17145226
Try this with div tag

<div style="height:200px; width:500px; overflow:scroll;"  >
 <asp:GridView ID="ExcelGrid" runat="server"  RowStyle-Wrap="false" CellPadding="4" ForeColor="#333333" GridLines="None">
                <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                <RowStyle BackColor="#F7F6F3" ForeColor="#333333" Wrap="False" />
                <EditRowStyle BackColor="#999999" />
                <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
            </asp:GridView>

</div>

hope this helps u :)
thanx
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have developed many web applications with asp & asp.net and to add and use a dropdownlist was always a very simple task, but with the new asp.net, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question