Template Postback not happening

2 posts, 0 answers
  1. Baatezu
    Baatezu avatar
    110 posts
    Member since:
    Aug 2007

    Posted 08 Dec 2008 Link to this post

    I have added templates at runtime to my menu and that works fine.
    The template includes a RadTextBox that I want to do a postback on TextChanged.
    in the InstantiateIn function I have
                    radTextBox.TextChanged += new EventHandler(radTextBox_TextChanged); 
    This works the first time it is called. Subsequent changes to the text cause a postback, but it does not seem that the TextChanged function is called.
                void radTextBox_TextChanged(object sender, EventArgs e) 
                { 
                    RadTextBox target = (RadTextBox)sender; 
                    if (target.BackColor == System.Drawing.Color.Red || target.BackColor == System.Drawing.Color.Green) 
                    { 
                        target.BackColor = System.Drawing.Color.Green; 
                    } 
                    else 
                    { 
                        target.BackColor = System.Drawing.Color.Red; 
                    } 
                } 
    The backcolor of the RadTextBox starts as white, turns red on a postback and doesn't change again when I change the text more.

    I'm pretty lost on what to try to get the text changed to call properly more than the first time. Any pointers would be greatly appreciated.
  2. Baatezu
    Baatezu avatar
    110 posts
    Member since:
    Aug 2007

    Posted 08 Dec 2008 Link to this post

    OK - It was happening, I think there is an order of events issue that the red backcolor wasn't getting re-set before the textchanged function was getting called. I modified it to check for specific texts (yellow/blue/ect) and it changes to those each time.
Back to Top