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

Telerik control postback event hierarchy

6 Answers 109 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Elango
Top achievements
Rank 1
Elango asked on 18 Sep 2008, 12:08 AM
Hello,
       We have a issue with telerik controls while the page is postbacked. Here is the situation. We have a telerik combobox followed by telerik text boxes and a asp button. Telerik combobox has a OnSelectedIndexChanged event and the telerik boxes its own OnTextChanged events. When we hit server click event of asp button it first fires all the text change events and then it goes to combobox. It is not going in control order. We have a few things doing on combobox change event as it occurs last we are not able to proceed. If we replace standard asp combobox and asp textbox then it goes in the order. Is this is a know issue. Please let me know. Below is my sample test application where i faced this problem. 

Regards,
Elango

<

asp:ScriptManager ID="ScriptManager1" runat="server" />

<div>

<asp:DropDownList ID="ddl" runat="server"

onselectedindexchanged="ddl_SelectedIndexChanged">

<asp:ListItem Text="test1">

</asp:ListItem>

<asp:ListItem Text="test2"></asp:ListItem>

<asp:ListItem Text="test3"></asp:ListItem>

</asp:DropDownList>

<asp:Button ID="btn" Text="button" runat ="server" />

<telerik:RadComboBox ID = "TypeComboBox" runat="server" MarkFirstMatch= "True" Width = "225px"

Skin="Vista" OnTextChanged="TypeComboBox_TextChanged"

OnSelectedIndexChanged="TypeComboBox_SelectedIndexChanged">

<CollapseAnimation Type = "OutQuint" Duration = "200" ></CollapseAnimation>

<Items>

<telerik:RadComboBoxItem Text="A" />

<telerik:RadComboBoxItem Text="B" />

</Items>

</telerik:RadComboBox>

<telerik:RadTextBox ID="RateTextBox" runat="server" OnTextChanged="RateTextBox_TextChanged"

MaxLength="30" Skin="Default" Width="225px"></telerik:RadTextBox>

 

<telerik:RadTextBox ID = "NameTextBox" runat = "server" OnTextChanged = "NameTextBox_TextChanged" Width="225"

Skin = "Default" MaxLength="30"></telerik:RadTextBox>

<asp:TextBox ID="txt" OnTextChanged="txt_TextChanged" runat="server"></asp:TextBox>

</div>


c# 

protected

void ddl_SelectedIndexChanged(object sender, EventArgs e)

{

Response.Write(ddl.Text);

}

protected void TypeComboBox_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e)

{

Response.Write(e.Text);

}

protected void NameTextBox_TextChanged(object sender, EventArgs e)

{

Response.Write(((

RadTextBox)sender).Text);

}

protected void RateTextBox_TextChanged(object sender, EventArgs e)

{

Response.Write(((

RadTextBox)sender).Text);

}

protected void TypeComboBox_TextChanged(object sender, EventArgs e)

{

Response.Write(

"text change");

}

protected void txt_TextChanged(object sender, EventArgs e)

{

Response.Write(

"asp text change");

}

6 Answers, 1 is accepted

Sort by
0
Rosi
Telerik team
answered on 18 Sep 2008, 12:27 PM
Hi Elango,

Please find the attached build and let us known how this goes.


Regards,
Rosi
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Elango
Top achievements
Rank 1
answered on 18 Sep 2008, 04:22 PM
Hi Rosi,
      let me check with this hotfix and let you know my results.

Regards,
Elango
0
Elango
Top achievements
Rank 1
answered on 18 Sep 2008, 04:35 PM
Hi Rosi,
       I checked using the two different dlls (under bin and bin35) on that hotfix zip file. But still it executes in the same manner. First it executes the textbox and then it gets into combobox. Please let us know a fix asap as this is blocking few things for us here.

Regards,
Elango
0
Rosi
Telerik team
answered on 23 Sep 2008, 07:16 AM
Hi Elango,

Please find the attached project which works as expected at our side. This project uses the fix. Could you still reproduce the problem using this project? If so, could you please send us steps to reproduce the issue using the attached project?

Regards,
Rosi
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Elango
Top achievements
Rank 1
answered on 21 Oct 2008, 07:29 PM
Hi,
       Please use the same project that you sent earlier. Just remove the Autopostback property for both asp.net drop down and radcombobox. Try executing and you can see the behviour happens different for radcombobox compared with asp.net drop down list. I just modified the project that you sent earlier (ddl version :2008.2.917.20).  Just execute the following steps twice (once using asp.net drop down list and second time using radcombobox).

1. Select a value from drop down
2. Fill the text box values
3. click the button

The event fires in the below order

ddl_SelectedIndexChanged
NameTextBox_TextChanged
RateTextBox_TextChanged
txt_TextChanged

If you execute the same event using radcombo box. The events executes in ths order

NameTextBox_TextChanged
RateTextBox_TextChanged
txt_TextChanged
TypeComboBox_SelectedIndexChanged
TypeComboBox_TextChanged

The first order is the correct one and if i am right then the second one using the radcombobox also should use the same order  as the control order is same for both.

Because of this we are having few serious issues. Please do let me know if you have a fix for this.

Regards,
Elango

For your reference still attaching the code below


 

<%

@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

 

<%

@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>

 

 

 

 

<!

DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

 

<

html xmlns="http://www.w3.org/1999/xhtml">

 

<

head runat="server">

 

 

 

 

 

<title></title>

 

</

head>

 

<

body>

 

 

 

 

 

<form id="form1" runat="server">

 

<

asp:ScriptManager ID="ScriptManager1" runat="server" />

 

 

 

 

 

<div>

 

 

 

 

 

<asp:DropDownList ID="ddl" runat="server" OnSelectedIndexChanged="ddl_SelectedIndexChanged">

 

 

 

 

 

<asp:ListItem Text="test1">

 

 

</asp:ListItem>

 

 

 

 

 

<asp:ListItem Text="test2"></asp:ListItem>

 

 

 

 

 

<asp:ListItem Text="test3"></asp:ListItem>

 

 

 

 

 

</asp:DropDownList>

 

 

 

 

 

<asp:Button ID="btn" Text="button" runat="server" />

 

 

 

 

 

<telerik:RadComboBox ID="TypeComboBox" runat="server" MarkFirstMatch="True" Width="225px"

 

 

 

 

 

Skin="Vista" OnTextChanged="TypeComboBox_TextChanged" OnSelectedIndexChanged="TypeComboBox_SelectedIndexChanged">

 

 

 

 

 

<CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>

 

 

 

 

 

<Items>

 

 

 

 

 

<telerik:RadComboBoxItem Text="A" />

 

 

 

 

 

<telerik:RadComboBoxItem Text="B" />

 

 

 

 

 

</Items>

 

 

 

 

 

</telerik:RadComboBox>

 

 

 

 

 

<telerik:RadTextBox ID="RateTextBox" runat="server" OnTextChanged="RateTextBox_TextChanged"

 

 

 

 

 

MaxLength="30" Skin="Default" Width="225px">

 

 

 

 

 

</telerik:RadTextBox>

 

 

 

 

 

<telerik:RadTextBox ID="NameTextBox" runat="server" OnTextChanged="NameTextBox_TextChanged"

 

 

 

 

 

Width="225" Skin="Default" MaxLength="30">

 

 

 

 

 

</telerik:RadTextBox>

 

 

 

 

 

<asp:TextBox ID="txt" OnTextChanged="txt_TextChanged" runat="server"></asp:TextBox>

 

 

 

 

 

</div> </form>

 

</

body>

 

</

html>

 

 


code behind :- 

 

using

System;

 

 

 

 

using

System.Collections.Generic;

 

 

 

 

using

System.Linq;

 

 

 

 

using

System.Web;

 

 

 

 

using

System.Web.UI;

 

 

 

 

using

System.Web.UI.WebControls;

 

 

 

 

using

Telerik.Web.UI;

 

 

 

 

public

partial class _Default : System.Web.UI.Page

 

{

 

protected void Page_Load(object sender, EventArgs e)

 

{

}

 

protected void ddl_SelectedIndexChanged(object sender, EventArgs e)

 

{

Response.Write(ddl.Text);

}

 

 

 

protected void TypeComboBox_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e)

 

{

Response.Write(e.Text);

}

 

 

 

protected void NameTextBox_TextChanged(object sender, EventArgs e)

 

{

Response.Write(((

RadTextBox)sender).Text);

 

}

 

 

 

protected void RateTextBox_TextChanged(object sender, EventArgs e)

 

{

Response.Write(((

RadTextBox)sender).Text);

 

 

}

 

 

 

protected void TypeComboBox_TextChanged(object sender, EventArgs e)

 

{

Response.Write(

"text change");

 

 

}

 

 

 

protected void txt_TextChanged(object sender, EventArgs e)

 

{

Response.Write(

"asp text change");

 

 

}

}

 

 

0
Rosi
Telerik team
answered on 22 Oct 2008, 02:19 PM
Hi Elango,

Thank you for bringing this to our attention.

We have managed to find the problem and fix it. Please find attached our latest build and try it.

Your points have been updated for your involvement.

Regards,
Rosi
the Telerik team

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