Hi all,
I trying to Use a Webdropdown. when i am Trying to Bind the Control with the Datatable setting its TextField and Value Field , it is showing the Values For the First Time and From the Next time it is Showing empty Text and Value though I am able to List items it is showing Empty Text.
it would be Great if you can Even Help me with this. My work would be almost Done.
FYI
protected void WebDropDown1_ValueChanged(object sender, Infragistics.Web.UI.ListControls.DropDownValueChangedEventArgs e) {
WebDropDown2.Items.Clear(); DataTable dt = new DataTable(); dt.Columns.Add("name", typeof(string)); dt.Columns.Add("id", typeof(int)); DataRow dr = dt.NewRow(); dr["name"] = Convert.ToString("test" + DateTime.Now.ToString()); dr["id"] = Convert.ToInt32(1); dt.Rows.Add(dr); dr = dt.NewRow(); dr["name"] = Convert.ToString("test12" + DateTime.Now.ToString()); dr["id"] = Convert.ToInt32(1); dt.Rows.Add(dr); WebDropDown2.DataSource = dt; WebDropDown2.TextField = "name"; WebDropDown2.ValueField = "id"; WebDropDown2.DataBind(); DIV1.Controls.Add(WebDropDown2);
}
For the First time It is showing the Value but for the next it is Showing. Please do the needful
Thanks & regards
BK
Hello,
This code works fine for me. But why would you want to rebind the items list in the ValueChanged event ?
Do you use some templating as well ?
Best,
Angel
Hi angel,
Thanks for the Reply. I would like to Thank you for the support that Yesteraday you Gave.
if Templating Means the Textfield and valueFields then yes I will be using the Same Templating.
and I have to Rebind the Values to the Dropdown Every time as My need Requires that. becoz when There is a Selection in the First Dropdown, based on which the second dropdownlist should Populate like the Cascading Dropdowns. (Fyi : I tried the Cascading sample which is there in the samples of 2009 but there also I am getting the same Problem. )
and I am using the UpdatePanel as discussed yesteraday in the Last post :
http://forums.infragistics.com/forums/p/25877/95076.aspx#95076
if possible please attach the sample with the updatepanel in which multiselection webdropdown placed as the First Dropdown and based on the selection of the First Dropdown fill the Seconddropdown which is a Normal webdropdown. all this should happen async...
Angel one more Small request i would great if you can look at this http://forums.infragistics.com/forums/p/25920/95086.aspx#95086 post also
And also Some time... Even Now also that javascript error which i Mentioned in the First post of Mine i coming up.. can u also tell me if there is some thing that i can do with that...
BK....
Hi,
Attached is a WebSite which uses your code to achieve the cascading scenario. Also you can look at the code for the cascading WebDropDown samples at samples.infragistics.com
Hope this helps,
I tried the Above Sample Seems that it is not working in my scenario as the Controls are being Built Dynamically. How ever I am having Trouble with one more scenario of the Webdropdown. i.e. I have Place a Webdropdown which has two item lists i.e. Hidden and Visible in the Normal Asp.net Grid's Item Template. in this scenario The webdropdown does not show up the Item List. Can you please send me a Sample for this Scenario also.
Please do the Needful.
You can take a look at the following sample:
https://ko.infragistics.com/samples/aspnet/data-grid/dropdown-editors
WebDataGrid => Editors => DropDown Editors. (then double click on some cell in the second column for instance).
I am having the same issue. The first time the list shows the items. I select one and get a postback. I do a bit of work in the SelectionChanged event handler which involves setting values on another control. Then I go to select a different item from the webdropdown and find that I cannot see the values. I can select one of them and the value gets put into the control. The invisibility feature is not very good for the end-user though. Any idea how to fix this? I am using the 9.2 .NET 3.5 libraries.