Friday, March 16, 2012

Passing a variable into a event handler.

I need to pass a variable into an event handler. Unfortuantely the tag i'm using (dataGrid) doesn't support CommandArgument. Any other suggestions how i can pass a variable into an event handler?

I have a datagrid in a repeater, and i populate it with a dataTable, which is retrieved with a StationId that completes the SQL query. Now, when i try to page the dgrd i have to pass that stationId into the paging function.

Since the paging funtion is an eventHandler, it has (object sender, DataGridPageChangedEventArgs e) and so i can't pass any other variables into it

any ideas?Hi,
the DataGridPagechangedEventArgs an be used to get the id of the daatgrid,

can u please check this !!!

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemWebUIWebControlsDataGridPageChangedEventArgsClassTopic.asp

in that article u an find code which u can use and make use of to understand your situation !!

0 comments:

Post a Comment