Textbox with PopupControlExtender

3 posts, 1 answers
  1. Jagat
    Jagat avatar
    135 posts
    Member since:
    Jan 2011

    Posted 19 Jan 2012 Link to this post

    Hello,

       I have a RadGrid in which i have a textbox in one of the columns and for that textbox i wanted to have a popupcontrol extender with bigger textbox in it.

    All i wanted to have is a big textbox which i can't put in the grid row because of its size.

    Now the problem is, When i entered text in the textbox within popupcontrolextender, that text is not being saved in to the grid textbox when the popup is closed.

    Hope i am making sense.

    Appreciate the help
    Thanks

    Here is the code:

    <telerik:GridTemplateColumn HeaderText="Income Source" UniqueName="MemSourceofIncome">
                                                              <ItemTemplate>
                                                                  <asp:TextBox ID="txtMemSourceofIncome" runat="server" CssClass="Text" ToolTip="Member Source of Income"
                                                                      Width="80px">
                                                                  </asp:TextBox>
                                                                  <asp:PopupControlExtender ID="IncomeSrcPopEx" runat="server"
                                                                         TargetControlID="txtMemSourceofIncome" PopupControlID="IncomeSrcPanel" Position="Left"   CommitProperty="text"  CommitScript="e.text"   />
                                                                  <asp:Panel ID="IncomeSrcPanel" runat="server" CssClass="PopupModalWindow" Style="display: none">
                                                                      <table>
                                                                          <tr>
                                                                              <td>
                                                                                  <telerik:RadTextBox ID="txtIncSrc" runat="server" CssClass="Text"  TextMode = "MultiLine" Width="280px">
                                                                                  </telerik:RadTextBox>
                                                                              </td>
                                                                          
                                                                          </tr>
                                                                      </table>
                                                                  </asp:Panel>      
                                                              </ItemTemplate>
                                                          </telerik:GridTemplateColumn>

  2. Answer
    Abhishek
    Abhishek avatar
    45 posts
    Member since:
    Jul 2012

    Posted 20 Jan 2012 Link to this post

    Hello Jagat,
    I have gone through your posted issue and finally i came up with one suggestion from my side. I mean i made small changes in your code please have one look on it.

    ASPX:
    <telerik:GridTemplateColumn HeaderText="Income Source" UniqueName="MemSourceofIncome">
                           <ItemTemplate>
                               <asp:TextBox ID="txtMemSourceofIncome" runat="server" CssClass="Text" ToolTip="Member Source of Income"
                                   Width="80px">
                               </asp:TextBox>
                               <ajaxToolkit:PopupControlExtender ID="IncomeSrcPopEx" runat="server" TargetControlID="txtMemSourceofIncome"
                                   PopupControlID="IncomeSrcPanel" Position="Left" />
                               <asp:Panel ID="IncomeSrcPanel" runat="server" CssClass="PopupModalWindow" Style="display: none">
                                   <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                                       <ContentTemplate>
                                           <table>
                                               <tr>
                                                   <td>
                                                       <telerik:RadTextBox ID="txtIncSrc" runat="server" CssClass="Text" TextMode="MultiLine" AutoPostBack="true" OnTextChanged="txtIncSrc_TextChanged"
                                                           Width="280px">
                                                       </telerik:RadTextBox>
                                                   </td>
                                               </tr>
                                           </table>
                                       </ContentTemplate>
                                   </asp:UpdatePanel>
                               </asp:Panel>
                           </ItemTemplate>
                       </telerik:GridTemplateColumn>

    CodBehind:
    protected void txtIncSrc_TextChanged(object sender, EventArgs e)
           {
               RadTextBox txtIncSrc = (RadTextBox)sender;
               PopupControlExtender PopupControlExtender1 = (PopupControlExtender)txtIncSrc.Parent.FindControl("IncomeSrcPopEx");
               PopupControlExtender1.Commit(txtIncSrc.Text);
           }

    Let me know if any issue.

    Thanks,
    Abhishek K
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Jagat
    Jagat avatar
    135 posts
    Member since:
    Jan 2011

    Posted 20 Jan 2012 Link to this post

    Hey Abhishek,

      It worked like a charm. Thank you..

Back to Top