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

RadComboCob OnSelectedIndexChanged does not fire when in a control

2 Answers 119 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Gary
Top achievements
Rank 1
Gary asked on 20 Aug 2008, 06:21 PM
Hi,

I have a control containing a detailsview with a RadComboBox.  The RadComboBox has autopostback set to true.  This is all wrapped up in a control and when placed in a form the OnSelectedIndexChanged fires when I select an item in the RadComboBox. 
Here's a snippet from the ascx file:

        <asp:DetailsView ID="dvNSN" DataKeyNames="NSNID" runat="server"   utoGenerateRows="False" 
            DataSourceID="NSNData" Height="50px" Width="125px"   
            OnItemCommand="dvNSN_ItemCommand"   
            OnItemCreated="dvNSN_ItemCreated"   
            OnDataBound="dvNSN_DataBound"   
            OnItemUpdating="dvNSN_ItemUpdating"   
            OnItemInserting="dvNSN_ItemInserting" 
            OnItemInserted="OnItemInserted" 
            OnItemUpdated="OnItemUpdated" onmodechanged="dvNSN_ModeChanged"   
                onmodechanging="dvNSN_ModeChanging">  
            <Fields> 
                <asp:BoundField DataField="NSNId" HeaderText="NSNId" SortExpression="NSNId" ReadOnly="true" Visible="false" /> 
                <asp:TemplateField HeaderText="NSN" > 
                    <ItemTemplate> 
                        <telerik:RadComboBox ID="rcbNSN" runat="server" EnableLoadOnDemand="true"   
                                 Enabled="true" OnItemsRequested="rcb_ItemsRequested"   
                                OnSelectedIndexChanged="rcb_SelectedIndexChanged" AutoPostBack="true" ShowMoreResultsBox="true"  /> 
                    </ItemTemplate> 
                    <EditItemTemplate  > 
                        <telerik:RadMaskedTextBox ID="tbNSN" runat="server" Mask="aaaa-aa-aaa-aaaa" PromptChar="#" DisplayPromptChar="#" Text='<%#Bind("NSN")%>' /> 
                        </><asp:Label ID="lblPseudo" Text="Leave blank for a system assigned pseudo NSN" runat="server" />                          
                        <asp:RequiredFieldValidator ID="reqvNSN" runat="server" Text="Please enter an NSN number" ControlToValidate="tbNSN" ErrorMessage="*" Enabled="false" /> 
                        </><asp:RegularExpressionValidator ID="rexpNSN" runat="server" ErrorMessage="*" Text="NSNs must be in the format of 9999-99-999-9999, or the system supplied pseudo format of MIDI-YY-000-0000" ControlToValidate="tbNSN" ValidationExpression="^((MIDI[-]{1}[0-9]{2}[-]{1}[0-9]{3}[-]{1}[0-9]{4})|([0-9]{4}[-]{1}[0-9]{2}[-]{1}[0-9]{3}[-]{1}[0-9]{4})|([0-9]{4}[-]{1}[0-9]{2}[-]{1}MIS[-]{1}[0-9]{4}))$"></asp:RegularExpressionValidator> 
                    </EditItemTemplate> 
                </asp:TemplateField>                  
                <asp:TemplateField HeaderText="Type">  
                    <ItemTemplate> 
                        <asp:Label ID="lblType" runat="server" Text='<%#Bind("TypeDescription")%>' /> 
                    </ItemTemplate> 
                    <EditItemTemplate  > 
                        <asp:DropDownList ID="ddType" runat="server" DataSourceID="ObjectDataSourceType" DataTextField="TypeDescription" SelectedValue='<%#Bind("TypeId")%>' DataValueField="TypeId" /> 
                    </EditItemTemplate> 
                </asp:TemplateField> 
                <asp:BoundField DataField="Size" HeaderText="Size" SortExpression="Size" /> 
                <asp:TemplateField HeaderText="Noun">  
                    <ItemTemplate> 
                        <asp:Label ID="lblNoun" runat="server" Text='<%#Bind("Noun")%>' /> 
                    </ItemTemplate> 
                    <EditItemTemplate> 
                        <asp:DropDownList ID="ddNoun" runat="server" DataSourceID="ObjectDataSourceNoun" DataTextField="Noun" SelectedValue='<%#Bind("NounId")%>' DataValueField="NounId" /> 
                    </EditItemTemplate> 
                </asp:TemplateField> 
                <asp:TemplateField HeaderText="Form">  
                    <ItemTemplate> 
                        <asp:Label ID="lblForm" runat="server" Text='<%#Bind("Form")%>' /> 
                    </ItemTemplate> 
                    <EditItemTemplate> 
                        <asp:DropDownList ID="ddForm" runat="server" DataSourceID="ObjectDataSourceForm" DataTextField="Form" SelectedValue='<%#Bind("FormId")%>' DataValueField="FormId" /> 
                    </EditItemTemplate> 
                </asp:TemplateField> 
                <asp:BoundField DataField="Grade" HeaderText="Grade" SortExpression="Grade" /> 
                <asp:BoundField DataField="Misc" HeaderText="Misc Info" SortExpression="Misc" /> 
                <asp:TemplateField HeaderText="Create Date">  
                    <ItemTemplate> 
                        <asp:Label ID="lblCreateDate" runat="server" Text='<%#Bind("CreateDate")%>' /> 
                    </ItemTemplate> 
                    <EditItemTemplate> 
                        <telerik:RadDatePicker ID="RadCreateDate" MinDate="12/31/1732" runat="server" SelectedDate='<%#Bind("CreateDate")%>' > 
                            <DateInput ID="CreateDate" runat="server" Skin=""></DateInput> 
                        </telerik:RadDatePicker> 
                        <asp:RequiredFieldValidator ID="reqvCreateDate" runat="server" Text="Please enter a valid date" ControlToValidate="RadCreateDate" ErrorMessage="*" /> 
                    </EditItemTemplate> 
                </asp:TemplateField> 
                <asp:TemplateField HeaderText="Kit Flg?">  
                    <ItemTemplate> 
                        <asp:DropDownList ID="ddKitFlg" runat="server" SelectedValue='<%#Bind("kitFlg")%>' Enabled="false">  
                            <asp:ListItem Text="No" Value="False" /> 
                            <asp:ListItem Text="Yes" Value="True" /> 
                        </asp:DropDownList> 
                    </ItemTemplate> 
                    <EditItemTemplate> 
                        <asp:DropDownList ID="ddKitFlg" runat="server" SelectedValue='<%#Bind("kitFlg")%>' > 
                            <asp:ListItem Text="No" Value="False" /> 
                            <asp:ListItem Text="Yes" Value="True" /> 
                        </asp:DropDownList> 
                    </EditItemTemplate> 
                </asp:TemplateField> 
                <asp:CommandField ShowEditButton="True" /> 
                <asp:CommandField ShowInsertButton="True" /> 
            </Fields> 
        </asp:DetailsView> 
 


I use this control in another web form embedded within a second control.  So I can place this control, along with others in a RadPanel.  Code is here:

    <telerik:RadPanelbar ID="rpbProduct" runat="server" Skin="Outlook" Width="100%" > 
        <Items> 
            <telerik:RadPanelItem runat="server" Text="Product ID - ">  
            </telerik:RadPanelItem> 
            <telerik:RadPanelItem runat="server" Text="NSN" Expanded="True">  
                <Items> 
                    <telerik:RadPanelItem runat="server" Expanded="True" Value="itemNSN">  
                        <ItemTemplate> 
                            <uc1:NSN ID="NSNdetail" runat="server" /> 
                        </ItemTemplate> 
                    </telerik:RadPanelItem> 
                </Items> 
            </telerik:RadPanelItem> 
        </Items> 
    </telerik:RadPanelbar> 
 

When I use this control in a web form, the RadComboBox in the control NSNdetail does not fire when the selection is changed.  Thanks in advance.
Gary

2 Answers, 1 is accepted

Sort by
0
Gary
Top achievements
Rank 1
answered on 21 Aug 2008, 12:14 PM
One other piece of evidence - the control does post back, but the event for select index change does not run.  If I change autopostback to false the control does not postback, when I click a button, it postback, but again the ONSelectedIndexChanged event does not fire.
0
Gary
Top achievements
Rank 1
answered on 21 Aug 2008, 12:45 PM
PLEASE DISREGARD THIS THREAD!!!
Mistake on my part!  I'm sorry for any inconvenience.
Tags
ComboBox
Asked by
Gary
Top achievements
Rank 1
Answers by
Gary
Top achievements
Rank 1
Share this question
or