Programmatically created WebCombo issues after upgrading

1 reply. Last post: April 6, 2017 3:00 PM by Dimitris Β.
Tags :
  • (None)
  • New Discussion
  • New Question
  • New Product Feedback
Dimitris Β.Member

Hello,

In our project we use WebCombo 6.0 integrated in a WebGrid 9. Data source and columns are assigned at runtime based on the current setup for both WebGrid and WebCombos.

The scenario we used for many years and worked fine assigns the datasource to a web combo at the InitializeDatasource event. In there, a data table is assigned to the .datasource property of WebCombo. After this, WebComboColumn objects are created programmatically and added to WebCombo columns property since not all datasource's columns need to be displayed. Additionally at this step, captions are assigned.

A few days ago, we upgraded to WebGrid 10 and WebCombo 7 (Premier studio 2016 R1) in order to deal with the problem in the latest version of Firefox where editing was not working on WebGrid. We applied successfully the patch you mention in another thread and everything worked almost ok.

The aforementioned scenario does not work anymore. Whenever a WebGrid page is loaded that contains one or more WebCombos, we get the following error:

An item with the same key has already been added.

   at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)

   at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)

   at ISNet.WebUI.ISCollectionBase.IntInsert(Int32 index, INamedObject value)

   at ?.?ž.(DataView ??)

   at ?.?ž.??(DataView


, String Š?)

   at ISNet.WebUI.WebCombo.WebCombo.DataBind()

   at ISNet.WebUI.WebCombo.WebCombo.OnInitializeDataSource(Object dataSource, Boolean isFlyRequest, String queryText, Int32 startRow, Int32 endRow, Int32 rowCount, String additionalFilters, Boolean isDDClicked)

   at ISNet.WebUI.WebCombo.WebCombo.OnLoad(EventArgs e)

   at System.Web.UI.Control.LoadRecursive()

   at System.Web.UI.Control.LoadRecursive()

   at System.Web.UI.Control.LoadRecursive()

   at System.Web.UI.Control.LoadRecursive()

   at System.Web.UI.Control.LoadRecursive()

   at System.Web.UI.Control.LoadRecursive()

   at System.Web.UI.Control.LoadRecursive()

   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

  

I assume that after the call of our InitializeDatasource handler, combo columns are created by the framework itself resulting to duplicates.

Apparently we need to adapt our way of dealing with the component's events but we haven't come up with something up to now.

This is a quite urgent problem so any help would be appreciated,

 Regards,

 Dimitris

All times are GMT -5. The time now is 1:41 AM.
Previous Next