Hi there
Normal 0 MicrosoftInternetExplorer4 /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin:0cm; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman";}
Somebody can help me with the load-on-demand feature at run time in v8.2 of WebCombo. I’m following the help guidelines but something might be wrong, the Combo doesn’t load on demand, only the first required rows, in this case 10, when you scroll down dosn't load the other records. Here you can see the code:
protected void Page_Load(object sender, EventArgs e) { this.WebCombo1.EnableXmlHTTP = true; this.WebCombo1.DisplayValue = "ShortName"; this.WebCombo1.DataTextField = "ShortName"; this.WebCombo1.DataValueField = "CCode"; this.WebCombo1.DropDownLayout.RowsRange = 10; this.WebCombo1.InitializeDataSource += new InitializeDataSourceEventHandler(WebCombo1_InitializeDataSource); }
void WebCombo1_InitializeDataSource(object sender, WebComboEventArgs e) { //Here I load a dataset with the table Countries
this.WebCombo1.DataSource = _datasetmain.Tables["LUP_Countries"].DefaultView; this.WebCombo1.DataBind(); }
I'll appreciate any help.
regards
As I stated in my previous post, my initial impression is that it shouldn't be necessary to call DataBind() at the end of the InitializeDataSource event handler. It does so implicitly when you handle this event. Calling DataBind() in this event causes extra overhead, and so decreases performance; it may have other effects that depend on what you're doing in your application.
More than this will likely require some in-depth research. I suggest you submit a support request and attach a sample project that we can run and debug that demonstrates the issue you've described.
Hi Vince,
I would like to know if you have any thoughts regarding my post of the 12 Feb 2009 18:20 , on this thread.
Thanks.-
For VB.NET, you'll generally declare your event handler method with the "handles" keyword.
Private Sub WebCombo1_InitializeDataSource(ByVal sender as Object, ByVal e as InitializeDataSourceEventArgs) Handles WebCombo1_InitializeDataSource
If you need to use code to establish the event handler, use the "AddHandler" statement. The syntax is as follows:
AddHandler WebCombo1.InitializeDataSource, AddressOf WebCombo1_InitializeDataSource
Vince - Can you provide the syntax for this same code in VB.Net? Thanks.
Hi,
Regarding the recomendation of not calling the DataBind() on the InitializeDataSource event handler, i would like to point a weird issue that i found.
When i read this recomendation, i proceeded to apply it on my application. But happen that some of my webcombos started to act weird.
I finaly found, that for this combos that were failing, in the InitializeDataSource event handler, after set the DataSource, an addiotinal element was being added to the WebCombo. And if I wouldnt perform the DataBind() the combo would show wrong the information, lets say if the DataSource would have 2 elements, what the combo would show in the list would be, first the item that was being added later, and then the second item of the DataSource.
Now this doesnt make any sense to me. Because after all i see the other combos working, so it means the DataBind is being perform as in this thread is indicated. And i dont see what is the difference if i add at the end of the event handler an extra DataBind.
Besides, I tried the DataBind after i set the DataSource and before It added the extra item, and it works fine too.
I would like to know if there is any special reason i would have to add a DataBind at the end of the InitializeDataSource event handler, Doest it makes any difference? I mean now i would have 2 DataBinds being performed at the end of the InitializeDataSource event handler.
Regards.-