简体   繁体   中英

Unable to change second combobox datasource after get selected value from first combobox to filter it in gridview Devexpress

I am currently using Devexpress Gridview to display data in gridview. I want the second combobox to be able to filter the items after get the selected value from first combobox.

After user select from Phase Name combobox, the Property Type should filter the items based on the selected phase name. I am using PageMethods to pass the selected value of Phase name to filter it. (I have tried and it successfully passed the selected value of Phase Name).

Please help me on how to solve this error! I am stuck on this problem for a day! Appreciate on your help.

in your getPropertyTypeByPhaseId() method you init ManageLot ml = new ManageLot() but then try to access it's member by ml.LotGrid. Are you sure LotGrid is properly initialized in ManageLot() constructor? Most probably it's null, if your ManageLot() constructor is just a basic stub constructor.

Instead of using web methods to modify DX controls why not better use their own (DX) Callbacks and events? You can put your ComboxBox inside an ASPxCallbackPanel and handle OnCallback event where you can add items to your Combobox. Does it sound too difficult for you?

I'm not sure you will be able to access properly initialized DX control server variables from within Web Methods. If you still want to use web methods you need to call web method from JS, pass in param, do some work AND return back a JSON object which you will use in the web method's on-success handler and then try to add new items to your DX controls on client side via JS. Let me know what path are you going to choose.

HTH

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM