views:

104

answers:

1

We have a Datalist in which we have some data, with every Item we have a button control, What i want to achieve is that on the button click, the data related to that particluar row of Datalist is fetched whose Button control is clicked. How to accomplish this, The problem is how to attach the button control with values related in that partucular row, Note that I am using ArrayList as the Datasource since I am enabling pading via pageDataSource class...

A: 

Implement the OnDataBinding event for the Button. Then in the Button set the CommandArgument to something that will identify the row you are clicking. Then implement the OnItemCommand event for the DataList. You will be able to read the CommandArgument for the Button that was clicked and then perform whatever action you need.

Kelsey