开发者

Webcombo return error when trying to populate based on another WebCombo

This has gotten me completely frustrated

I have a few webcombo boxes that are hierachial:

Continent Country

When the form loads everything works fine, when I change the continent the first time, the country repopulates correctly. However if I change the continent a second time I receive an error:

Specified argument was开发者_开发知识库 out of the range of valid values.Parameter name: The DataValueField of ValueField was not found in the Columns collection. 

Can anyone tell me why?

P.S. This is all I have in the Page_Load event

            if (!IsPostBack)
        {
            this.Load_AreaList();
            this.Load_AreasOfInterest();
            this.Load_Degrees();
            this.Load_GenderList();
            this.Load_ParticipationDateModifiers();
            this.Load_ProgramCategories(nEventID);
            this.Load_YesNoList();
            this.Load_ParticipantInformation(nParticipantID); 
        }

Also this happens in another part of the form with another Country webcombo which is supposed to populate a state combo box.


In many cases, columns in database tables return null when no value is stored in that column. However, a null value can present challenges when you are working with ASP.NET code or with data-bound Web controls. For example, an exception is thrown if you try to bind the SelectedValue of a DropDownList control to null. If this is not the case change AppendDataBoundItems property. The AppendDataBoundItems property allows you to add items to the ListControl object before data binding occurs. After data binding, the items collection contains both the items from the data source and the previously added items.

Let me know if it works...

s

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜