如果某个条件失败,则在 devexpress gridview 的 rowupdating 事件中显示 popupcontrol
我有一个 Devexpress Gridview,其中显示项目及其价格。
编辑已启用。
我使用 rowupdating 事件,以便检查更新的价格是否高于正常值。
如果是这样,我取消编辑,
e.Cancel = true;
ASPxGridView1.CancelEdit();
我想要的下一件事是弹出一个 aspx popupcontrol 请求密码,以便在 rowupdating 事件中继续进行更高的金额。
popcontrol将包含一个密码文本框和一个按钮。剩余的过程将通过按钮单击功能执行,
即使我调用popcontrol,
ASPxPopupControl2.ShowOnPageLoad = true;
弹出窗口也不会显示......为什么会这样......
这是我的全部代码..
protected void ASPxGridView1_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e)
{
string msg;
double new_amt = double.Parse(e.NewValues["Amount"].ToString());//-->gets new amount
string type= e.OldValues["Type"].ToString();//-->gets the item
double refer_amt=Misc_functions.Get_Item_Amount(type,out msg);//--this function fetches the normal amount for a particular item
if (new_amt > refer_amt)
{
e.Cancel = true;
ASPxGridView1.CancelEdit();
ASPxPopupControl2.ShowOnPageLoad = true;
}
}
基本上,如果编辑的金额高于正常值,我需要密码身份验证。 有什么想法吗?
I have a Devexpress Gridview where item and it's price is displayed.
Editing is enabled.
I use rowupdating event so inorder to check if the price updated is higher than a normal value.
if so, i cancel edit by
e.Cancel = true;
ASPxGridView1.CancelEdit();
the next thing i want is to popup a aspx popupcontrol requesting a password inorder to proceed with higher amount within the rowupdating event.
the popcontrol will contain a password textbox and a button.The remaining procces will be carried out by button click function
eventhough i called popcontrol
ASPxPopupControl2.ShowOnPageLoad = true;
the pop doesn't show up......why is this so..
here is my over all code..
protected void ASPxGridView1_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e)
{
string msg;
double new_amt = double.Parse(e.NewValues["Amount"].ToString());//-->gets new amount
string type= e.OldValues["Type"].ToString();//-->gets the item
double refer_amt=Misc_functions.Get_Item_Amount(type,out msg);//--this function fetches the normal amount for a particular item
if (new_amt > refer_amt)
{
e.Cancel = true;
ASPxGridView1.CancelEdit();
ASPxPopupControl2.ShowOnPageLoad = true;
}
}
Basically i need a password authentication if an amount edited is a higher than a normal value.
any ideas??
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用服务器代码无法完成此操作。最佳解决方案是在 RowUpdating 事件处理程序中创建自定义 Java 脚本变量,并在 ASPxGridView 的客户端 EndCallback 事件处理程序中检查其值。即
希望,这有帮助。
This cannot be done using the server code. The best solution is to create a custom java script variable within the RowUpdating event handler and check its value in the ASPxGridView's client side EndCallback event handler. I.e.
Hope, this helps.