While retreiving value of 'txtnewDescComment' , I used the following:
string test = ((CKEditorControl)GV_CandDesc.Controls[0].Controls[0].FindControl("txtnewDescComment")).Text;
It returns an empty string. Could anyone guide me how to retrieve the correct value? A regular textbox retrieval works fine, but not when using the CkEditor tool.
Also, could you also let me know how to show CKEditorControl in Itemtamplate?
csharpnew
Member
73 Points
71 Posts
Using CKEditor in gridview control.
Dec 05, 2012 05:14 PM|LINK
Hi I am using CKEditorControl for the 1st time. I am trying to retreive the value of the data stored in the CKEditorControl in a gridview.
Below is my code:
<EmptyDataTemplate>
<table ID="NoComm_tbl" style="margin-right: 0px" width="100%">
<tr>
<td class="Span_Title" style="width: 100%">
Comments</td>
</tr>
</table>
<table ID="No_can_desc_tbl" style="margin-right: 0px" width="100%">
<tr>
<td>
<CKEditor:CKEditorControl ID="txtnewDescComment" runat="server">
</CKEditor:CKEditorControl>
</td>
</tr>
<tr>
<td class="Span_Title" width="100%">
<asp:LinkButton ID="btnDescInsert" runat="server" CommandName="NoDescInsert"
CssClass="infotitle" Text="Save" />
</td>
</tr>
</table>
</EmptyDataTemplate>
While retreiving value of 'txtnewDescComment' , I used the following:
string test = ((CKEditorControl)GV_CandDesc.Controls[0].Controls[0].FindControl("txtnewDescComment")).Text;
It returns an empty string. Could anyone guide me how to retrieve the correct value? A regular textbox retrieval works fine, but not when using the CkEditor tool.
Also, could you also let me know how to show CKEditorControl in Itemtamplate?
Thanks,
bbcompent1
All-Star
32984 Points
8505 Posts
Moderator
Re: Using CKEditor in gridview control.
Dec 05, 2012 06:01 PM|LINK
Try this:
string test = ((CKEditorControl)GV_CandDesc.Controls[0].Controls[0].FindControl("txtnewDescComment")).Content.ToString();csharpnew
Member
73 Points
71 Posts
Re: Using CKEditor in gridview control.
Dec 05, 2012 06:26 PM|LINK
Thanks for your reply. Unfortunately, I don't get reference to 'Content' property. I am unable to use it.
csharpnew
Member
73 Points
71 Posts
Re: Using CKEditor in gridview control.
Dec 05, 2012 09:18 PM|LINK
It was an issue of Page load event. Sorry about the silly issue