Re: How to fire an event



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.com> wrote in message
news:eHN$8z5AHHA.4992@xxxxxxxxxxxxxxxxxxxxxxx
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:

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" <danielaroman@xxxxxxxxxx> wrote in message
news:OOLr774AHHA.4592@xxxxxxxxxxxxxxxxxxxxxxx
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.DataGridPageChangedEventArgs 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.DataGridPageChangedEventArgs e)



Thank you,

Daniela






.


Loading