unable to set text to radcombobox in radgrid itemtemplate

2 posts, 1 answers
  1. Chinna
    Chinna avatar
    9 posts
    Member since:
    Feb 2011

    Posted 09 Mar 2011 Link to this post


    trying to set text to radcombobox in radgrid itemtemplate and getting error "object reference not set an instance of an object"




    telerik:GridTemplateColumn HeaderText = "Print Letters/Post Cards" UniqueName = "PrintLetter" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign










    <telerik:RadComboBox ID= "Print" runat










    <telerik:RadComboBoxItem runat="server" Text

    ="1 Year Postcard"/>




    <telerik:RadComboBoxItem runat="server" Text

    ="1 Year Adult"/>




    <telerik:RadComboBoxItem runat="server" Text

    ="2 Years Adult"/>




    <telerik:RadComboBoxItem runat="server" Text

    ="3 Year"/>


























    protected void ItemDataBound(object sender, GridItemEventArgs








    GridDataItem dataItem = e.Item as GridDataItem






    RadComboBox Print = ((RadComboBox)dataItem["PrintLetter"].FindControl("Print"




    Print.Text =







    Please suggest me on this.
  2. Answer
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 10 Mar 2011 Link to this post

    Hello Chinna,

    If you need to set custom text for RadComboBox, then you will have to set the AllowCustomText property of the control to True.

            <telerik:RadComboBox AllowCustomText="true" ID="Print" runat="server">

Back to Top