Hi
I have a simple webdropdown that i set up in code behind in the page_load as follows:-
If Not IsPostBack
Then
myTable = myDataServer.GetDataTable(
"select * from tblPersonnelTest"
)
Me.WDDTest.EnablePaging =
True
Me
.WDDTest.PageSize = 2
.WDDTest.DataSource = myTable
Me.WDDTest.TextField =
"name"
Me.WDDTest.ValueField =
"PersonnelId"
me.wddtest.EnableViewState = True
Me.WDDTest.EnableAjaxViewState =
Me.WDDTest.EnableMultipleSelection =
Me.WDDTest.EnableLoadOnDemand =
False
Me.WDDTest.EnableAutoFiltering = Infragistics.Web.UI.ListControls.AutoFiltering
.Server
Me.WDDTest.DropDownContainerHeight = Unit
.Pixel(300)
else
'rebind webdropdown to datasource.
end if
My problems are when I page through the various pages I loose any selections I have already made in earlier pages?
This is beacuse if I dont rebind the control on postback to the datasource, when I try and go to the next page it always displays the first page of data?
So what should the recommended settings be for a webdropdown that has enabledpaging and has a multiselection option turned on? and what will I need to put in the code behind for these settings to work.
regards
Kevin
Hello Kevin,
Currently only the grids (WebDataGrid and WebHierarchicalDataGrid) support cross page selection
http://help.infragistics.com/NetAdvantage/ASPNET/2011.1?page=WebDataGrid_Persistent_Selection.html
In your scenario I recommend you using LoadOnDemand and disabling the Paging
protected void Page_Load(object sender, EventArgs e)
{
WebDropDown1.DataSource = MakeTable();
WebDropDown1.TextField = "Item";
WebDropDown1.ValueField = "id";
WebDropDown1.DropDownItemBinding.ValueField = "id";
WebDropDown1.DropDownItemBinding.TextField = "Item";
WebDropDown1.EnablePaging = false;
WebDropDown1.EnableLoadOnDemand = true;
WebDropDown1.EnableAjaxViewState = true;
WebDropDown1.EnableMultipleSelection = true;
WebDropDown1.EnableAutoFiltering = Infragistics.Web.UI.ListControls.AutoFiltering.Server;
WebDropDown1.EnableViewState = true;
WebDropDown1.EnableClosingDropDownOnSelect = false;
}
Let me know if you need further assistance regarding this.