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

EditMode TextArea fires OnTextChanged autonomous

1 Answer 122 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Marc
Top achievements
Rank 1
Marc asked on 06 Sep 2011, 11:40 AM
Hi Telerik-Team,

Information:
I am just working on a DNNModule containing a simple flat Grid.
I implemented a Button to get all Items in the Grid in EditMode at the same time. This is working correctly.
Now I implemented a OnTextChanged-Event on every Textbox in the EditForm and in this Event I want to close all other EditForms but leave opened my current Form where I currently changed a value in a Textbox.

Problem:
Now I noticed that all Textboxes are correctly working in the Editforms concerning the OnTextChanged-Event. Instead of one:
I noticed that a Textbox with "TextMode=MultiLine" (TextArea) working not correctly it fires the OnTextChanged-Event but I dindt enter anything it this textbox.

for example (these are GridRows all in EditMode:
1. [TextBox], [Label], [TextArea]
2. [TextBox], [Label], [TextArea]
3. [TextBox], [Label], [TextArea]

Now if I enter some data in the TextBox 3 and get out with the Focus the TextArea 1 is fireing a OnTextChanged-Event.
But I changed the Text only in TextBox3 not in TextArea1.
My Problem is that now the Event will close the EditForm of row 2 and 3 and leave the editform of Row1 opened. But I just want to leave the row3 in EditMode and close 1 and 2. the Event in TextArea is fireing itself autonomous
I noticed that there are some JavaScript "OnChange" Entires in the TextArea:
javascript:setTimeout('WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions
("dnn$ctr417$myUserControl$myGrid$ctl00$ctl07$myTextArea", "", true, "", "", false, true))', 0)

Is it possible that this javascript is fireing the OnTextChanged event? And if Why does the Grid create this OnChange-Event?

I appreciate getting hints or tips from you.


best regards,

Marc

1 Answer, 1 is accepted

Sort by
0
Vasil
Telerik team
answered on 12 Sep 2011, 08:47 AM
Hello Marc,

I tried to reproduce the problem using the code below, but on my side everything work as expected and TextChanged event is fired only when the text is really changed.
Could you confirm that you use the latest version of RadControls?

Aspx:
<telerik:RadTextBox runat="server" ID="RadTextBox1" TextMode="MultiLine" OnTextChanged="RadTextBox_TextChanged">
</telerik:RadTextBox>
<telerik:RadTextBox runat="server" ID="RadTextBox2" TextMode="MultiLine" OnTextChanged="RadTextBox_TextChanged">
</telerik:RadTextBox>
<asp:Label runat="server" ID="Label1"></asp:Label>
<asp:Button runat="server" Text="PostBack" />
C#
protected void RadTextBox_TextChanged(object sender, EventArgs e)
{
    Label1.Text += (sender as RadTextBox).ID + " ";
}

Greetings,
Vasil
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Tags
Grid
Asked by
Marc
Top achievements
Rank 1
Answers by
Vasil
Telerik team
Share this question
or