Showing posts with label paging. Show all posts
Showing posts with label paging. Show all posts

Wednesday, March 21, 2012

Updatepanel and Gridview

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:ContentID="Content1"ContentPlaceHolderID="Contenu"Runat="Server">

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

<atlas:UpdatePanelID="p1"runat="server">

<ContentTemplate>

<asp:GridViewID="GridView1"runat="server"AllowPaging="True"AllowSorting="True"

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

<Columns>

<asp:BoundFieldDataField="RéfIndis"HeaderText="RéfIndis"InsertVisible="False"

ReadOnly="True"SortExpression="RéfIndis"/>

<asp:BoundFieldDataField="RéfPosteDeCharge"HeaderText="RéfPosteDeCharge"

SortExpression="RéfPosteDeCharge"/>

<asp:BoundFieldDataField="RéfMachine"HeaderText="RéfMachine"SortExpression="RéfMachine"/>

<asp:BoundFieldDataField="DateDébut"HeaderText="DateDébut"SortExpression="DateDébut"/>

<asp:BoundFieldDataField="DateFin"HeaderText="DateFin"SortExpression="DateFin"/>

<asp:BoundFieldDataField="Motif"HeaderText="Motif"SortExpression="Motif"/>

</Columns>

</asp:GridView>

<asp:SqlDataSourceID="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!!!

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.

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!


this works for me...

<atlas:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true">
</atlas:ScriptManager>
<atlas:UpdateProgress ID="UpdateProgress1" runat="server">
<ProgressTemplate>
<img src="http://pics.10026.com/?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

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>


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.


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 ^_^


<trigger> missingSianspheric .

Uffy wrote:

<trigger> missingSianspheric .

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

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.

jcasp wrote:

Uffy wrote:

<trigger> missingSianspheric .

<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.


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...

updatepanel and pagesource in browser

I have an updatepanel with a gridview
The paging works perfect.

When I view the pagesource when Im on page 1 in the gridview I can see the values that are displayed to the end-user (for example username, age and some user comment)
When I go to the second page, the end-user can see the values in the gridview as intended, but when I view the page source I cant find the displayed values.

So where does this text actually reside? Im used to that in the pagesource I can always view what is displayed to the end-user.


Hello,

most browsers will show you the page source as it was the first time you loaded the page. With Ajax you are changing parts of the page after it has loaded. If you want to get real insight into the changes try theFirebugadd-on for Firefox. It will show you the page source in a nice collapsible treeas it is, live. Also, you can use it to check out the communication to and from the server during an Ajax call and much much more.

Good luck!

UpdatePanel and PostBackUrl

I have a GridView in an UpdatePanel so paging the resultset will partial render and I have a Update asp:Button that has a PostBackUrl to the update page that works great for posting across. I have a asp:LinkButton that has a PostBackUrl to go to the view page but it is not working. Both of these controls are in the GridView. I was wondering why this would be and if there is anything that I can do to get it to work? Is there anyway to tell Atlas to ignore and event in an UpdatePanel for a control?

I found that removing the PostBackUrl property solved a similar sounding issue I had a while back.

- N