We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

problems with click event for ImageButton in GridGroupingControl

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



3 Replies

MC Manickam Chidambaram Syncfusion Team December 16, 2010 05:14 AM UTC

Hi Sorin,

Thanks for using Syncfusion Products.

We suggest you place the Item Template column “Image button” in
tag, since we are adding more than one submit type image button in the form. Please refer the below code snippet.

[ASPX page]








<%--Adding image button to Grid Column--%>


CommandName="MROClick" CommandArgument='<%# Container %>’ />


. . . . . .







Please refer the following sample link demonstrating image button item template in Grid Grouping control.

Grid_ImageButton-1431356183.zip

Please try the above suggestion and let us know if any concerns.

Regards,
Manickam





MP Marco Pavan NO LONGER WITH COMPANY April 6, 2012 03:32 PM UTC

I've a similar problem with latest bin (10.104.0.44).
If I try your example with these bins it doesn't goes.

With your example I'm trying this:
- I click on image and it fires
- I Group rows
- I click another time on image. It doesn't fire

It seems that after some other external events, if GridGroupingControl is inside an UpdatePanel it doesn't fire Template Command events.



SN Sridhar N Syncfusion Team April 9, 2012 06:36 AM UTC

Hi Marco,

Thanks for your update.

We have analyzed the issue and we have updated about this issue in the incident 93052. Could you please follow up in that incident?

Please let us know if any concerns.

Regards,
Sridhar N




Loader.
Live Chat Icon For mobile
Up arrow icon