Hello everybody,
How goodUpdatePanel withrepeater control? I am trying to use Repeator control ItemCommand" without a postback. but seems no effect. All I need is when a user click a perticular row in a repeator control "say a linkbutton", move a details panel (see below) into this user selected row with some information collected for that perticular row), this happen in "ItemCommand" event of repeator control. here is the server script..
Note I could easy done with Javascript and ClientPostBack but trying to do how good with Atlas .
please help.
<atlas:ScriptManagerrunat="server"ID="scriptsx"EnablePartialRendering="true"></atlas:ScriptManager>
<asp:repeaterid="Materials"runat="server"OnItemCommand="Repeater1_ItemCommand"><ItemTemplate>
<asp:panelrunat="server"id="rows">
<asp:LinkButtonid="LinkButton1"runat="server"CommandName="ShowIt"Text=<%# DataBinder.Eval(Container.DataItem, "Country")%>></asp:LinkButton>
</asp:panel></ItemTemplate></asp:repeater>
<atlas:UpdatePanelID="UpdateGrid"runat="server"Mode="Always"><ContentTemplate>
<asp:Panelrunat="server"ID="details"BackColor="gray"Visible="false">State Details</asp:Panel>
</ContentTemplate>
</atlas:UpdatePanel>
<Script runat="server">
protectedvoid Page_Load(object sender,EventArgs e){if (!IsPostBack){Materials.DataBind();}}
protectedvoid Repeater1_ItemCommand(object source, System.Web.UI.WebControls.RepeaterCommandEventArgs e){details.Visible =
true;Panel p = (Panel)e.Item.FindControl("rows");p.Controls.Add(details);}
</script>
thanks,
achu.
I think you just need to add in the Triggers section to your update panel as shown below:
<atlas:UpdatePanelID="UpdateGrid"runat="server"Mode="Always">
<ContentTemplate>
<asp:Panelrunat="server"ID="details"BackColor="gray"Visible="false">State Details</asp:Panel>
</ContentTemplate>
<Triggers>
<atlas:ControlEventTriggerControlID="Materials"EventName="ItemCommand"/>
</Triggers>
</atlas:UpdatePanel>
Yep .. this does work. I have many Repeaters within UpdatePanels .. and Repeaters within Repeaters ..
Just make sure you sort out the triggers and make the panel conditional.
thank Paul & KFrancis
It is working now. It works when repeator control inside the UpdatePanel though. Also tried with multiple Repeator controls works like a charm!!.
Regards
achu
No comments:
Post a Comment