I'm trying to add a template column that has an asp imagebutton to a gridgroupingcontrol.
The problem is that I don't receive the button's click event on the server side all the time.
The only time I receive the click event is if I click on the button right after a page refresh and only on the first row.
If I change the row selected or if I edit a row, the click event is not fired anymore.
Here is my aspx
AutoFormat="Navy Blue" DataSourceCachingMode="ViewState"
OnTemplateCommand="UserGrid_TemplateCommand"
AutoSaveChildControlChanges="True" BorderCollapse="Separate"
CssClass="GridNavyBlue" DragSelectionBackColor="Yellow" EnableCallbacks="False" PageSize="8"
GroupDropAreaCssClass="GridNavyBlueGroupDropArea" PostBackOnFocusedChanged="true" OnCurrentRecordContextChange="UserGrid_CurrentRecordContextChange">
.....
AllowSort="False" ReadOnly="True">
ImageUrl="~/Gui/Images/UserMRO.gif"
CommandName="MROClick" CommandArgument='<%# Container %>'
ImageAlign="Middle"/>
....
And this is my event handler
protected void UserGrid_TemplateCommand(object sender, TemplateCommandEventArgs args)
{
if (args.CommandName == "MROClick")
{
int userID = int.Parse(args.GridRow.Record.GetValue("UserID").ToString());
}
}
Thanks,
Sorin