CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums

MS SQL 2008 on ASP.NET Hosting
Free 3 Months



Zone: > NEWSGROUP > Asp.Net Forum > general_asp.net.web_parts_and_personalization Tags:
Item Type: NewsGroup Date Entered: 1/18/2006 2:48:47 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 6 Views: 87 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
7 Items, 1 Pages 1 |< << Go >> >|
Nick710
Asp.Net User
Webpart, Scroll Panel and a GridView will not work in harmony when width=100%1/18/2006 2:48:47 PM

0/0

Hello, I?m working on a much larger project, but I?m having trouble with a webpart, scroll panel and a gridview; all working in harmony with width=100% (viewable width of the browser).  What is happening is the Grid View always wants to be full width not allowing the scroll bars to work causing ie?s scroll at the bottom to come on because it is much larger than 100% of the browsers width. This only happens when the panel is placed in to a webpart. If the panel was outside the webpart it works perfectly. Is this a problem with webparts?  I would also like to maintain scrolled position, I don?t know if that changes the situation. I?ve included a small test program called: TestScroll.aspx  for anyone that would like to take a stab at my problem. I greatly appreciate all who are trying to help me out, Thanks in advance.
-Nick

<%--TestScroll.aspx--%>
<%@ Page Language="VB" %>
<%@ Import Namespace=System.Data %>

<script runat="server">
  Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    GridView1.DataSource = GeneratetTable()
    GridView1.DataBind()
  End Sub

  Function GeneratetTable() As DataTable
    Dim dt As New DataTable
    dt.Columns.Add(New DataColumn("Column_1", GetType(String)))
    dt.Columns.Add(New DataColumn("Column_2", GetType(String)))
    dt.Columns.Add(New DataColumn("Column_3", GetType(String)))
    Dim dr As DataRow
    dr = dt.NewRow()
    dr("Column_1") = "A"
    dr("Column_2") = "B"
    dr("Column_3") = "C"
    dt.Rows.Add(dr)
    dr = dt.NewRow()
    dr("Column_1") = "E"
    dr("Column_2") = "F"
    dr("Column_3") = "G"
    dt.Rows.Add(dr)
    Return dt
  End Function
</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
</head>
<body>
  <form id="form1" runat="server">
    <asp:WebPartManager ID="WebPartManager1" runat="server">
    </asp:WebPartManager>
    <asp:WebPartZone ID="WebPartZone1" runat="server" Width="100%">
      <ZoneTemplate>
        <asp:Panel ID="Panel1" Title="Test Grid" ScrollBars="Auto" Height="100" runat="server">
        <%--<div style="overflow:auto;width:100%;height:250px;">--%>
          <asp:GridView ID="GridView1" runat="server" GridLines="Vertical" AutoGenerateColumns="false">
            <Columns>
              <asp:TemplateField HeaderText="Column 1" ItemStyle-HorizontalAlign="Center" ControlStyle-Width="300px">
                <ItemTemplate>
                  <asp:TextBox ID="tbColumn_1" runat="server" Text='<%# Bind("Column_1")%>' Wrap="false" />
                </ItemTemplate>
              </asp:TemplateField>
              <asp:TemplateField HeaderText="Column 2" ItemStyle-HorizontalAlign="Center" ControlStyle-Width="300px">
                <ItemTemplate>
                  <asp:TextBox ID="tbColumn_2" runat="server" Text='<%# Bind("Column_2")%>' Wrap="false" />
                </ItemTemplate>
              </asp:TemplateField>
              <asp:TemplateField HeaderText="Column 3" ItemStyle-HorizontalAlign="Center" ControlStyle-Width="300px">
                <ItemTemplate>
                  <asp:TextBox ID="tbColumn_3" runat="server" Text='<%# Bind("Column_3")%>' Wrap="false" />
                </ItemTemplate>
              </asp:TemplateField>
            </Columns>
          </asp:GridView>
        <%--</div>--%>
        </asp:Panel>
        <asp:Panel ID="Panel2" Title="Empty Panel One" runat="server" Height="50px">
        </asp:Panel>
        <asp:Panel ID="Panel3" Title="Empty Panel Two" runat="server" Height="50px">
        </asp:Panel>
      </ZoneTemplate>
    </asp:WebPartZone>
  </form>
</body>
</html>

mosessaur
Asp.Net User
Re: Webpart, Scroll Panel and a GridView will not work in harmony when width=100%1/18/2006 4:40:46 PM

0/0

I think this is because you set the width of your WebPartZone to 100%
<asp:WebPartZone ID="WebPartZone1" runat="server" Width="100%">

Try to set it to fixed with or to less than 100%.

I hope this will work. or put your hand on the problem


Muhammad M. Mosa Soliman
Software Engineer
Blog | Live Space
AndresS
Asp.Net User
Re: Webpart, Scroll Panel and a GridView will not work in harmony when width=100%1/18/2006 7:01:53 PM

0/0

The other issue is that there is style setting "ControlStyle-Width="300px"" in the gridview's colums that will force the bottom scroll bar to display. You might need to remove that setting as well.

thanks

Andres


AndresS


This posting is provided "AS IS" with no warranties, and confers no rights.
Nick710
Asp.Net User
Re: Webpart, Scroll Panel and a GridView will not work in harmony when width=100%1/18/2006 7:48:45 PM

0/0

Andres & Mohammed

Thank you for your reply, I removed "ControlStyle-Width="300px" to see if it helped, it did not. I lowered the width of my WebPartZone to 50%, but it took the full width of the gridview. The idea is that I want the web part to be dynamic and fill the width of the browser, but I want to scroll the gridview inside the webpart. The actual gridview is about 1000px in width and on most people?s computers that is to large not to be scrollable. If the panel was outside of the webpart, it works fine, just when it?s added to the webpart it stops dynamically changing and adding the scroll bar. Any more ideas will be greatly appreciated.

Thanks in advance,

-Nick

mosessaur
Asp.Net User
Re: Webpart, Scroll Panel and a GridView will not work in harmony when width=100%1/18/2006 9:10:53 PM

0/0

The Problem is WebPartZone is rendered as a Table. Overflow with table will not work, the table should embedded inside a DIV.

So my suggestion is, leave your work as is, but set the width for the panel to fixed with, may be you can fine a way to calculate it. but it should not be in perecentage.

<asp:WebPartZone ID="WebPartZone1" runat="server" Width="100%">
      <ZoneTemplate>
<asp:Panel ID="Panel1" Title="Test Grid" ScrollBars="Auto" width="600px" Height="100" runat="server">
        <%--<div style="overflow:auto;width:100%;height:250px;">--%>
          <asp:GridView ID="GridView1" runat="server" GridLines="Vertical" AutoGenerateColumns="false">
            <Columns>

        ......

 

 


Muhammad M. Mosa Soliman
Software Engineer
Blog | Live Space
Nick710
Asp.Net User
Re: Webpart, Scroll Panel and a GridView will not work in harmony when width=100%1/28/2006 1:11:19 AM

0/0

How would i got about calculating it to the size of the browser. If there are example, that would be great!
Thanks again

-Nick

mharder
Asp.Net User
Re: Webpart, Scroll Panel and a GridView will not work in harmony when width=100%1/30/2006 6:59:39 PM

0/0

In JavaScript, you can use document.documentElement.clientWidth to get the width of the browser window.

-Mike

http://blogs.msdn.com/mharder

This posting is provided "AS IS" with no warranties, and confers no rights.
7 Items, 1 Pages 1 |< << Go >> >|


Free Download:


Web:
Webpart, Scroll Panel and a GridView will not work in harmony when ... Webpart, Scroll Panel and a GridView will not work in harmony when width=100%. Last post 01-30-2006 1:59 PM by mharder. 6 replies. ...
VB Helper: Karen Watterson's Archived Destinations and Diversions ... ColumnHeaderCollection.Add method does not work with autosize width in VB.NET. ...... In the next panel, the screen says, "Will work for food. ...
Technology I look forward to what ES-Harmony will bring, and ES-3.1 can’t get here ...... So, FontList.aspx is a barebones page, with a GridView control dropped on it ...
Adobe Flex Development News, Adobe AIR, Flash, Silverlight and ... Spekt IDE will be a great alternative for Flex Builder which also combine the ...... Searches do not leave our server (and are not logged) for 100% privacy. ...
http://kingcrap.com/entry/WPFSilverlight-UI-Framework-Prism-20 ... PostID=1934955&SiteID=1 2008-06-25 daily 0.5 http://work.j832.com/ ...... 0.5 http://www.danielmoth.com/Blog/2008/05/xaml-level-100.html 2008-06-21 daily ...
.NET on Web - Visual C# .NET » Miscellaneous Maintain Scroll Position in Panel, Div. Maintain Scroll position of panel or ...... Use Activator and IConfigurationSectionHandler in perfect harmony to add ...
http://kingcrap.com/entry/WPFSilverlight-UI-Framework-Prism-20 ... PostID=1934955&SiteID=1 2008-06-25 daily 0.5 http://work.j832.com/ ...... 0.5 http://www.danielmoth.com/Blog/2008/05/xaml-level-100.html 2008-06-21 daily ...
.NET on Web - Visual C# .NET » Miscellaneous Maintain Scroll Position in Panel, Div. Maintain Scroll position of panel or ...... Use Activator and IConfigurationSectionHandler in perfect harmony to add ...
http://kingcrap.com/entry/WPFSilverlight-UI-Framework-Prism-20 ... PostID=1934955&SiteID=1 2008-06-25 daily 0.5 http://work.j832.com/ ...... 0.5 http://www.danielmoth.com/Blog/2008/05/xaml-level-100.html 2008-06-21 daily ...
.NET on Web - Visual C# .NET » Miscellaneous Maintain Scroll Position in Panel, Div. Maintain Scroll position of panel or ...... Use Activator and IConfigurationSectionHandler in perfect harmony to add ...




Search This Site:










creating user profiles

errors in sharepoint

webparts without personalizaton db

looping profiles for all users???

masterpage with webpartmanager

how to know if a web part is minimized??

do the changes affect everyone or just the user?

distinguishing pages by querystring

trouble with crystal reports in web parts

my webpart is not properly working except internet explorer....

declarativecatalogpart question

ajax based usercontrol parts

listing profile information

personalisation settings & server related issues

transformers?

web parts add new page

webparst & provider for oracle

problem with webpart and webresource.axd

cannot deserialize the blob of personalization data associated with the current page

drag/drop from catalogzone

how to setup membership role

how to deal with it?

client id not right

can never specify id for dynamically added web parts??

[help]my webpart can't work in iis

<profile> and web.config error

bug report:webpartmanager.deletewarning="" and webpartverbrendermode="titlebar"

webpartconnection

why my dropdownlist doesn't work in webpart?

absolute positioning of webparts in a webpartzone

  Privacy | Contact Us
All Times Are GMT