Problem With Itemrequested

2 posts, 0 answers
  1. Gajanan
    Gajanan  avatar
    49 posts
    Member since:
    May 2010

    Posted 09 Sep 2010 Link to this post

    Hello All,
    i have problem with Radcombobox Itemrequested,
    Actually my Radcombo is in Radgrid formtemplate on the radgrid datatbind event it is finding the radcombo but on Radcombo Itemrequested event it is not finding , my code is below.

    <MasterTableView  AutoGenerateColumns="False" DataKeyNames="OrderId" DataMember="Orders" CommandItemDisplay="Top">
                            <EditFormSettings EditFormType="Template">
                                    <asp:TableCell Width="25%" HorizontalAlign="Left">                             
                                                <telerik:RadComboBox ID="RadComboBox_ShippingAddress" runat="server"
                                                DataTextField="LocationName" DataValueField="LocationID" 
                                                Width="190px" EnableLoadOnDemand="True"
                                                MarkFirstMatch="True" AllowCustomText="false"
                                                ShowMoreResultsBox="True" ItemRequestTimeout="500" AutoPostBack="false"

    protected void RadComboBox_ShippingAddress_ItemsRequested(object o, RadComboBoxItemsRequestedEventArgs e)
            RadComboBox oRadComboBox_ShippingAddress = RadGrid_Orders.MasterTableView.Items[0].FindControl("RadComboBox_ShippingAddress") as RadComboBox;
            string text = e.Text;
                DataRow[] rows = mShippingAddressNameListDataTable.Select("LocationName LIKE '" + text + "*'");

    in the above code on below line
    RadComboBox oRadComboBox_ShippingAddress = RadGrid_Orders.MasterTableView.Items[0].FindControl("RadComboBox_ShippingAddress") as RadComboBox;
    it is returning the NULL value and throwing exception.

    so plz tell me how to find radcombo .
  2. Yana
    Yana avatar
    4950 posts

    Posted 09 Sep 2010 Link to this post

    Hi Gajanan ,

    You can cast the object from the parameters in ItemsRequested event handler to access the combobox:

    RadComboBox oRadComboBox_ShippingAddress = (RadComboBox) o;

    Kind regards,
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top