Click here to Skip to main content
15,922,325 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
XML
Hi ,
Can anybody tell me how to set the editor settings while it inside repeater?
t even dos not bind data !
they all are - editors-  empty while label is binded !
I need to set the next:



            SiteUtils.SetupNewsletterEditor(edIntroduction);
            edIntroduction.WebEditor.UseFullyQualifiedUrlsForResources = true;

Which is usualy setted in the preinit()  in pages events!
any ideas will be appreciated
my code seems like this :


<asp:Repeater ID="TermsMatrixRepeater" runat="server" ViewStateMode="Enabled"  >
<ItemTemplate>

        <div class="categoryListTitle">
            <asp:TextBox ID="txtTermCat" width="200" MaxLength="250"  CssClass="verywidetextbox forminput" runat="server" Text='<%# Eval("TermCat") %>'  Visible="false"></asp:TextBox>
        </div>

        <asp:Repeater   ViewStateMode="Enabled" ID="rptTermSubCategory" DataSource='<%# ((DataRowView)Container.DataItem).Row.GetChildRows("TermSubCat_TermCat")%>' runat="server"  >
            <ItemTemplate>
                <div class="subCategoryListSection">
                            <mpe:EditorControl ID="edTermSubCatDescr" runat="server" Text='<%# ((DataRow)Container.DataItem)["TermSubCatDescr"] %>'   Visible="false" ></mpe:EditorControl>
                </div>
            </ItemTemplate>
        </asp:Repeater>

</ItemTemplate>
</asp:Repeater>



-----------

I tried the next but it does not works after i added OnItemDataBound="RptTermSubCategory_ItemDataBound" in the second repeator:

C#
protected void RptTermSubCategory_ItemDataBound(object sender,
       System.Web.UI.WebControls.RepeaterItemEventArgs e)

       {

           if (e.Item.ItemType == ListItemType.Item ||
               e.Item.ItemType == ListItemType.AlternatingItem)

           {



               EditorControl editor =((EditorControl)e.Item.FindControl("edTermSubCatDescr"));
               if (editor != null)
               {
                   //editor = SubCatItem.FindControl("edTermSubCatDescr") as EditorControl;
                   editor.WebEditor.ToolBar = ToolBar.Newsletter;
                   editor.WebEditor.FullPageMode = true;
                   editor.WebEditor.EditorCSSUrl = string.Empty;

                   editor.WebEditor.Width = Unit.Percentage(90);
                   editor.WebEditor.Height = Unit.Pixel(500);

                   SiteUtils.SetupNewsletterEditor(editor);
                   editor.WebEditor.UseFullyQualifiedUrlsForResources = true;

               }

           }

       }


it founds all of them but did not affect on them !
Posted

1 solution

Ok,

Seems it will not work, so I used another solution using AjaxExtender popup modal !
When the popoup appear the text appear in the editor then it disappear and the Editor seems not enabled for editing !!!


any help or idea ?

thank you

here my new code :


<asp:Button id="Button1" Text="" runat="server" Style="display: none;" />
<ajaxToolKit:ModalPopupExtender ID="ModalPopupExtender1" runat="server" TargetControlID="btnShowTermSubCat"
PopupControlID="pnlTermSubCat" OkControlID="btnSaveTermSubCat" CancelControlID="btnCloseTermSubCat" />
<asp:Panel ID="Panel1" runat="server" Height="500px" Width="70%" style="display:none">
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div class="modalpopup" >
<div class="modalpopuptitle">
<mp:SiteLabel ID="SiteLabel245" runat="server" ForControl=""
ResourceFile="AdminResource" ConfigKey="TermSubCatsSubHeaderLabel"></mp:SiteLabel>

</div>
<div class="modalcontent">
<asp:HiddenField ID="HiddenField1" runat="server" Value="-1" />
<portal:mojoLabel ID="MojoLabel1" runat="server" CssClass="txterror" />
<div class="settingrow">
<mp:SiteLabel ID="SiteLabel745" runat="server" ForControl="edTermSubCatDescr" CssClass="settinglabeltight"
ConfigKey="TermSubCategoryNameLabel" ResourceFile="AdminResource" /> <mp:SiteLabel
ID="SiteLabel845" runat="server" ForControl="edTermSubCatDescr" CssClass="txterror needsattention"
ConfigKey="StarLabel" ResourceFile="AdminResource" />
<mpe:EditorControl Enabled="true" ScrollBars="Both" ID="edTermSubCatDescr" runat="server" >
</mpe:EditorControl>
</div>
</div>
<div class="modalbuttonspane">
<div class="modalbuttonset">
<asp:Button ID="Button2" CommandName="Cancel" runat="server"
CausesValidation="false" UseSubmitBehavior="false"
Text="<%$ Resources:AdminResource,CloseHeader %>"
CssClass="jqbutton ui-button ui-widget ui-state-default ui-corner-all"
OnClick="btnCancelTermSubCat_Click"
/>
<asp:Button ID="Button3" CommandName="Save" runat="server"
CausesValidation="false" UseSubmitBehavior="false"
Text="<%$ Resources:AdminResource,ProposalUpdateTermSubCat %>"
CssClass=" jqbutton ui-button ui-widget ui-state-default ui-corner-all"
OnClick="btnUpdateTermSubCat_Click"
/>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Panel>

<div class="viewAfterAdd" >
<div class="itinfoDataGridView">
<asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional" >
<ContentTemplate>
<div class="msgnoteborder">
<portal:mojoLabel ID="MojoLabel2" Text="<%$ Resources:AdminResource,TermSubCatsSubHeaderLabel %>" runat="server" cssclass="msgnote" />
</div>

<asp:DataGrid ID="DataGrid1" DataKeyField="ProposalTermSubCatID" BorderWidth="0px"
CellPadding="0" AutoGenerateColumns="false" GridLines="Horizontal"
runat="server" Visible="true">
<ItemStyle CssClass="dgitemstyle"/>
<AlternatingItemStyle CssClass="dgaltitemstyle"/>
<HeaderStyle CssClass="dgheaderstyle" />
<Columns>
<asp:TemplateColumn HeaderText="<%$ Resources:AdminResource,TermSubCategoryNameLabel %>" >
<ItemStyle Wrap="True"></ItemStyle>
<ItemTemplate>

<asp:Label ID="lblTermSubCatDescr" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "TermSubCatDescr") %>' CssClass="msgnote" ></asp:Label><br />


</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn>
<ItemStyle Wrap="False"></ItemStyle>
<ItemTemplate>
<asp:Button ID="cmdEditTermSubCat" runat="server" CausesValidation="false"
CommandArgument='<%# DataBinder.Eval(Container.DataItem, "ProposalTermSubCatID")%>'
OnClick="btnEditTermSubCat_Click"
Text="<%$ Resources:AdminResource, EditHeader %>"
ToolTip="<%$ Resources:AdminResource, EditHeader %>"
CssClass="jqbutton ui-button ui-widget ui-state-default ui-corner-all"
/>

<asp:Button ID="cmdDeleteTermSubCat" runat="server" CausesValidation="false"
CommandArgument='<%# DataBinder.Eval(Container.DataItem, "ProposalTermSubCatID")%>'
OnClick="btnDeleteTermSubCat_Click"
OnClientClick="javascript:return confirm(confrmmsgTermSubCat);"
Text="<%$ Resources:AdminResource, DeleteHeader %>"
ToolTip="<%$ Resources:AdminResource, DeleteHeader %>"
CssClass="jqbutton ui-button ui-widget ui-state-default ui-corner-all"
/>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:DataGrid>

</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900