This is a migrated thread and some comments may be shown as answers.

Problem With Itemrequested

1 Answer 14 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Gajanan
Top achievements
Rank 2
Gajanan asked on 09 Sep 2010, 05:53 AM
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">
                            <FormTemplate>
                                <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"
                                            OnItemsRequested="RadComboBox_ShippingAddress_ItemsRequested"
                                              Height="140px"

 
protected void RadComboBox_ShippingAddress_ItemsRequested(object o, RadComboBoxItemsRequestedEventArgs e)
    {
        LoadRadCombo_ShippingAddress();
        RadComboBox oRadComboBox_ShippingAddress = RadGrid_Orders.MasterTableView.Items[0].FindControl("RadComboBox_ShippingAddress") as RadComboBox;
         
        oRadComboBox_ShippingAddress.Items.Clear();
        string text = e.Text;
 
        try
        {
            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 .

1 Answer, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 09 Sep 2010, 09:13 AM
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,
Yana
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
Tags
ComboBox
Asked by
Gajanan
Top achievements
Rank 2
Answers by
Yana
Telerik team
Share this question
or