Click here to Skip to main content
15,908,906 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i m creating a Composite control in which ....

C#
public RadGrid Grid = new RadGrid();
 private RadTextBox txtbox = new RadTextBox();

 protected override void CreateChildControls()
        {
txtbox.TextChanged += new EventHandler(txtbox_TextChanged);

 Controls.Add(txtbox);
 Controls.Add(Grid);
 txtbox.AutoPostBack = true;
 txtbox.Attributes.Add("onkeyup","SendTextBox():"); 

}

 protected override void OnPreRender(EventArgs e)
        {
            ClientScriptManager cs = Page.ClientScript;
          
            cs.RegisterStartupScript(this.GetType(), "SendTextBox", "setTimeout('__doPostBack(\'" + txtbox.ID + "\',\'\')', 0);", true);
            base.OnPreRender(e);
        }

  protected void txtbox_TextChanged(object sender, EventArgs e)
        {
          // code for searching in grid 
            Grid.Rebind();
        }
when i write in txtbox ...txtbox_textChanged event is not fired ..Please Help
Posted
Updated 6-Mar-14 20:36pm
v3
Comments
BillWoodruff 7-Mar-14 4:56am    
I'm always curious when I see questions here from people using the very expensive Telerik technology why you don't ask a question on Telerik's user forums which (I am told) have a pretty good reputation.
MAYANK GEETE 7-Mar-14 5:10am    
its not necessary 4 me to use Telerik component...if u have any solution regarding this using a simple UI control only...then please let me know i ll b grateful...

i have tried using UI control too....but its not working 4 me...

Please Add Autopostback=true for that Textbox then the textchanged event will work for sure.
u can change it in the property of that control.
 
Share this answer
 
Comments
MAYANK GEETE 7-Mar-14 2:26am    
i have already done this as you can see in CreateChildControls() ..Thanks
MAYANK GEETE 7-Mar-14 2:26am    
still not working
Check some of steps
1. If you have used any requiredfied validato or reqular expression (Client Validation)
Then mention in your textbox property CauseValidation="false"
2. Autopostback="true" in textbox property
Hope this will help you
 
Share this answer
 
Comments
MAYANK GEETE 7-Mar-14 3:49am    
Nop's i m not using any validation ...and i have already used autopostback=true on createchildcontrol() method

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900