I'm using repeater inside a user control, which is dynamically generated by other parent page inside raddock, so the hierarchy is: Page, RadDock, User Control, Repeater.
My problem is that the repeater doesn't fire Item command event,
Here is the code of the repeater inside the user control:
And this is how i dynamically create the rad docks in the parent page:
as mentioned in the demo of rad dock:
And then i re create them from the saved state at Page_Init as mentioned in the RadDock Demo
Note that i have buttons inside the user control and they work correctly, Also repeater_ItemDataBound and ItemCreated event handlers are firing correctly.
Any suggestions??
My problem is that the repeater doesn't fire Item command event,
Here is the code of the repeater inside the user control:
<asp:Repeater ID="rptrFirst5Assignments" runat="server" onitemdatabound="rptrFirst5Assignments_ItemDataBound" onitemcommand="rptrFirst5Assignments_ItemCommand" onitemcreated="rptrFirst5Assignments_ItemCreated" > <ItemTemplate> <table > <tr > <td > <asp:Label ID="lblAssignmentID" runat="server" Text='<%# Bind("Asm_ID") %>' Visible="false"></asp:Label> <asp:Label ID="lblCreatedByID" runat="server" Text='<%# Bind("Asm_CreatedBy") %>' Visible="false"></asp:Label> <asp:Label ID="lblAssignment" runat="server" CssClass="alltext" Text='<%# Bind("Asm_Body") %>'></asp:Label> </td> <td style="float:left;"> <asp:LinkButton ID="btnDelete" runat="server" CausesValidation="false" CssClass="link-delete" CommandName="Delete" CommandArgument='<%# Eval("Asm_ID")%>' /></td> </tr> </table> </ItemTemplate> </asp:Repeater>And this is how i dynamically create the rad docks in the parent page:
as mentioned in the demo of rad dock:
if (!Page.IsPostBack) {CreateDocksFirstTime();for (int i = 0; i < RadDockLayout1.Controls.Count; i++) { if (RadDockLayout1.Controls[i].GetType() == typeof(RadDock)) { RadDock radDock = (RadDock)RadDockLayout1.Controls[i]; List<Assignment> assignments = AssignmentBL.SearchTodayAssignments(3,5,0, SelectedDate); ((Controls.TeacherDateView.TeacherDateViewAssignments)radDock.ContentContainer.Controls[0]).FillData(assignments); radDock.Title = assignments.Count ; } }} private void CreateDocksFirstTime() { RadDock dock3 = CreateRadDock(); //adding the dock to the docklayout and then docking it to the zone to avoid ViewState issues on subsequent postback RadDockLayout1.Controls.Add(dock3); dock3.Dock(RadDockZoneAssignments); dock3.Height = new Unit(300, UnitType.Pixel); CreateSaveStateTrigger(dock3); //Load the selected widget in the RadDock control dock3.Tag = "Controls\\TeacherDateView\\TeacherDateViewAssignments.ascx"; LoadWidget(dock3); } private void LoadWidget(RadDock dock) { if (string.IsNullOrEmpty(dock.Tag)) { return; } Control widget = LoadControl(dock.Tag); widget.EnableViewState = false; dock.ContentContainer.Controls.Add(widget); }And then i re create them from the saved state at Page_Init as mentioned in the RadDock Demo
protected void Page_Init(object sender, EventArgs e) { //Recreate the docks in order to ensure their proper operation for (int i = 0; i < CurrentDockStates.Count; i++) { RadDock dock = CreateRadDockFromState(CurrentDockStates[i]); RadDockLayout1.Controls.Add(dock); //We want to save the dock state every time a dock is moved. CreateSaveStateTrigger(dock); //Load the selected widget LoadWidget(dock); if (CurrentDockStates[i].Closed == true) { dock.Visible = false; }}}Note that i have buttons inside the user control and they work correctly, Also repeater_ItemDataBound and ItemCreated event handlers are firing correctly.
Any suggestions??