This is a migrated thread and some comments may be shown as answers.

RadGrid client events: community feedback needed

1 Answer 44 Views
Grid
This is a migrated thread and some comments may be shown as answers.
radu
Top achievements
Rank 1
radu asked on 27 Jan 2009, 10:54 AM
Dear all,

I'm in the middle of a discussion with the Telerik support: it seems that we cannot agree on the expected behavior for the RadGrid client side events in a particular case. I would like the community feedback regarding what should be the expected behavior.

The Problem:
When embedding an image on a RadGrid row (lets say I want to display a small icon along with a filename), and clicking on the image the client side event handlers assigned for OnRowClick/OnRowDblClick are NOT triggered. Also there are no event handlers assigned to the image. I reported this behavior as a bug but the the reply from support was "this behavior is by design" and they recommended me to write some custom handlers to handle this case.

My question to the community is: do you think that this behavior is what you would expect from the OnRowClick / OnRowDblClick event handlers or not? In my view the behavior is inconsistent and should be changed.

Do not post solutions, the issue is trivial to solve using jquery.

I do have a small project which exhibits the problem but I don't know how to attach it to a forum post.

Many thanks,
Radu

1 Answer, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 30 Jan 2009, 08:42 AM
Hello radu,

The behavior in question is in fact  by design. It is needed as various element in RadGrid's item should not bubble their click event as this may cause unexpected behavior when EnablePostBackOnRowClick option is enabled. Such elements for instance are inputs, img and checkboxes. For instance when a hierarchy is used the expand/collapse button should be escaped as otherwise it will trigger a postback when item is expanded/collapsed.

In order to workaround this behavior for img elements I suggest you to consider using a div element instead and set the image as its background.  

I hope this information is helpful. Please excuse us for any inconvenience this may caused you.

Greetings,
Rosen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
radu
Top achievements
Rank 1
Answers by
Rosen
Telerik team
Share this question
or