Updatepanel and Gridview

Last post 07-31-2006 5:27 AM by jyoti22apr. 11 replies.

Sort Posts:

  • Updatepanel and Gridview

    03-22-2006, 11:42 AM
    • Member
      192 point Member
    • Sianspheric
    • Member since 09-15-2005, 5:25 PM
    • Posts 53

    Hi !

    I'm trying to use Atlas for the first time and i seem to have some problem. I'm juste trying to use paging et sorting without refresh but it doesn't work. I have no error it just doesn't do anything. Here is my code:

    <asp:Content ID="Content1" ContentPlaceHolderID="Contenu" Runat="Server">

    <atlas:ScriptManager ID="sc2" EnablePartialRendering="true" runat="server"/>

    <atlas:UpdatePanel ID="p1" runat="server">

    <ContentTemplate>

    <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True"

    AutoGenerateColumns="False" DataKeyNames="RéfIndis" DataSourceID="dsTest">

    <Columns>

    <asp:BoundField DataField="R&#233;fIndis" HeaderText="R&#233;fIndis" InsertVisible="False"

    ReadOnly="True" SortExpression="R&#233;fIndis" />

    <asp:BoundField DataField="R&#233;fPosteDeCharge" HeaderText="R&#233;fPosteDeCharge"

    SortExpression="R&#233;fPosteDeCharge" />

    <asp:BoundField DataField="R&#233;fMachine" HeaderText="R&#233;fMachine" SortExpression="R&#233;fMachine" />

    <asp:BoundField DataField="DateD&#233;but" HeaderText="DateD&#233;but" SortExpression="DateD&#233;but" />

    <asp:BoundField DataField="DateFin" HeaderText="DateFin" SortExpression="DateFin" />

    <asp:BoundField DataField="Motif" HeaderText="Motif" SortExpression="Motif" />

    </Columns>

    </asp:GridView>

    <asp:SqlDataSource ID="dsTest" runat="server" ConnectionString="<%$ ConnectionStrings:OrchestraCI2K %>"

    SelectCommand="SELECT [RéfIndis], [RéfPosteDeCharge], [RéfMachine], [DateDébut], [DateFin], [Motif] FROM [Indisponibilités Machines]">

    </asp:SqlDataSource>

    </ContentTemplate>

    </atlas:UpdatePanel>

    </asp:Content>

    Did i do some mistakes?

    Thanks!!!

  • Re: Updatepanel and Gridview

    03-22-2006, 1:39 PM
    • Star
      11,530 point Star
    • jcasp
    • Member since 04-10-2003, 10:43 AM
    • Posts 2,286
    It looks okay.  When you say that it's not working, do you mean that it's still posting back (with flicker) or something else?  Also, I noticed that you're using MasterPage.  Did you perhaps do something special in the MasterPage (like using the Atlas features there too)?  I tried a simple example and everything works fine, including when used with MasterPage.
  • Re: Updatepanel and Gridview

    03-22-2006, 3:12 PM
    • Member
      160 point Member
    • phaetontdi
    • Member since 10-08-2005, 8:32 AM
    • Posts 37

    Same with me. I got the same error with my gridview. No flicker, no error, no result. Can somebody can post code for gridview and atlas that works on his/her app?

    Thank you!

  • Re: Updatepanel and Gridview

    03-22-2006, 3:20 PM
    • Member
      568 point Member
    • Osiris209
    • Member since 02-11-2006, 4:19 PM
    • England
    • Posts 133
    this works for me....

        <atlas:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true">
            </atlas:ScriptManager>
        <atlas:UpdateProgress ID="UpdateProgress1" runat="server">
            <ProgressTemplate>
                <img src="gfx/indicator.gif" />
                Loading...
            </ProgressTemplate>
        </atlas:UpdateProgress>
        <atlas:UpdatePanel ID="UpdatePanel1" runat="server">
            <Triggers>
                <atlas:ControlEventTrigger ControlID="gridUsers" EventName="SelectedIndexChanged" />
            </Triggers>
        <ContentTemplate>
                            <asp:Panel Width="268px" Height="240px" runat="server" ID="pnlUsers" ScrollBars="Vertical">
                                <asp:GridView ID="gridUsers" runat="server" AutoGenerateColumns="False" ShowHeader="False"
                                    Width="248px" BorderStyle="None" Height="15px" EditRowStyle-ForeColor="Gray" OnRowDataBound="gridUsers_RowDataBound" OnSelectedIndexChanged="gridUsers_SelectedIndexChanged" OnRowCommand="gridUsers_RowCommand" >
                                    <SelectedRowStyle Font-Bold="true" />
                                    <Columns>
                                        <asp:TemplateField>
                                            <ItemStyle BackColor="#E0E0E0" BorderColor="White" BorderStyle="Solid" BorderWidth="2px"
                                                Height="23px" HorizontalAlign="Left" VerticalAlign="Middle" Width="125px" />
                                            <ItemTemplate>
                                                <asp:LinkButton ID="linkUserSelect" runat="server" CausesValidation="False" CommandName="Select" CommandArgument='<%# Eval("idUser") %>'
                                                                OnClick="linkUserSelect_OnClick" ForeColor="#696969" Font-Underline="false" Text='<%# Bind("chrName") %>'></asp:LinkButton>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:BoundField DataField="EE">
                                        <ItemStyle Height="23px" Width="35px" VerticalAlign="Middle" HorizontalAlign="Center" BackColor="#E0E0E0" BorderStyle="Solid" BorderColor="White" BorderWidth="2px" />
                                        </asp:BoundField>
                                        <asp:BoundField DataField="Recd">
                                        <ItemStyle Height="23px" Width="35px" HorizontalAlign="Center" BackColor="#E0E0E0" BorderStyle="Solid" BorderColor="White" BorderWidth="2px" />
                                        </asp:BoundField>
                                        <asp:TemplateField>
                                        <ItemStyle Width="45px" Height="23px" VerticalAlign="Middle" HorizontalAlign="Center" BackColor="White" BorderStyle="None" />
                                            <ItemTemplate>
                                                <asp:ImageButton ID="imgActivate" runat="server" Width="45px" Height="23px" CommandName="Select"
                                                         CommandArgument='<%# Eval("idUser") %>' AlternateText='<%# Eval("Act") %>' ToolTip="Activate" />
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                    </Columns>
                                    <EditRowStyle ForeColor="Gray" />
                                </asp:GridView>
                            </asp:Panel>
        </div>
            <span style=" text-align: right;"></span>
    </ContentTemplate>
    </atlas:UpdatePanel>
    </asp:Content>

  • Re: Updatepanel and Gridview

    03-22-2006, 3:49 PM
    • Member
      160 point Member
    • phaetontdi
    • Member since 10-08-2005, 8:32 AM
    • Posts 37

    for me not :( Could you have a look to my code and tell me what is wrong, please?

    <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

    <atlas:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true">
            </atlas:ScriptManager>
        <atlas:UpdateProgress ID="UpdateProgress1" runat="server">
            <ProgressTemplate>
          
            </ProgressTemplate>
        </atlas:UpdateProgress>
        <atlas:UpdatePanel ID="UpdatePanel1" runat="server">
            <Triggers>
                <atlas:ControlEventTrigger ControlID="GridView1" EventName="SelectedIndexChanged" />
            </Triggers>
        <ContentTemplate>


        <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True"
            AutoGenerateColumns="False" DataKeyNames="ProductID" DataSourceID="SqlDataSource1"
            EmptyDataText="">
            <Columns>
                <asp:CommandField ShowEditButton="True" ShowSelectButton="True" />
                <asp:BoundField DataField="ProductID" HeaderText="Product ID" ReadOnly="True" SortExpression="ProductID" />
                <asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" />
        
            </Columns>
        </asp:GridView>
      
          </ContentTemplate>
    </atlas:UpdatePanel>
    ... cut code from the select statmenet
    </asp:Content>

  • Re: Updatepanel and Gridview

    03-22-2006, 3:53 PM
    • Member
      192 point Member
    • Sianspheric
    • Member since 09-15-2005, 5:25 PM
    • Posts 53

    jcasp wrote:
    It looks okay.  When you say that it's not working, do you mean that it's still posting back (with flicker) or something else?  Also, I noticed that you're using MasterPage.  Did you perhaps do something special in the MasterPage (like using the Atlas features there too)?  I tried a simple example and everything works fine, including when used with MasterPage.

    Thank for youy reply! When i say that it's not working i mean that when i click on the header to sort a column or when i click in the number of the page to change the page of my gridview nothing occur. No post-back, no flickering. I will try to do the same page without my masterpage. I dont think this is the problem but i'm using callback in this master page so maybe it could be the problem.

  • Re: Updatepanel and Gridview

    03-22-2006, 4:05 PM
    • Member
      192 point Member
    • Sianspheric
    • Member since 09-15-2005, 5:25 PM
    • Posts 53

    Ok i've try to do the same this but this time without my masterpage and this is working. So the problem is my masterpage. In this masterpage i'm using callback. The users can start some fonctions that generate reports and when this occurs i'm using callback to display a progress bar at the bottom of all my page and for all the users. If i'm already using callback and i want to use Atlas did i have to change something in my code or if it should work without i change something?

    Thank and sorry about my bad english ^_^

  • Re: Updatepanel and Gridview

    03-22-2006, 4:14 PM
    • Member
      10 point Member
    • Uffy
    • Member since 03-22-2006, 9:10 PM
    • Posts 2
    <trigger> missing Sianspheric .
  • Re: Updatepanel and Gridview

    03-22-2006, 4:24 PM
    • Star
      11,530 point Star
    • jcasp
    • Member since 04-10-2003, 10:43 AM
    • Posts 2,286
    Uffy wrote:
    <trigger> missing Sianspheric .


    <trigger> is not required if the control is enclosed within <UpdatePanel>.
  • Re: Updatepanel and Gridview

    03-22-2006, 4:26 PM
    • Star
      11,530 point Star
    • jcasp
    • Member since 04-10-2003, 10:43 AM
    • Posts 2,286
    Sianspheric wrote:

    Ok i've try to do the same this but this time without my masterpage and this is working. So the problem is my masterpage. In this masterpage i'm using callback. The users can start some fonctions that generate reports and when this occurs i'm using callback to display a progress bar at the bottom of all my page and for all the users. If i'm already using callback and i want to use Atlas did i have to change something in my code or if it should work without i change something?

    Thank and sorry about my bad english ^_^



    See if you can change your MasterPage's callback processing to Atlas-based on as well.
  • Re: Updatepanel and Gridview

    03-23-2006, 10:10 AM
    • Member
      10 point Member
    • Uffy
    • Member since 03-22-2006, 9:10 PM
    • Posts 2

    jcasp wrote:
    Uffy wrote:
    <trigger> missing Sianspheric .


    <trigger> is not required if the control is enclosed within <UpdatePanel>.

     

    Could you backup your statement with source please. It will help newbies like me to understand things better.

    My reasons come from:

    http://west-wind.com/weblog/posts/4719.aspx

    And

    http://weblogs.asp.net/atlas/archive/2006/02/08/437758.aspx

    And

    http://www.dotnetslackers.com/Atlas/re-23004_ATLAS_UpdatePanel_Experiments.aspx

     

    I did not see any example without <triggers> - am I missing something?

    Thanks.

     

  • Re: Updatepanel and Gridview

    07-31-2006, 5:27 AM
    • Member
      195 point Member
    • jyoti22apr
    • Member since 07-20-2006, 4:06 AM
    • Posts 40
    I want to make templet for GridView.In which each cell contain updatepanel control.Whenevery i add new row or column that newly add cell also having that updatepanel. How to do this....
Page 1 of 1 (12 items)