[CLOSED] How to find all the dynamically generated Ext controls inside a Ext.panel in codebehind

  1. #1

    [CLOSED] How to find all the dynamically generated Ext controls inside a Ext.panel in codebehind

    Hello,
    Can you please show me how to acess all the dynamically generated Ext.Comobo controls inside a Ext.panel?
    I tried using this code in the codebehind but with no success.
     Ext.Net.Utilities.ControlUtils.FindChildControls<ComboBox>(this.Page.Form);
    It always return 0 controls found. I have about 20 ComboBox controls inside the Ext.Panel control.

    Thanks in advance for your help!
    Last edited by Daniil; May 06, 2014 at 5:13 AM. Reason: [CLOSED]
  2. #2
    Hello,

    Dynamically generated controls are not automatically added to the Page's Controls Collection during subsequent requests. If you add the Control to the Collection during one request, and not add it during the next request, calling .FindControls is not going to find it.
    Geoffrey McGill
    Founder
  3. #3
    Ok. I see.
    Instead of .FindControls, is there any way to reference those controls?

    Quote Originally Posted by geoffrey.mcgill View Post
    Hello,

    Dynamically generated controls are not automatically added to the Page's Controls Collection during subsequent requests. If you add the Control to the Collection during one request, and not add it during the next request, calling .FindControls is not going to find it.
  4. #4
    If you have a list of .ID's, you should be able to use X.GetCmp.

    Hope this helps.
    Geoffrey McGill
    Founder
  5. #5
    Thank you! using X.GetCmp works for me.

    Quote Originally Posted by geoffrey.mcgill View Post
    If you have a list of .ID's, you should be able to use X.GetCmp.

    Hope this helps.

Similar Threads

  1. Replies: 0
    Last Post: Nov 28, 2012, 8:08 AM
  2. Windows inside of a Panel Dynamically
    By rodrigo.borges in forum 2.x Help
    Replies: 0
    Last Post: Aug 27, 2012, 6:50 PM
  3. Replies: 2
    Last Post: Dec 15, 2011, 11:58 AM
  4. Replies: 13
    Last Post: Jul 29, 2011, 4:24 AM
  5. Replies: 4
    Last Post: Jan 31, 2011, 12:39 AM

Posting Permissions