2 Replies - 4580 Views - Last Post: 08 October 2010 - 04:59 AM Rate Topic: -----

#1 snufse  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 13-May 08

Panel Scroll Attribute

Posted 06 October 2010 - 04:11 PM

I applied Panel horizontal scroll to my application. I did so in the code behind since I did not want to show the "scroll slider" till I had filled the GridView. It was working fine.

mySqlDataAdapter.Fill(mySqlDataTable7)
            Session("mySqlDataTable7") = mySqlDataTable7

            GridView7.DataSource = mySqlDataTable7
            GridView7.DataBind()

            Button9.Visible = True

            Panel12.Attributes.Add("ScrollBars", "Horizontal")
            Panel12.Style.Add("overflow", "scroll")





<asp:Panel ID="Panel12" runat="server" CssClass="panellayout" Style="top: 60px; height: 201px; width: 518px; left: 2px; border: none">
                                
<asp:GridView ID="GridView7" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" BorderColor="LightGray" BorderStyle="None" CellSpacing="2" CssClass="gridviewlayout1" EmptyDataText="No Records Found" Font-Size="X-Small" Height="19px" HorizontalAlign="Left" PageSize="5" ShowFooter="True" Style="overflow: hidden;
clip: rect(auto auto auto auto); left: 3px; position: absolute; top: 5px" Width="700px">

<Columns>
 <asp:BoundField DataField="job_number" HeaderText="Job" Eession="job_number">
   <ItemStyle HorizontalAlign="Left" Width="1%" />
 </asp:BoundField>
 <asp:BoundField DataField="job_name" HeaderText="Name"    SortExpression="job_name">
<ItemStyle HorizontalAlign="Left" Width="25%" />
                                        
<ItemStyle HorizontalAlign="Right" Width="5%" />
 <FooterStyle HorizontalAlign="Right" Width="5%" />
 /Columns>
 <HeaderStyle BackColor="#FFC080" Height="25px" />
 AlternatingRowStyle BackColor="#FFFFC0" />
 <RowStyle Height="20px" Wrap="False" />
 <PagerStyle BackColor="#E0E0E0" Height="20px" />
 <EmptyDataRowStyle ForeColor="ActiveCaption" Height="20px" />
 <FooterStyle BackColor="#FF8080" Height="20px" HorizontalAlign="Right" />
</asp:GridView>

</ContentTemplate>
</asp:UpdatePanel>
</asp:Panel>




Now I have added UpdatePanel and UpdateProgress to my Gridview and the Panel horizontal scroll does not show and the GridView columns run outside the Panel.

Modified mark up code:


<asp:Panel ID="Panel12" runat="server" CssClass="panellayout" Style="top: 60px; height: 201px; width: 518px; left: 2px; border: none">

<asp:UpdatePanel ID="UpdatePanel99" runat="server" UpdateMode="Conditional">
  <Triggers>
   <asp:AsyncPostBackTrigger ControlID="DropDownList8" EventName="SelectedIndexChanged" />
  </Triggers>
    <ContentTemplate>
      <asp:UpdateProgress ID="UpdateProgress99" runat="server" DynamicLayout="false">
       <ProgressTemplate>
        <br />
        <asp:Image ID="Image01" runat="server" ImageUrl="Icons/ajax-loadergif" />
        <asp:Label ID="Label01" runat="server" CssClass="labellayout6" Text="Loading data...."></asp:Label>
       </ProgressTemplate>
   </asp:UpdateProgress>    
                                    <asp:GridView ID="GridView7" runat="server" AllowPaging="True" AllowSorting="True"
                                            AutoGenerateColumns="False" BorderColor="LightGray" BorderStyle="None" CellSpacing="2"
                                            CssClass="gridviewlayout1" EmptyDataText="No Records Found" Font-Size="X-Small"
                                            Height="19px" HorizontalAlign="Left" PageSize="5" ShowFooter="True" Style="overflow: hidden;
                                            clip: rect(auto auto auto auto); left: 3px; position: absolute; top: 5px" Width="700px">
                                    <Columns>
                                        <asp:BoundField DataField="job_number" HeaderText="Job" SortExpression="job_number">
                                            <ItemStyle HorizontalAlign="Left" Width="1%" />
                                        </asp:BoundField>
                                        <asp:BoundField DataField="job_name" HeaderText="Name" SortExpression="job_name">
                                            <ItemStyle HorizontalAlign="Left" Width="25%" />
                                        
                                            <ItemStyle HorizontalAlign="Right" Width="5%" />
                                            <FooterStyle HorizontalAlign="Right" Width="5%" />
                                     /Columns>
                                    <HeaderStyle BackColor="#FFC080" Height="25px" />
                                    <AlternatingRowStyle BackColor="#FFFFC0" />
                                    <RowStyle Height="20px" Wrap="False" />
                                    <PagerStyle BackColor="#E0E0E0" Height="20px" />
                                    <EmptyDataRowStyle ForeColor="ActiveCaption" Height="20px" />
                                    <FooterStyle BackColor="#FF8080" Height="20px" HorizontalAlign="Right" />
                                </asp:GridView>
                              </ContentTemplate>
                                </asp:UpdatePanel>                            </asp:Panel>



Anyone know how to get around this. I could put the Panel scroll attribute in the mark up code and it works this way, but it does not give the right "touch and feel" when the GridView is empty the first time (I prefer not see the scroll attribute till I have filled the GridView the 1st time).

This post has been edited by snufse: 06 October 2010 - 04:24 PM


Is This A Good Question/Topic? 0
  • +

Replies To: Panel Scroll Attribute

#2 Jayman  Icon User is offline

  • Student of Life
  • member icon

Reputation: 418
  • View blog
  • Posts: 9,532
  • Joined: 26-December 05

Re: Panel Scroll Attribute

Posted 06 October 2010 - 06:55 PM

Put the Panel inside the UpdatePanel.

It is not showing, because only the content inside the UpdatePanel is refreshing. Anything outside the UpdatePanel is static and will not change.
Was This Post Helpful? 1
  • +
  • -

#3 snufse  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 13-May 08

Re: Panel Scroll Attribute

Posted 08 October 2010 - 04:59 AM

Hi Jayman,

That helped. Thank you.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1