This is a migrated thread and some comments may be shown as answers.
OnselectedIndexChanged event is not firing for RadCombobox in Gridview
5 Answers 327 Views
This is a migrated thread and some comments may be shown as answers.
Mário Alessand Gonçalves Oliveira
Top achievements
Rank 1
Mário Alessand Gonçalves Oliveira asked on 21 Jul 2011, 10:20 PM
We are loading elements of Radcombobox with event OnItemsRequested.
When the Radcombobox item is selected the OnSelectedIndexChanged not work.

<asp:UpdatePanel ID="upnDadosGerais5" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="false">
        <ContentTemplate>
          <div style="width: 949px;  overflow: auto">
                    <telerik:RadGrid ID="rgComposicao" runat="server"  AutoGenerateColumns="false"
                        OnNeedDataSource="Composicao__NeedDataSource"
                        OnItemDataBound="rgComposicao_ItemDataBound" Height="230px"
                        HorizontalAlign="Center">
                        <MasterTableView DataKeyNames="IdComposicao">   
                        <Columns>     
                         <telerik:GridTemplateColumn HeaderText="<%$ Resources:Label, FormAberto %>" DataField="FormAberto" HeaderStyle-Width="180" ItemStyle-Width="180"
                                    UniqueName="FormAberto" SortExpression="FormAberto">
                                    <ItemTemplate>
                                        <telerik:RadComboBox ID="rdFormatoAbertoComprimento" runat="server" EnableEmbeddedSkins="false"                                                                                
                                            Skin="GraphControl" Width="160" DropDownWidth="150" EnableLoadOnDemand="True"
                                             Height="200"
                                            OnItemsRequested="rdFormatoAbertoComprimento_OnItemsRequested"                                           
                                            OnSelectedIndex="rdFormatoAbertoComprimento_OnSelectedIndexChanged"
                                            OnDataBinding="rdFormatoAbertoComprimento_OnDataBinding"
                                            EnablePostBackOnRowClick="true">
                                        </telerik:RadComboBox>                                                                                                                
                                    </ItemTemplate>                                  
                                </telerik:GridTemplateColumn>
                        </Columns>                                                    
                        </MasterTableView>
                    </telerik:RadGrid>
          </div>
       </ContentTemplate>
   </asp:UpdatePanel>


5 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 1
answered on 22 Jul 2011, 04:41 AM
Hello Mario,

Make sure that you set AutoPostBack as true in order to fire OnSelectedIndexChanged event.

aspx:
<telerik:RadComboBox ID="rdFormatoAbertoComprimento" runat="server" AutoPostBack="true" OnSelectedIndex="rdFormatoAbertoComprimento_OnSelectedIndexChanged">
</telerik:RadComboBox>

Thanks,
Princy.
0
Mário Alessand Gonçalves Oliveira
Top achievements
Rank 1
answered on 22 Jul 2011, 01:35 PM
hello i put AutoPostBack as true, but no work too

<telerik:RadComboBox ID="rdFormatoAbertoComprimento" runat="server"              
                EnableEmbeddedSkins=
"false"                                                                                
Skin="GraphControl" Width="160" DropDownWidth="150" EnableLoadOnDemand="True"
Height="200" AutoPostBack=true
OnItemsRequested="rdFormatoAbertoComprimento_OnItemsRequested"                                           
OnSelectedIndex="rdFormatoAbertoComprimento_OnSelectedIndexChanged"
OnDataBinding="rdFormatoAbertoComprimento_OnDataBinding"
EnablePostBackOnRowClick="true">
</telerik:RadComboBox>
0
Mário Alessand Gonçalves Oliveira
Top achievements
Rank 1
answered on 27 Jul 2011, 09:55 PM
please someone, can help me?
0
Sebastian
Telerik team
answered on 28 Jul 2011, 11:30 AM
Hello Mário,

Your OnSelectedIndexChanged handler naming is incorrect, should be as follows:

<telerik:RadComboBox ID="rdFormatoAbertoComprimento" runat="server"              
                EnableEmbeddedSkins="false"                                                                               
  
Skin="GraphControl" Width="160" DropDownWidth="150" EnableLoadOnDemand="True"
  
Height="200" AutoPostBack=true
  
OnItemsRequested="rdFormatoAbertoComprimento_OnItemsRequested"                                          
  
OnSelectedIndexChanged="rdFormatoAbertoComprimento_OnSelectedIndexChanged"
  
OnDataBinding="rdFormatoAbertoComprimento_OnDataBinding"
  
EnablePostBackOnRowClick="true">
  
</telerik:RadComboBox>

Regards,
Sebastian
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
Mário Alessand Gonçalves Oliveira
Top achievements
Rank 1
answered on 29 Jul 2011, 09:35 PM
Hello,
you solution worked thanks

ASCX:
<telerik:GridTemplateColumn HeaderText="<%$ Resources:Label, FormAberto %>" DataField="FormAberto" HeaderStyle-Width="160" ItemStyle-Width="160"
                                    UniqueName="FormAberto" SortExpression="FormAberto">
                                    <ItemTemplate>
                                        <telerik:RadComboBox ID="rdFormatoAbertoComprimento" runat="server"                                                                                
                                             Width="150" EnableLoadOnDemand="True" Skin="GraphControl" EnableEmbeddedSkins="false"
                                             Height="180" AutoPostBack="true" DropDownWidth="160"
                                            OnItemsRequested="rdFormatoAbertoComprimento_OnItemsRequested"                                           
                                            OnSelectedIndexChanged="rdFormatoAbertoComprimento_OnSelectedIndexChanged"
                                            OnDataBinding="rdFormatoAbertoComprimento_OnDataBinding">                                           
                                        </telerik:RadComboBox>                                                                                                                                                        
                                    </ItemTemplate>                                         
                                </telerik:GridTemplateColumn>
 
CS:
 
protected void rdFormatoAbertoComprimento_OnSelectedIndexChanged(Object sender, RadComboBoxSelectedIndexChangedEventArgs e)
    {
 
        RadComboBox rdFormatoAbertoComprimento = (sender as RadComboBox);
        GridDataItem item = FindParentOfType<GridDataItem>(rdFormatoAbertoComprimento);
        TextBox txtFormatoFechadoLargura = (TextBox)item.FindControl("txtFormatoFechadoLargura");
        TextBox txtFormatoFechadoComprimento = (TextBox)item.FindControl("txtFormatoFechadoComprimento");
         
         
        char[] delimiterChars = { ' ', ',', '.', ':', '\t' };
        string[] words = e.Text.Split(delimiterChars);
 
        txtFormatoFechadoLargura.Text = words[0];
        txtFormatoFechadoComprimento.Text = words[2];
    }
Tags
Grid
Asked by
Mário Alessand Gonçalves Oliveira
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 1
Mário Alessand Gonçalves Oliveira
Top achievements
Rank 1
Sebastian
Telerik team
Share this question
or