如何开火活动 [英] How to fire an event

查看:90
本文介绍了如何开火活动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,


我尝试在按钮点击事件下触发事件,也许任何人都可以给

a线索。


我已经让'具有PageIndexChanged事件的WEB网格:


private void DataGrid1_PageIndexChanged(对象来源,

System.Web .UI.WebControls.DataGridPageChangedEvent Args e)


{


//将CurrentPageIndex设置为用户点击的页面。


DataGrid1.CurrentPageIndex = e.NewPageIndex;

//重新绑定数据。


DataGrid1.DataBind();


}


在按钮点击事件下:


private void btnUpdtCmd_Click(object sender,System.EventArgs e)


{


}


我想解雇网格事件但是我不知道如何调用这个事件和

为它提供参数列表:


(对象源,System.Web.UI。 WebControls.DataGridPageChangedEv ent Args e)


谢谢,

Daniela

Hello,

I try to fire an event under a button click event and maybe anybody can give
a clue please.

I have let''s say a WEB grid with PageIndexChanged event:

private void DataGrid1_PageIndexChanged(object source,
System.Web.UI.WebControls.DataGridPageChangedEvent Args e)

{

// Set CurrentPageIndex to the page the user clicked.

DataGrid1.CurrentPageIndex = e.NewPageIndex;
// Rebind the data.

DataGrid1.DataBind();

}

Under a button click event:

private void btnUpdtCmd_Click(object sender, System.EventArgs e)

{

}

I want to fire the grid''s event but I don''t know how to call the event and
provide the parameter list for it:

(object source, System.Web.UI.WebControls.DataGridPageChangedEvent Args e)

Thank you,

Daniela

推荐答案

嗨Daniela,
Hi Daniela,

我想发射网格的事件,但我不知道怎么称呼这个事件和

为它提供参数列表:
I want to fire the grid''s event but I don''t know how to call the event and
provide the parameter list for it:



DataGrid控件上有许多事件。您只需要执行一个

操作,该操作将导致网格引发所需的事件。从外部提升控制事件并不常见。控件在内部提升他们自己的事件




你是否试图从你的按钮中提取PageIndexChanged事件

点击事件处理程序?


如果是这样,请更改CurrentPageIndex属性,并且应该通过

DataGrid引发事件。


-

Dave Sexton


" Daniela Roman" < da ********** @ rogers.comwrote in message

news:OO ************** @ TK2MSFTNGP03.phx.gbl ...

There are many events on the DataGrid control. You just have to perform an
action that will cause the grid to raise the desired event. It''s not common
to raise Control events externally; Controls raise their own events
internally.

Are you trying to get the PageIndexChanged event to be raised from your button
click event handler?

If so, change the CurrentPageIndex property and the event should be raised by
the DataGrid.

--
Dave Sexton

"Daniela Roman" <da**********@rogers.comwrote in message
news:OO**************@TK2MSFTNGP03.phx.gbl...


您好,


我尝试在按钮点击事件下触发事件,也许任何人都可以给出

a线索请。


我已经让'说'带有PageIndexChanged事件的WEB网格:


private void DataGrid1_PageIndexChanged(对象来源,

System.Web.UI.WebControls.DataGridPageChangedEvent Args e)


{


//将CurrentPageIndex设置为用户点击的页面。


DataGrid1.CurrentPageIndex = e.NewPageIndex;


//重新绑定数据。


DataGrid1.DataBind();


}


在按钮点击事件下:


private void btnUpdtCmd_Click(object sender,System.EventArgs e)


{


}


我想发射网格的事件,但我不知道如何打电话事件和

为它提供参数列表:


(对象源,System.Web.UI.WebControls.DataGridPageChangedEvent Args e)


谢谢,

Daniela

Hello,

I try to fire an event under a button click event and maybe anybody can give
a clue please.

I have let''s say a WEB grid with PageIndexChanged event:

private void DataGrid1_PageIndexChanged(object source,
System.Web.UI.WebControls.DataGridPageChangedEvent Args e)

{

// Set CurrentPageIndex to the page the user clicked.

DataGrid1.CurrentPageIndex = e.NewPageIndex;
// Rebind the data.

DataGrid1.DataBind();

}

Under a button click event:

private void btnUpdtCmd_Click(object sender, System.EventArgs e)

{

}

I want to fire the grid''s event but I don''t know how to call the event and
provide the parameter list for it:

(object source, System.Web.UI.WebControls.DataGridPageChangedEvent Args e)

Thank you,

Daniela



感谢。事实上,我使用第三方WEB网格控件,出于某种原因,当我更改网格值

至代码时,
不会触发UpdateRowBatch事件。我需要通过其他方式提出这个事件。

我提供的样本不是最好的例子。


还有另外一种在外部触发事件的方法吗?

" Dave Sexton" < dave @jwa [remove.this] online.comwrote in message

news:eH ************** @ TK2MSFTNGP03.phx.gbl ...
Thanks. In fact I use a 3-rd party WEB grid control and for some reason it
does not fire the UpdateRowBatch event when I change the values of the grid
thru code. I need to raise that event thru other means.
The sample I provided is not the best example.

Is there another way of firing an event externally?
"Dave Sexton" <dave@jwa[remove.this]online.comwrote in message
news:eH**************@TK2MSFTNGP03.phx.gbl...

嗨Daniela,
Hi Daniela,

>我想解雇网格'但我不喜欢'我不知道如何调用事件
并为它提供参数列表:
>I want to fire the grid''s event but I don''t know how to call the event
and provide the parameter list for it:



DataGrid控件上有很多事件。你只需执行一个动作就会导致网格引发所需的事件。从外部提升控制事件并不常见
;控件在内部提升他们自己的事件




你是否试图从你的

按钮点击中提取PageIndexChanged事件事件处理程序?


如果是这样,更改CurrentPageIndex属性,DataGrid应该引发事件




-

Dave Sexton


" Daniela Roman" < da ********** @ rogers.comwrote in message

news:OO ************** @ TK2MSFTNGP03.phx.gbl ...


There are many events on the DataGrid control. You just have to perform
an action that will cause the grid to raise the desired event. It''s not
common to raise Control events externally; Controls raise their own events
internally.

Are you trying to get the PageIndexChanged event to be raised from your
button click event handler?

If so, change the CurrentPageIndex property and the event should be raised
by the DataGrid.

--
Dave Sexton

"Daniela Roman" <da**********@rogers.comwrote in message
news:OO**************@TK2MSFTNGP03.phx.gbl...


>您好,

我尝试在按钮点击事件下触发事件,也许任何人都可以
请给出一个线索。

我已经让'说'带有PageIndexChanged事件的WEB网格:

private void DataGrid1_PageIndexChanged(对象源,
System.Web。 UI.WebControls.DataGridPageChangedEven tArgs e)

//将CurrentPageIndex设置为用户点击的页面。

DataGrid1.CurrentPageIndex = e。 NewPageIndex;

//重新绑定数据。

DataGrid1.DataBind();

}

按钮下点击事件:

private void btnUpdtCmd_Click(object sender,System.EventArgs e)

{

}

我想要触发网格的事件,但我不知道如何调用事件
并为其提供参数列表:

(对象源,System.Web .UI.WebControls.DataGridPageChangedEvent Args e)

谢谢你,

Daniela

>Hello,

I try to fire an event under a button click event and maybe anybody can
give a clue please.

I have let''s say a WEB grid with PageIndexChanged event:

private void DataGrid1_PageIndexChanged(object source,
System.Web.UI.WebControls.DataGridPageChangedEven tArgs e)

{

// Set CurrentPageIndex to the page the user clicked.

DataGrid1.CurrentPageIndex = e.NewPageIndex;
// Rebind the data.

DataGrid1.DataBind();

}

Under a button click event:

private void btnUpdtCmd_Click(object sender, System.EventArgs e)

{

}

I want to fire the grid''s event but I don''t know how to call the event
and provide the parameter list for it:

(object source, System.Web.UI.WebControls.DataGridPageChangedEvent Args e)

Thank you,

Daniela




嗨Daniela,

我见过一些提供Raise [Event]方法的控件,但通常不适用于

无论如何每个事件。我也不喜欢这个主意:)


我会联系制造商或找一个专门用于控制的论坛

人们可能会有有类似的问题。这绝对听起来像个臭虫。


-

Dave Sexton


Daniela Roman < da ********** @ rogers.comwrote in message

news:em ************** @ TK2MSFTNGP04.phx.gbl ...
Hi Daniela,

I''ve seen some Controls that provide Raise[Event] methods, but usually not for
every event anyway. And I don''t really like the idea either :)

I would contact the manufacturer or find a forum dedicated to that control
where people might have had similar issues. It definitely sounds like a bug.

--
Dave Sexton

"Daniela Roman" <da**********@rogers.comwrote in message
news:em**************@TK2MSFTNGP04.phx.gbl...

谢谢。事实上,我使用第三方WEB网格控件,出于某种原因,当我更改网格值

至代码时,
不会触发UpdateRowBatch事件。我需要通过其他方式提出这个事件。

我提供的样本不是最好的例子。


还有另外一种在外部触发事件的方法吗?


" Dave Sexton" < dave @jwa [remove.this] online.comwrote in message

news:eH ************** @ TK2MSFTNGP03.phx.gbl ...
Thanks. In fact I use a 3-rd party WEB grid control and for some reason it
does not fire the UpdateRowBatch event when I change the values of the grid
thru code. I need to raise that event thru other means.
The sample I provided is not the best example.

Is there another way of firing an event externally?
"Dave Sexton" <dave@jwa[remove.this]online.comwrote in message
news:eH**************@TK2MSFTNGP03.phx.gbl...

>您好Daniela,
>Hi Daniela,

>>我想触发网格的事件但我不知道如何调用该事件并为其提供参数列表:
>>I want to fire the grid''s event but I don''t know how to call the event and
provide the parameter list for it:


DataGrid控件上有很多事件。您只需要执行一个
操作,该操作将导致网格引发所需的事件。从外部提升控制事件并不常见;控件在内部提升自己的事件。

你是否试图从你的
按钮点击事件处理程序中获取PageIndexChanged事件?

如果因此,更改CurrentPageIndex属性,DataGrid应该提升事件。

- Dave Sexton

Daniela Roman < da ********** @ rogers.comwrote in message
新闻:OO ************** @ TK2MSFTNGP03.phx.gbl ...


There are many events on the DataGrid control. You just have to perform an
action that will cause the grid to raise the desired event. It''s not
common to raise Control events externally; Controls raise their own events
internally.

Are you trying to get the PageIndexChanged event to be raised from your
button click event handler?

If so, change the CurrentPageIndex property and the event should be raised
by the DataGrid.

--
Dave Sexton

"Daniela Roman" <da**********@rogers.comwrote in message
news:OO**************@TK2MSFTNGP03.phx.gbl...


>>您好,

我尝试在按钮点击事件下触发事件,也许任何人都可以给出一个请告诉我。

我已经让'说'带有PageIndexChanged事件的WEB网格:

private void DataGrid1_PageIndexChanged(对象源,
System.Web.UI。 WebControls.DataGridPageChangedEve ntArgs e)

//将CurrentPageIndex设置为用户点击的页面。

DataGrid1.CurrentPageIndex = e.NewPageIndex;

//重新绑定数据。

DataGrid1.DataBind();

}

按钮点击事件:

private void btnUpdtCmd_Click(object sender,System.EventArgs e)

{

}

我想要触发网格的事件,但我不知道如何调用该事件,并为其提供参数列表:

(对象源,System.Web.U I.WebControls.DataGridPageChangedEvent Args e)

谢谢你,

Daniela

>>Hello,

I try to fire an event under a button click event and maybe anybody can
give a clue please.

I have let''s say a WEB grid with PageIndexChanged event:

private void DataGrid1_PageIndexChanged(object source,
System.Web.UI.WebControls.DataGridPageChangedEve ntArgs e)

{

// Set CurrentPageIndex to the page the user clicked.

DataGrid1.CurrentPageIndex = e.NewPageIndex;
// Rebind the data.

DataGrid1.DataBind();

}

Under a button click event:

private void btnUpdtCmd_Click(object sender, System.EventArgs e)

{

}

I want to fire the grid''s event but I don''t know how to call the event and
provide the parameter list for it:

(object source, System.Web.UI.WebControls.DataGridPageChangedEvent Args e)

Thank you,

Daniela





这篇关于如何开火活动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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