Posted: 8/10/2011
I am using Infragistics UltraWebGrid with ASP.Net; I have Dropdown lists in a couple of columns which are initially populated with Valuelists in the code behind.
I would like the second Valuelist to be populated from the database with certain items when the first Dropdownlist has a selection, based on that selection.
I am not however able to figure out how to initiate an event to fire when the first Dropdownlist selection is changed, like for a normal asp.net dropdownlist.
Researching this topic I came across a number of similar articles but none quite similar to my issue.
Chris
Hi Chris,
I didn't have chance to work with Infragistics controls up to now (but I will surely take a look soon), however, based on my experience with many other toolkits and controls, the DropDownList control should have some events that it implements? Can you tell us what events it has? Does it has SelectedIndexChanged event? If yes, bind a method to that event and you will need to handle the logic to populate data from db inside that method.
Please elaborate more. You can also post the other sources/links where you have read about this or similar issue.
Regards,Hajan
Posted: 12/16/2011
Its been a while since i last used ultrawebgrid but I believe you are still using the dropdownlist control of asp inside the webgrid right? If yes, you can just create a method stub that will process the change. if the 2nd dropdownlist is in the same cell of the 1st dropdownlist then use the code below to retrieve the 2nd dropdownlist:
Dim cell As Infragistics.WebUI.UltraWebGrid.CellItem = CType(CType(sender, DropDownList).NamingContainer, Infragistics.WebUI.UltraWebGrid.CellItem)
Then find the 2nd dropdownlist control using:
Dim 2ndDDL As DropDownList = CType(cell.FindControl("NameOf2NDDropDownList"), DropDownList)
Then you can populate you 2nd dropdownlist from here.
If the two dropdownlist are not in the same cell then you can just traceback the actual row using the same code on retrieving the cell and find the cell where the 2nd dropdownlist is located. And again find the actual dropdownlist control.
Hope this helps. :)
Posted: 12/21/2011
Hi,
This forum section is intended to WebForms (Server controls, events, validation, master pages, themes, validation, etc.) . There may be some here who know about Infragistics controls, but I think you stand a better chance by posting it at dedicated Infragistics forums: http://forums.infragistics.com/