Problem with GridTemplateColumn

2 posts, 0 answers
  1. mww
    mww avatar
    257 posts
    Member since:
    Sep 2012

    Posted 28 Sep 2009 Link to this post

    I want to have a multi line text box in my grid, heres how Ive done it

    <telerik:GridTemplateColumn UniqueName="TickerColumn" HeaderText="Ticker Text">  
                                <telerik:RadTextBox ID="RadTextBoxTickerContent" runat="server" TextMode="MultiLine" MaxLength="500" Rows="5" Width="350px">  
    in the insert method I have this code

    protected void RadGridTicker_InsertCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)  
                Telerik.Web.UI.GridEditFormInsertItem insertedItem = (Telerik.Web.UI.GridEditFormInsertItem)e.Item;  
                RadComboBox cbPage = (e.Item as GridEditableItem)["ddlDisplayPage"].Controls[0] as RadComboBox;  
                Telerik.Web.UI.RadTextBox tbContent = (insertedItem.FindControl("RadTextBoxTickerContent") as Telerik.Web.UI.RadTextBox);     
                string content = tbContent.Text;  
                string res = tickermanager.Add(cbPage.SelectedValue, content);  
                if (!string.IsNullOrEmpty(res))  
                    this.RadGridTicker.Controls.Add(new LiteralControl("Unable to insert ticker. Reason: " + res));  
                    e.Canceled = true;  

    stepping through the code shows that an instance of the text box is created, but the text property is null  even though ive typed in several lines of text.  What am I doing wrong here ?
  2. Mira
    Mira avatar
    1124 posts

    Posted 30 Sep 2009 Link to this post

    Hi Mark,

    I am afraid I am unable to replicate the described by you issue. Please take a look at the attached project using your code which gets the value of the text box correct. Let me know what differs in your case.

    Best wishes,
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. DevCraft R3 2016 release webinar banner
Back to Top