views:

132

answers:

0

I have a derived GridView control which implements an actions column with some ImageButton actions: Properties, Move Up, Move Down, Delete.

I currently create these in the control's OnInit; the ImageButton controls are housed inside a TemplateField/ITemplate.

I want to disable and show a different image for the Move Up and Move Down icons when the row for the said actions is either the top or the bottom row.

I can handle the top row by checking the container.DataItemIndex property in the ImageButton (enclosed in the TemplateField) during the ImageButton's DataBinding event.

What I cannot seem to work out though is how I can detect the final row in a paged data set and change and disable the MoveDown ImageButton for the last row. I assume it cannot be detected during databinding of the ImageButton but probably after data binding has finished.

I cannot see how I would get access to the total row count though like in InitializePager's PagedDataSource.DataSourceCount and then change say the ImageUrl and disable the button? I'm unsure as to which event I should be trying to do this in also.

Many thanks.