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

AutoPostBack not firing, please help!

2 Answers 257 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
rich
Top achievements
Rank 1
rich asked on 21 Oct 2008, 11:03 AM
Hi all,
I have just started developing with telerik and am having an issue with the autopostback.
I have a ddl with 3 columns; when the user selects an option from the ddl the page should postback and I would expect it to use the server-side SelectedIndexChanged method.
It postbacks, loading the Page_Load, though does not hit my SelectedIndexChanged method.

My Code:
<%@ Register TagPrefix="rad" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %> 
 
            <rad:RadComboBox ID="ddlAccount" Skin="WindowsXP" runat="server" Height="190px" AutoPostBack="true"
                Width="300px" EnableEmbeddedSkins="false" > 
                <ItemTemplate> 
                    <table style="text-align: left;"
                        <tr> 
                            <td style="width:175px;"
                                <%# DataBinder.Eval(Container,  "DataItem.AccountName") %> 
                            </td> 
                            <td style="width:75px;"
                                <%#DataBinder.Eval(Container, "DataItem.City")%> 
                            </td> 
                            <td> 
                                <%#DataBinder.Eval(Container, "DataItem.IsTarget")%> 
                            </td> 
                        </tr> 
                    </table> 
                </ItemTemplate> 
            </rad:RadComboBox>   

Code behind:
    Protected Sub ddlAccount_SelectedIndexChanged(ByVal o As ObjectByVal e As Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs) Handles ddlAccount.SelectedIndexChanged 
 
      'My code here.... 
 
    End Sub 

I have tried adding  OnSelectedIndexChanged="ddlAccount_SelectedIndexChanged" to the aspx side though with no difference.

Can anyone help?

Thanks in advance

2 Answers, 1 is accepted

Sort by
0
rich
Top achievements
Rank 1
answered on 21 Oct 2008, 11:50 AM
OK,
I carried on working on this problem, and have managed to get it to work.
Adding teh DataTextField & DataValueField seems to have fixed it!

            <rad:RadComboBox ID="ddlAccount" Skin="WindowsXP" runat="server" Height="190px" AutoPostBack="true" 
                Width="300px" EnableEmbeddedSkins="false" MarkFirstMatch="true" HighlightTemplatedItems="true" DataTextField="AccountName" DataValueField="AccountID"
                <ItemTemplate> 
                    <table style="text-align: left;"
                        <tr> 
                            <td style="width:175px;"
                                <%# DataBinder.Eval(Container,  "DataItem.AccountName") %> 
                            </td> 
                            <td style="width:75px;"
                                <%#DataBinder.Eval(Container, "DataItem.City")%> 
                            </td> 
                            <td> 
                                <%#DataBinder.Eval(Container, "DataItem.IsTarget")%> 
                            </td> 
                        </tr> 
                    </table> 
                </ItemTemplate> 
            </rad:RadComboBox> 
0
Paul
Telerik team
answered on 21 Oct 2008, 11:54 AM
Hello rich,

We tried to reproduce the reported issue on our side, but to no avail. I think it will be best if you can open a support ticket and send us a simple running project (incl. CSS, images, skins, DB backup if needed and so on) demonstrating the problem (and step-by-step instructions on doing so). In that way we can reproduce and pinpoint the problems you're facing on our side, understand the logic of your application and provide a solution.

Thanks beforehand for your patience and cooperation,
Paul
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
ComboBox
Asked by
rich
Top achievements
Rank 1
Answers by
rich
Top achievements
Rank 1
Paul
Telerik team
Share this question
or