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
Page_Load is too late to hook up the InitializeDataSource event. During its AJAX callbacks, the InitializeDataSource event occurs before Page_Load, which is why your additional rows don't load on demand.
Try doing this in Page_Init instead:
private void Page_Init(object sender, EventArgs e){ this.WebCombo1.InitializeDataSource += new InitializeDataSourceEventHandler(WebCombo1_InitializeDataSource);}
You should also remove the call to DataBind() in your InitializeDataSource event handler. A DataBind() is performed implicitly when this event is handled. Leaving it as-is won't prevent WebCombo from working, but you'll avoid some redundant processing by removing that line.