Gridview width 100% not working inside UpdatePanel in Design mode for VWD 2008 Express

Last post 06-24-2009 10:03 AM by MinimalTech. 4 replies.

Sort Posts:

  • Gridview width 100% not working inside UpdatePanel in Design mode for VWD 2008 Express

    06-23-2009, 12:12 PM
    • Member
      1 point Member
    • tjg417
    • Member since 09-13-2002, 3:43 PM
    • Birmingham, AL
    • Posts 13

    I have a Gridview which I want to completely fill the <td> cell its in.  Without the UpdatePanel I can set the GridView's width to 100% and it works but once inside the UpdatePanel then it overruns the whole page in the design mode of VWD 2008 Express.  Any ideas what's wrong?

    Jay Gamblin
  • Re: Gridview width 100% not working inside UpdatePanel in Design mode for VWD 2008 Express

    06-23-2009, 5:37 PM
    • Member
      239 point Member
    • MinimalTech
    • Member since 01-19-2009, 7:22 AM
    • Greece
    • Posts 174

     Hi,

    can you post some code / example to see your problem?

    You mean that inside the update panel your GridView overflows the page's 100% width or it is smaller?

    This is happens in the VWD Designer or at runtime (for ex. in internet explorer)?

    Please, mark this post as "Answer" if it helped you solve your problem.

    MinimalTech.
  • Re: Gridview width 100% not working inside UpdatePanel in Design mode for VWD 2008 Express

    06-24-2009, 9:27 AM
    • Member
      1 point Member
    • tjg417
    • Member since 09-13-2002, 3:43 PM
    • Birmingham, AL
    • Posts 13

     Here is my code for my UpdatePanel and GridView

                    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                        <ContentTemplate>
                            <asp:GridView ID="GVEmplyees" runat="server" AllowSorting="True" AutoGenerateColumns="False"
                                DataSourceID="OSDEmployees" Width="100%">
                                <Columns>
                                    <asp:BoundField DataField="Name" HeaderText="Name" ReadOnly="True" SortExpression="Name" />
                                    <asp:BoundField DataField="JOBTITLE" HeaderText="Title" SortExpression="JOBTITLE" />
                                </Columns>
                            </asp:GridView>
                        </ContentTemplate>
                    </asp:UpdatePanel>
    


    It renders properly on screen using IE.  However it is extremely long in the Design view of VWD 2008 Express.  I have a master page with the ScriptManager in it.  Then this is in my content page.  If I specify a width in px (i.e. 300px) then it renders it correctly in both.  Its not happy with a percentage like 100% or even 50%.

    Jay Gamblin
  • Re: Gridview width 100% not working inside UpdatePanel in Design mode for VWD 2008 Express

    06-24-2009, 9:43 AM
    • Member
      121 point Member
    • 1Madhu
    • Member since 02-06-2009, 7:51 AM
    • India
    • Posts 36

    Hi,

    What I understood is... you want gridview width should be horizontally scrollable if its width is exceed then the page width.

    For that just place gridview under the DIV and set the width for div is 100%.

    <asp:UpdatePanel ID="UpdatePanel1" runat="server">  
        <ContentTemplate>  
          <div style="LEFT: 1%; OVERFLOW: scroll; WIDTH: 98%; POSITION: absolute; 26%; HEIGHT: 26%" id="myDiv43">
            <asp:GridView ID="GVEmplyees" runat="server" AllowSorting="True" AutoGenerateColumns="False"  
                DataSourceID="OSDEmployees" Width="100%">  
                <Columns>  
                    <asp:BoundField DataField="Name" HeaderText="Name" ReadOnly="True" SortExpression="Name" />  
                    <asp:BoundField DataField="JOBTITLE" HeaderText="Title" SortExpression="JOBTITLE" />  
                </Columns>  
            </asp:GridView>  
    </div>
        </ContentTemplate>  
    </asp:UpdatePanel>
    


     

     

     

    Encourage me by Mark as "ANSWER" if above code really help full. Don't forgot to "Report Abuse" in case violates Terms and Conditions

    Regards,
    Madhu,India
  • Re: Gridview width 100% not working inside UpdatePanel in Design mode for VWD 2008 Express

    06-24-2009, 10:03 AM
    • Member
      239 point Member
    • MinimalTech
    • Member since 01-19-2009, 7:22 AM
    • Greece
    • Posts 174

    In my design view (Visual Studio 2008 Professional with SP-1) and with a width set to 100% the GridView has width equal to the Titles lenght (about 200px).

    With the same setting, the Update Panel has a width of all the Free Space in window in the monitor (100%).


    If i change the GridView's width to 300px, then the GridView goes to 300px and the UpdatePanel has the same behavior

    (has a width of all the Free Space in window in the monitor).


    I think this is a design "bug" in VWD 2008. Search for a service pack or update for your IDE. But that not a functional error.

    You can use it even if has that error and see the results in browser (believe me, it's better in browser. In browser you can see the real view of your design, not in Design view)...

    Please, mark this post as "Answer" if it helped you solve your problem.

    MinimalTech.
Page 1 of 1 (5 items)