简体   繁体   English

从第一个组合框中获取选定的值以在gridview Devexpress中对其进行过滤后,无法更改第二个组合框数据源

[英]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. 我目前正在使用Devexpress Gridview在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. 我正在使用PageMethods传递“阶段名称”的选定值以对其进行过滤。 (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. 在您的getPropertyTypeByPhaseId()方法中,您初始化ManageLot ml = new ManageLot(),然后尝试通过ml.LotGrid访问它的成员。 Are you sure LotGrid is properly initialized in ManageLot() constructor? 您确定LotGrid在ManageLot()构造函数中正确初始化吗? Most probably it's null, if your ManageLot() constructor is just a basic stub constructor. 如果您的ManageLot()构造函数只是一个基本的存根构造函数,则很可能为null。

Instead of using web methods to modify DX controls why not better use their own (DX) Callbacks and events? 为什么不使用Web方法来修改DX控件,为什么不更好地使用它们自己的(DX)回调和事件呢? You can put your ComboxBox inside an ASPxCallbackPanel and handle OnCallback event where you can add items to your Combobox. 您可以将ComboxBox放在ASPxCallbackPanel内,并处理OnCallback事件,您可以在其中将项目添加到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. 我不确定您是否可以从Web Methods中访问正确初始化的DX控制服务器变量。 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. 如果您仍然想使用Web方法,则需要从JS调用Web方法,传递参数,做一些工作并返回一个JSON对象,该对象将在Web方法的成功处理程序中使用,然后尝试向其中添加新项目您的DX控件通过JS在客户端进行。 Let me know what path are you going to choose. 让我知道您要选择什么路径。

HTH 高温超导

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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