Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
75
how to find controls in the template feild of webDropDown from C# code behind
posted

im using NetAdvantage 9.1 ASP.NET AJAX CLR3x , i am not able to find control in the webdropdown template.

 protected void wddArtist_ItemBound(object sender, DropDownItemBoundEventArgs e)

{

DropDownItem  DI = e.Value;

 

Image I = (Image)DI.FindControl("imgArtist");

 

 DropDropDownItem.FindControl("")  always return null value on item bound event of webDropDown, any one try this plz help me in this issue , i want to bind a image and the item text  to label dinamically on item bound event.

Parents
  • 695
    Verified Answer
    posted

    Hello,

    you can try calling EnsureTemplate() method.

        void WebDropDown1_ItemBound(object sender, Infragistics.Web.UI.ListControls.DropDownItemBoundEventArgs e)
        {  
            DropDownItem item = (DropDownItem)e.Value;
            item.EnsureTemplate();
            Label lbl = (Label)item.FindControl("Label1");
        }

    Regards,
    Nikolai Dimitrov

Reply Children
No Data