Wednesday, January 20, 2010

Fill drop down menu control inside details view using asp.net 2?

I used a details view in asp.net2 using c# . I want to add a drop down list as field inside. this ddl takes its items from enumerated data type by a function FillLookupCombo, but the ddl is never filled with the values. an error appears saying that the object has no reference :(


..Please Help me..Fill drop down menu control inside details view using asp.net 2?
Without seeing your code, it's difficult to figure out your problem. As a rule, if you are not using Option Strict, you can late-bind such controls by using a TemplateColumn and calling your function inline:





%26lt;asp:TemplateColumn%26gt;


%26lt;ItemTemplate%26gt;


%26lt;asp:DropDownList runat=';server'; ID=';theList'; DataSource='FillLookupCombo()' DataTextField=';somefield'; DataValueField=';somefield'; /%26gt;


%26lt;/ItemTemplate%26gt;


%26lt;/asp:TemplateColumn%26gt;

No comments:

Post a Comment