CheckBox在处理DataGrid标题时自动检查更改的事件触发器 [英] CheckBox Check Changed Event Tigger automatically while handling DataGrid Header

查看:89
本文介绍了CheckBox在处理DataGrid标题时自动检查更改的事件触发器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当点击datagrid标题中的按钮时,我将打开一个模型PopUp窗口并获取输入数据,然后关闭窗口。

然后在Parent窗口中,链接按钮通过javascript返回。

那时Page将执行Page_Load事件,然后触发checkboxChanged事件复选框(CheckBox放在DataGrid外面)然后执行linkbutton命令(即DataGrid_ItemCommand)活动)。





这里我不想执行checkChanged复选框。

指导我解决这个问题。

While clicking the button in datagrid header, i will open a model PopUp window and get the input data and then close the window.
then in Parent window the link button is posted back through javascript.
at that time Page will perform the Page_Load Event and then triggers the checkbox checkedChanged Event(The CheckBox is Placed outside the DataGrid) and
then executes the linkbutton command (i.e DataGrid_ItemCommand Event).


Here i don''t want to execute the checkbox checkedChanged.
guide me to solve this problem.

推荐答案

假设你的复选框id是chkBox。



suppose your checkbox id is chkBox.

string controlname = this.Request.Params.Get("__EVENTTARGET");

if(controlname  == "chkBox")
{
//Call your checkbox changed event here.
}





此条件将检查复选框是否启动了回发。如果任何其他控件正在启动回发,则您的checkboxchanged事件将不会触发。



希望它有所帮助。



This condition will check if the postback is initiated by your checkbox. If any other control is initiating the postback your checkboxchanged event will not fire.

Hope it helps.


这篇关于CheckBox在处理DataGrid标题时自动检查更改的事件触发器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆