• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 629
  • Last Modified:

updatepanel sync at the same time when only one button is clicked

i have 2 gridviews in separate update panels, and the btnSearchTopic is the trigger for updatepanel1, but once i click the btnSearchTopic, both gridviews show progress at the same time and i tot it should be only updatepanel1 showing the progress.

the purpose i place the javascript with sys namespace is to show the progress in the middle of the gridview.

<asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <Triggers>
        <asp:AsyncPostBackTrigger ControlID="btnSearchTopic" EventName="Click" />
            </Triggers>
            <ContentTemplate>
<script type="text/javascript">

         var prm = Sys.WebForms.PageRequestManager.getInstance();
         prm.add_initializeRequest(prm_InitializeRequest);
         prm.add_endRequest(prm_EndRequest);

         function prm_EndRequest(sender, args) {

             var panelProg = $get('pnlPopup');
             panelProg.style.display = 'none';

         }

         function prm_InitializeRequest(sender, args) {

             var panelProg = $get('pnlPopup');
             panelProg.style.display = 'block';
             var gridView = $get('<%= gvTopics.ClientID %>');
             var gridViewBounds = Sys.UI.DomElement.getBounds(gridView);
             var updateProgressDivBounds = Sys.UI.DomElement.getBounds(panelProg);
             var x = gridViewBounds.x + Math.round(gridViewBounds.width / 2) - Math.round(updateProgressDivBounds.width / 2);
             var y = gridViewBounds.y + Math.round(gridViewBounds.height / 2) - Math.round(updateProgressDivBounds.height / 2);
             Sys.UI.DomElement.setLocation(panelProg, x, y);
         }

         var prm1 = Sys.WebForms.PageRequestManager.getInstance();
         prm1.add_initializeRequest(prm1_InitializeRequest);
         prm1.add_endRequest(prm1_EndRequest);

         function prm1_EndRequest(sender, args) {

             var panelProg1 = $get('pnlPopup1');
             panelProg1.style.display = 'none';

         }

         function prm1_InitializeRequest(sender, args) {

             var panelProg1 = $get('pnlPopup1');
             panelProg1.style.display = 'block';
             var gridView = $get('<%= gvLS.ClientID %>');
             var gridViewBounds = Sys.UI.DomElement.getBounds(gridView);
             var updateProgressDivBounds = Sys.UI.DomElement.getBounds(panelProg1);
             var x = gridViewBounds.x + Math.round(gridViewBounds.width / 2) - Math.round(updateProgressDivBounds.width / 2);
             var y = gridViewBounds.y + Math.round(gridViewBounds.height / 2) - Math.round(updateProgressDivBounds.height / 2);
             Sys.UI.DomElement.setLocation(panelProg1, x, y);
         }

    </script>
    
...


            <asp:UpdateProgress ID="UpdateProgress" runat="server" AssociatedUpdatePanelID="UpdatePanel1">
            <ProgressTemplate>
            </ProgressTemplate>
        </asp:UpdateProgress>

        
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <Triggers>
        <asp:AsyncPostBackTrigger ControlID="btnSearchTopic" EventName="Click" />
            </Triggers>
            <ContentTemplate>
            <asp:Label ID="lblSearchTopicError" runat="server" ForeColor="Red" Visible="false" Text="Search Not Found."></asp:Label>
             <asp:GridView ID="gvTopics" runat="server" 
        AutoGenerateColumns="False" AllowPaging="True" CssClass="datatable"
                    CellPadding="5" BorderWidth="1px" BorderColor="#6E6E6E" 
                 Font-Names="Arial" Font-Size="Small" 
                PageSize="5" GridLines="None" AlternatingRowStyle-BackColor="#efefef" 
            Width="900px" 
                 HeaderStyle-HorizontalAlign="Left" 
            AllowSorting="True" onpageindexchanged="gvTopics_PageIndexChanged" 
                    onpageindexchanging="gvTopics_PageIndexChanging" onsorting="gvTopics_Sorting"  >
                    <HeaderStyle BackColor="#BDBDBD" />
                    <Columns>
                        
                        <asp:HyperLinkField ControlStyle-ForeColor="Black" DataNavigateUrlFields="id" DataNavigateUrlFormatString="topics.aspx?TopicID={0}&TopicItemDelete=Y" Text="Delete" runat="server">
<ControlStyle ForeColor="Black"></ControlStyle>
                        </asp:HyperLinkField> 
                            
                            <asp:BoundField HeaderText="Level Subject ID" DataField="level_subject_id" SortExpression="level_subject_id" HeaderStyle-ForeColor="Black"
                            HeaderStyle-CssClass="first" ItemStyle-CssClass="first" ReadOnly="True"  HeaderStyle-HorizontalAlign="Left"  ItemStyle-HorizontalAlign="Left">
<HeaderStyle CssClass="first" ForeColor="Black"></HeaderStyle>

<ItemStyle CssClass="first"></ItemStyle>
                        </asp:BoundField>

                            <asp:BoundField HeaderText="Topic Code" DataField="code" SortExpression="code" HeaderStyle-ForeColor="Black"
                            HeaderStyle-CssClass="first" ItemStyle-CssClass="first" ReadOnly="True"  HeaderStyle-HorizontalAlign="Left"  ItemStyle-HorizontalAlign="Left">
<HeaderStyle CssClass="first" ForeColor="Black"></HeaderStyle>

<ItemStyle CssClass="first"></ItemStyle>
                        </asp:BoundField>
                                                
                       <asp:BoundField HeaderText="Topic Name" DataField="name" SortExpression="name" HeaderStyle-ForeColor="Black"
                            HeaderStyle-CssClass="first" ItemStyle-CssClass="first" ReadOnly="True"  HeaderStyle-HorizontalAlign="Left"  ItemStyle-HorizontalAlign="Left">
<HeaderStyle CssClass="first" ForeColor="Black"></HeaderStyle>

<ItemStyle CssClass="first"></ItemStyle>
                        </asp:BoundField>
                        <asp:BoundField HeaderText="Created By" DataField="createby" SortExpression="createby" HeaderStyle-ForeColor="Black"
                            HeaderStyle-CssClass="first" ItemStyle-CssClass="first" ReadOnly="True"  HeaderStyle-HorizontalAlign="Left"  ItemStyle-HorizontalAlign="Left">
<HeaderStyle CssClass="first" ForeColor="Black"></HeaderStyle>

<ItemStyle CssClass="first"></ItemStyle>
                        </asp:BoundField>

                        <asp:BoundField HeaderText="Date Created" DataField="datecreate" SortExpression="datecreate" HeaderStyle-ForeColor="Black"
                            HeaderStyle-CssClass="first" ItemStyle-CssClass="first" ReadOnly="True"  HeaderStyle-HorizontalAlign="Left"  ItemStyle-HorizontalAlign="Left">
<HeaderStyle CssClass="first" ForeColor="Black"></HeaderStyle>

<ItemStyle CssClass="first"></ItemStyle>
                        </asp:BoundField>

                        <asp:BoundField HeaderText="Updated By" DataField="updateby" SortExpression="updateby" HeaderStyle-ForeColor="Black"
                            HeaderStyle-CssClass="first" ItemStyle-CssClass="first" ReadOnly="True"  HeaderStyle-HorizontalAlign="Left"  ItemStyle-HorizontalAlign="Left">
<HeaderStyle CssClass="first" ForeColor="Black"></HeaderStyle>

<ItemStyle CssClass="first"></ItemStyle>
                        </asp:BoundField>

                        <asp:BoundField HeaderText="Updated Date" DataField="dateupdate" SortExpression="dateupdate" HeaderStyle-ForeColor="Black"
                            HeaderStyle-CssClass="first" ItemStyle-CssClass="first" ReadOnly="True"  HeaderStyle-HorizontalAlign="Left"  ItemStyle-HorizontalAlign="Left">
<HeaderStyle CssClass="first" ForeColor="Black"></HeaderStyle>

<ItemStyle CssClass="first"></ItemStyle>
                        </asp:BoundField>
                                    
                        
                         <asp:HyperLinkField ControlStyle-ForeColor="Black" DataNavigateUrlFields="id" DataNavigateUrlFormatString="topics.aspx?TopicID={0}&TopicUpdate=Y" Text="Edit" runat="server">
<ControlStyle ForeColor="Black"></ControlStyle>
                        </asp:HyperLinkField> 
                              
                    
                    </Columns>
        
                         </asp:GridView>

                           <asp:Panel ID="pnlPopup" runat="server" CssClass="progress" style="display:none;">
                <div class="container">
                    <div class="header">Loading, please wait...</div>
                    <div class="progressbody">
                        <asp:Image ID="Image1" imageid="imageprogress01" ImageUrl="~/images/activity.gif" runat="server" />
                    </div>
                </div>
            </asp:Panel>
                         
        </ContentTemplate>
        </asp:UpdatePanel>

..

 <asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel2">
            <ProgressTemplate>
            </ProgressTemplate>
        </asp:UpdateProgress>

        
        <asp:UpdatePanel ID="UpdatePanel2" runat="server">
        <Triggers>
        <asp:AsyncPostBackTrigger ControlID="btnSearchLS" EventName="Click" />
            </Triggers>
            <ContentTemplate>

            <asp:Label ID="lblSearchLSError" runat="server" ForeColor="Red" Visible="false" 
                    Text="Search Not Found."></asp:Label>
             <asp:GridView ID="gvLS" runat="server" 
        AutoGenerateColumns="False" AllowPaging="True" CssClass="datatable"
                    CellPadding="5" BorderWidth="1px" BorderColor="#6E6E6E" 
                 Font-Names="Arial" Font-Size="Small" 
                PageSize="5" GridLines="None" AlternatingRowStyle-BackColor="#efefef" 
            Width="900px" 
                 HeaderStyle-HorizontalAlign="Left" 
            AllowSorting="True" onpageindexchanged="gvLS_PageIndexChanged" 
                    onpageindexchanging="gvLS_PageIndexChanging" onsorting="gvLS_Sorting"  >
                    <HeaderStyle BackColor="#BDBDBD" />
                    <Columns>
                        
                        
                            
                            <asp:BoundField HeaderText="Level ID" DataField="level_id" 
                            SortExpression="level_id" HeaderStyle-ForeColor="Black"
                            HeaderStyle-CssClass="first" ItemStyle-CssClass="first" ReadOnly="True"  
                            HeaderStyle-HorizontalAlign="Left"  ItemStyle-HorizontalAlign="Left">
<HeaderStyle CssClass="first" ForeColor="Black"></HeaderStyle>

<ItemStyle CssClass="first"></ItemStyle>
                        </asp:BoundField>

                            <asp:BoundField HeaderText="Subject ID" DataField="subject_id" 
                            SortExpression="subject_id" HeaderStyle-ForeColor="Black"
                            HeaderStyle-CssClass="first" ItemStyle-CssClass="first" ReadOnly="True"  
                            HeaderStyle-HorizontalAlign="Left"  ItemStyle-HorizontalAlign="Left">
<HeaderStyle CssClass="first" ForeColor="Black"></HeaderStyle>

<ItemStyle CssClass="first"></ItemStyle>
                        </asp:BoundField>
                                                
                       <asp:BoundField HeaderText="LS Code" DataField="code" SortExpression="code" HeaderStyle-ForeColor="Black"
                            HeaderStyle-CssClass="first" ItemStyle-CssClass="first" ReadOnly="True"  
                            HeaderStyle-HorizontalAlign="Left"  ItemStyle-HorizontalAlign="Left">
<HeaderStyle CssClass="first" ForeColor="Black"></HeaderStyle>

<ItemStyle CssClass="first"></ItemStyle>
                        </asp:BoundField>
                        <asp:BoundField HeaderText="Description" DataField="description" 
                            SortExpression="description" HeaderStyle-ForeColor="Black"
                            HeaderStyle-CssClass="first" ItemStyle-CssClass="first" ReadOnly="True"  
                            HeaderStyle-HorizontalAlign="Left"  ItemStyle-HorizontalAlign="Left">
<HeaderStyle CssClass="first" ForeColor="Black"></HeaderStyle>

<ItemStyle CssClass="first"></ItemStyle>
                        </asp:BoundField>

                        <asp:BoundField HeaderText="Created By" DataField="createby" 
                            SortExpression="createby" HeaderStyle-ForeColor="Black"
                            HeaderStyle-CssClass="first" ItemStyle-CssClass="first" ReadOnly="True"  
                            HeaderStyle-HorizontalAlign="Left"  ItemStyle-HorizontalAlign="Left">
<HeaderStyle CssClass="first" ForeColor="Black"></HeaderStyle>

<ItemStyle CssClass="first"></ItemStyle>
                        </asp:BoundField>

                        <asp:BoundField HeaderText="Date Created" DataField="datecreate" 
                            SortExpression="datecreate" HeaderStyle-ForeColor="Black"
                            HeaderStyle-CssClass="first" ItemStyle-CssClass="first" ReadOnly="True"  
                            HeaderStyle-HorizontalAlign="Left"  ItemStyle-HorizontalAlign="Left">
<HeaderStyle CssClass="first" ForeColor="Black"></HeaderStyle>

<ItemStyle CssClass="first"></ItemStyle>
                        </asp:BoundField>

                        <asp:BoundField HeaderText="Updated By" DataField="updateby" 
                            SortExpression="updateby" HeaderStyle-ForeColor="Black"
                            HeaderStyle-CssClass="first" ItemStyle-CssClass="first" ReadOnly="True"  
                            HeaderStyle-HorizontalAlign="Left"  ItemStyle-HorizontalAlign="Left">
<HeaderStyle CssClass="first" ForeColor="Black"></HeaderStyle>

<ItemStyle CssClass="first"></ItemStyle>
                        </asp:BoundField>

                        <asp:BoundField HeaderText="Updated Date" DataField="dateupdate" 
                            SortExpression="dateupdate" HeaderStyle-ForeColor="Black"
                            HeaderStyle-CssClass="first" ItemStyle-CssClass="first" ReadOnly="True"  
                            HeaderStyle-HorizontalAlign="Left"  ItemStyle-HorizontalAlign="Left">
<HeaderStyle CssClass="first" ForeColor="Black"></HeaderStyle>

<ItemStyle CssClass="first"></ItemStyle>
                        </asp:BoundField>
                     
                    </Columns>
        
                         </asp:GridView>

                          <asp:Panel ID="pnlPopup1" runat="server" CssClass="progress" style="display:none;">
                <div class="container">
                    <div class="header">Loading, please wait...</div>
                    <div class="progressbody">
                        <asp:Image ID="Image2" imageid="imageprogress01" ImageUrl="~/images/activity.gif" runat="server" />
                    </div>
                </div>
            </asp:Panel>
                         
        </ContentTemplate>
        </asp:UpdatePanel>

Open in new window

0
doramail05
Asked:
doramail05
  • 3
  • 2
1 Solution
 
NazoUKCommented:
You should set UpdateMode="Conditional" on the updatepanels you don't want to update all the time.
0
 
doramail05Author Commented:
erm, still the same
0
 
masterpassCommented:
Its is because the add_initializeRequest will be initialized when ever there is an ajax postback .. so you should keep only one of that in a single page

Try the attached code
<script type="text/javascript">

         var prm = Sys.WebForms.PageRequestManager.getInstance();
         prm.add_initializeRequest(prm_InitializeRequest);
         prm.add_endRequest(prm_EndRequest);

         function prm_EndRequest(sender, args) {

             var panelProg = $get('pnlPopup');
             panelProg.style.display = 'none';

         }

         function prm_InitializeRequest(sender, args) {

             var panelProg = $get('pnlPopup');
             panelProg.style.display = 'block';
			 var gridView;
			 var origin = sender._postBackSettings.sourceElement.id;
			 if (origin.match('btnSearchTopic') != null)
                 gridView = $get('<%= gvTopics.ClientID %>');
			 else if (origin.match('btnSearchLS') != null)
				 gridView = $get('<%= gvLS.ClientID %>');
             var gridViewBounds = Sys.UI.DomElement.getBounds(gridView);
             var updateProgressDivBounds = Sys.UI.DomElement.getBounds(panelProg);
             var x = gridViewBounds.x + Math.round(gridViewBounds.width / 2) - Math.round(updateProgressDivBounds.width / 2);
             var y = gridViewBounds.y + Math.round(gridViewBounds.height / 2) - Math.round(updateProgressDivBounds.height / 2);
             Sys.UI.DomElement.setLocation(panelProg, x, y);
         }

    </script>
    
...

       
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <Triggers>
        <asp:AsyncPostBackTrigger ControlID="btnSearchTopic" EventName="Click" />
            </Triggers>
            <ContentTemplate>
            <asp:Label ID="lblSearchTopicError" runat="server" ForeColor="Red" Visible="false" Text="Search Not Found."></asp:Label>
             <asp:GridView ID="gvTopics" runat="server" 
        AutoGenerateColumns="False" AllowPaging="True" CssClass="datatable"
                    CellPadding="5" BorderWidth="1px" BorderColor="#6E6E6E" 
                 Font-Names="Arial" Font-Size="Small" 
                PageSize="5" GridLines="None" AlternatingRowStyle-BackColor="#efefef" 
            Width="900px" 
                 HeaderStyle-HorizontalAlign="Left" 
            AllowSorting="True" onpageindexchanged="gvTopics_PageIndexChanged" 
                    onpageindexchanging="gvTopics_PageIndexChanging" onsorting="gvTopics_Sorting"  >
                    <HeaderStyle BackColor="#BDBDBD" />
                    <Columns>
                        
                        <asp:HyperLinkField ControlStyle-ForeColor="Black" DataNavigateUrlFields="id" DataNavigateUrlFormatString="topics.aspx?TopicID={0}&TopicItemDelete=Y" Text="Delete" runat="server">
<ControlStyle ForeColor="Black"></ControlStyle>
                        </asp:HyperLinkField> 
                            
                            <asp:BoundField HeaderText="Level Subject ID" DataField="level_subject_id" SortExpression="level_subject_id" HeaderStyle-ForeColor="Black"
                            HeaderStyle-CssClass="first" ItemStyle-CssClass="first" ReadOnly="True"  HeaderStyle-HorizontalAlign="Left"  ItemStyle-HorizontalAlign="Left">
<HeaderStyle CssClass="first" ForeColor="Black"></HeaderStyle>

<ItemStyle CssClass="first"></ItemStyle>
                        </asp:BoundField>

                            <asp:BoundField HeaderText="Topic Code" DataField="code" SortExpression="code" HeaderStyle-ForeColor="Black"
                            HeaderStyle-CssClass="first" ItemStyle-CssClass="first" ReadOnly="True"  HeaderStyle-HorizontalAlign="Left"  ItemStyle-HorizontalAlign="Left">
<HeaderStyle CssClass="first" ForeColor="Black"></HeaderStyle>

<ItemStyle CssClass="first"></ItemStyle>
                        </asp:BoundField>
                                                
                       <asp:BoundField HeaderText="Topic Name" DataField="name" SortExpression="name" HeaderStyle-ForeColor="Black"
                            HeaderStyle-CssClass="first" ItemStyle-CssClass="first" ReadOnly="True"  HeaderStyle-HorizontalAlign="Left"  ItemStyle-HorizontalAlign="Left">
<HeaderStyle CssClass="first" ForeColor="Black"></HeaderStyle>

<ItemStyle CssClass="first"></ItemStyle>
                        </asp:BoundField>
                        <asp:BoundField HeaderText="Created By" DataField="createby" SortExpression="createby" HeaderStyle-ForeColor="Black"
                            HeaderStyle-CssClass="first" ItemStyle-CssClass="first" ReadOnly="True"  HeaderStyle-HorizontalAlign="Left"  ItemStyle-HorizontalAlign="Left">
<HeaderStyle CssClass="first" ForeColor="Black"></HeaderStyle>

<ItemStyle CssClass="first"></ItemStyle>
                        </asp:BoundField>

                        <asp:BoundField HeaderText="Date Created" DataField="datecreate" SortExpression="datecreate" HeaderStyle-ForeColor="Black"
                            HeaderStyle-CssClass="first" ItemStyle-CssClass="first" ReadOnly="True"  HeaderStyle-HorizontalAlign="Left"  ItemStyle-HorizontalAlign="Left">
<HeaderStyle CssClass="first" ForeColor="Black"></HeaderStyle>

<ItemStyle CssClass="first"></ItemStyle>
                        </asp:BoundField>

                        <asp:BoundField HeaderText="Updated By" DataField="updateby" SortExpression="updateby" HeaderStyle-ForeColor="Black"
                            HeaderStyle-CssClass="first" ItemStyle-CssClass="first" ReadOnly="True"  HeaderStyle-HorizontalAlign="Left"  ItemStyle-HorizontalAlign="Left">
<HeaderStyle CssClass="first" ForeColor="Black"></HeaderStyle>

<ItemStyle CssClass="first"></ItemStyle>
                        </asp:BoundField>

                        <asp:BoundField HeaderText="Updated Date" DataField="dateupdate" SortExpression="dateupdate" HeaderStyle-ForeColor="Black"
                            HeaderStyle-CssClass="first" ItemStyle-CssClass="first" ReadOnly="True"  HeaderStyle-HorizontalAlign="Left"  ItemStyle-HorizontalAlign="Left">
<HeaderStyle CssClass="first" ForeColor="Black"></HeaderStyle>

<ItemStyle CssClass="first"></ItemStyle>
                        </asp:BoundField>
                                    
                        
                         <asp:HyperLinkField ControlStyle-ForeColor="Black" DataNavigateUrlFields="id" DataNavigateUrlFormatString="topics.aspx?TopicID={0}&TopicUpdate=Y" Text="Edit" runat="server">
<ControlStyle ForeColor="Black"></ControlStyle>
                        </asp:HyperLinkField> 
                              
                    
                    </Columns>
        
                         </asp:GridView>

                           <asp:Panel ID="pnlPopup" runat="server" CssClass="progress" style="display:none;">
                <div class="container">
                    <div class="header">Loading, please wait...</div>
                    <div class="progressbody">
                        <asp:Image ID="Image1" imageid="imageprogress01" ImageUrl="~/images/activity.gif" runat="server" />
                    </div>
                </div>
            </asp:Panel>
                         
        </ContentTemplate>
        </asp:UpdatePanel>

..

      
        <asp:UpdatePanel ID="UpdatePanel2" runat="server">
        <Triggers>
        <asp:AsyncPostBackTrigger ControlID="btnSearchLS" EventName="Click" />
            </Triggers>
            <ContentTemplate>

            <asp:Label ID="lblSearchLSError" runat="server" ForeColor="Red" Visible="false" 
                    Text="Search Not Found."></asp:Label>
             <asp:GridView ID="gvLS" runat="server" 
        AutoGenerateColumns="False" AllowPaging="True" CssClass="datatable"
                    CellPadding="5" BorderWidth="1px" BorderColor="#6E6E6E" 
                 Font-Names="Arial" Font-Size="Small" 
                PageSize="5" GridLines="None" AlternatingRowStyle-BackColor="#efefef" 
            Width="900px" 
                 HeaderStyle-HorizontalAlign="Left" 
            AllowSorting="True" onpageindexchanged="gvLS_PageIndexChanged" 
                    onpageindexchanging="gvLS_PageIndexChanging" onsorting="gvLS_Sorting"  >
                    <HeaderStyle BackColor="#BDBDBD" />
                    <Columns>
                        
                        
                            
                            <asp:BoundField HeaderText="Level ID" DataField="level_id" 
                            SortExpression="level_id" HeaderStyle-ForeColor="Black"
                            HeaderStyle-CssClass="first" ItemStyle-CssClass="first" ReadOnly="True"  
                            HeaderStyle-HorizontalAlign="Left"  ItemStyle-HorizontalAlign="Left">
<HeaderStyle CssClass="first" ForeColor="Black"></HeaderStyle>

<ItemStyle CssClass="first"></ItemStyle>
                        </asp:BoundField>

                            <asp:BoundField HeaderText="Subject ID" DataField="subject_id" 
                            SortExpression="subject_id" HeaderStyle-ForeColor="Black"
                            HeaderStyle-CssClass="first" ItemStyle-CssClass="first" ReadOnly="True"  
                            HeaderStyle-HorizontalAlign="Left"  ItemStyle-HorizontalAlign="Left">
<HeaderStyle CssClass="first" ForeColor="Black"></HeaderStyle>

<ItemStyle CssClass="first"></ItemStyle>
                        </asp:BoundField>
                                                
                       <asp:BoundField HeaderText="LS Code" DataField="code" SortExpression="code" HeaderStyle-ForeColor="Black"
                            HeaderStyle-CssClass="first" ItemStyle-CssClass="first" ReadOnly="True"  
                            HeaderStyle-HorizontalAlign="Left"  ItemStyle-HorizontalAlign="Left">
<HeaderStyle CssClass="first" ForeColor="Black"></HeaderStyle>

<ItemStyle CssClass="first"></ItemStyle>
                        </asp:BoundField>
                        <asp:BoundField HeaderText="Description" DataField="description" 
                            SortExpression="description" HeaderStyle-ForeColor="Black"
                            HeaderStyle-CssClass="first" ItemStyle-CssClass="first" ReadOnly="True"  
                            HeaderStyle-HorizontalAlign="Left"  ItemStyle-HorizontalAlign="Left">
<HeaderStyle CssClass="first" ForeColor="Black"></HeaderStyle>

<ItemStyle CssClass="first"></ItemStyle>
                        </asp:BoundField>

                        <asp:BoundField HeaderText="Created By" DataField="createby" 
                            SortExpression="createby" HeaderStyle-ForeColor="Black"
                            HeaderStyle-CssClass="first" ItemStyle-CssClass="first" ReadOnly="True"  
                            HeaderStyle-HorizontalAlign="Left"  ItemStyle-HorizontalAlign="Left">
<HeaderStyle CssClass="first" ForeColor="Black"></HeaderStyle>

<ItemStyle CssClass="first"></ItemStyle>
                        </asp:BoundField>

                        <asp:BoundField HeaderText="Date Created" DataField="datecreate" 
                            SortExpression="datecreate" HeaderStyle-ForeColor="Black"
                            HeaderStyle-CssClass="first" ItemStyle-CssClass="first" ReadOnly="True"  
                            HeaderStyle-HorizontalAlign="Left"  ItemStyle-HorizontalAlign="Left">
<HeaderStyle CssClass="first" ForeColor="Black"></HeaderStyle>

<ItemStyle CssClass="first"></ItemStyle>
                        </asp:BoundField>

                        <asp:BoundField HeaderText="Updated By" DataField="updateby" 
                            SortExpression="updateby" HeaderStyle-ForeColor="Black"
                            HeaderStyle-CssClass="first" ItemStyle-CssClass="first" ReadOnly="True"  
                            HeaderStyle-HorizontalAlign="Left"  ItemStyle-HorizontalAlign="Left">
<HeaderStyle CssClass="first" ForeColor="Black"></HeaderStyle>

<ItemStyle CssClass="first"></ItemStyle>
                        </asp:BoundField>

                        <asp:BoundField HeaderText="Updated Date" DataField="dateupdate" 
                            SortExpression="dateupdate" HeaderStyle-ForeColor="Black"
                            HeaderStyle-CssClass="first" ItemStyle-CssClass="first" ReadOnly="True"  
                            HeaderStyle-HorizontalAlign="Left"  ItemStyle-HorizontalAlign="Left">
<HeaderStyle CssClass="first" ForeColor="Black"></HeaderStyle>

<ItemStyle CssClass="first"></ItemStyle>
                        </asp:BoundField>
                     
                    </Columns>
        
                         </asp:GridView>

                          
                         
        </ContentTemplate>
        </asp:UpdatePanel>

Open in new window

0
Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

 
doramail05Author Commented:
when comes to sorting the page, it throw an error pointing :


$type.getBounds = function DomElement$getBounds(element) {
    /// <summary locid="M:J#Sys.UI.DomElement.getBounds">Gets the coordinates, width and height of an element.</summary>
    /// <param name="element" domElement="true"></param>
    /// <returns type="Sys.UI.Bounds">A Bounds object with four fields, x, y, width and height, which contain the pixel coordinates,  width and height of the element.</returns>
    var e = Function._validateParams(arguments, [
        {name: "element", domElement: true}
    ]);
    if (e) throw e;
    var offset = Sys.UI.DomElement.getLocation(element);

    return new Sys.UI.Bounds(offset.x, offset.y, element.offsetWidth || 0, element.offsetHeight || 0);
}


other than that they work fine
untitled55.bmp
0
 
doramail05Author Commented:
i placed a dummy button, btnDummyLS, and let it click on sorting event, so it does trigger the button in the ajax, but cannot work

protected void gvLS_Sorting(object sender, GridViewSortEventArgs e)
    {
        if (!ClientScript.IsStartupScriptRegistered("DummyLS"))
        {
            Page.ClientScript.RegisterStartupScript(this.GetType(), "DummyLS", "clickBtnDummyLS();", true);

        }
function prm_InitializeRequest(sender, args) {

             var panelProg = $get('pnlPopup');
             panelProg.style.display = 'block';
             var gridView;
             var origin = sender._postBackSettings.sourceElement.id;

             if (origin.match('btnDummyLS') != null)
                 gridView = $get('<%= gvLS.ClientID %>');

Open in new window

0
 
masterpassCommented:
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now