Hi,
i'm trying WebDropdown. My wanted test : WebDropDown with DataTable binding on serverside + Paging + Filtering (contains).
WebDropDown has
EnableViewState set to TrueAutopostback set to trueEvent SelectionChanged set to a function
DataSource is bound in Page_load when IsPostback=false
So here my states :
- WebDropDown is well filled but paging stay on first page whatever #page I choose- Selection is working- Filtering does'nt work @ all
if I bind Datasource whatever PostBack is set, so :
- Paging is working but it selects the first item and fires event (Why ? oO)- Selection is working but WebDropDown is reset (logical because DataSource is rebound)- if I type a text to filter , WebDropDown is reset because an event is fired but I don't know what event.
How to use WebDropDown like I want ?
Thanks
You can refer to this sample:
http://samples.infragistics.com/2010.3/WebFeatureBrowser/contents.aspx?showCode=true&t=WebDropDown/ProgramaticDataBinding/WebDropDown_DataTable.aspx~srcview.aspx?path=~srcview.aspx?path=WebDropDown/ProgramaticDataBinding/WebDropDown_DataTable.src
Let me know if it helps.
Angel
Thanks but I've already run all samples about WebDropDown but any of them combine all of options.
The sample you gave me only shows how to bind with a DataTable and paging. If we add Filtering & Server Click in this sample, problems occur as described above.
Hello UCF_User,
By setting Autopostback="true" you force post backs on every event.
if I type a text to filter , WebDropDown is reset because an event is fired but I don't know what event
In this case you have value changed is fired. So AutoPostBack flags should be set to false in order to avoid this.
I do recommend you to use your second approach by setting DataSource every time.
In order to get advantage of the filtering you should set current value to be empty string on PreRender.
http://samples.infragistics.com/2010.2/WebFeatureBrowser/contents.aspx?showCode=true&t=WebDropDown/WebDropDownFiltering.aspx~srcview.aspx?path=~srcview.aspx?path=WebDropDown/WebDropDownFiltering.src
You can use the sample provided by Angel in order to bind the WebDropDown to DataTable.
So a very simple example how to combine all the options is shown in the code snippet below:
<ig:WebDropDown ID="WebDropDown1" runat="server" Width="200px" EnablePaging="true"
PageSize="10" ValueField="ID" TextField="Name" StyleSetName="Office2007Black"
EnableAutoFiltering="Server" EnableAutoCompleteFirstMatch="false" OnSelectionChanged="WebDropDown1_SelectionChanged"
OnPreRender="WebDropDown1_PreRender" EnableViewState="true">
</ig:WebDropDown>
protected void Page_Load(object sender, EventArgs e)
{
DataTable dt = new DataTable("Parent");
dt.Columns.Add("ID", typeof(int));
dt.Columns.Add("Name", typeof(string));
for (int i = 0; i < 100; i++)
dt.Rows.Add(new object[] { i, "Row " + i.ToString()});
}
WebDropDown1.DataSource = dt;
protected void WebDropDown1_SelectionChanged(object sender, Infragistics.Web.UI.ListControls.DropDownSelectionChangedEventArgs e)
protected void WebDropDown1_PreRender(object sender, EventArgs e)
WebDropDown1.CurrentValue = "";
Let us know if you need further assistance.
Can you please tell me how you get ig:WebDropDown to resolve? For me I cannot get my markup to recognise ig:
Many thanks,
Kevin
Also can we use this with a HtmlHelper?