I have the rows inside a telerik grid in following format.
| WordFile.doc|button1|_button2_|
I need to display a popup when the user click on column 1[WordFile.doc]. I have two buttons in a data grid row which have click event attached to it. Earlier mousedoubleclick event was attached to row and everything was working fine.
Now in-order to make the row respond to the single click. I added the following statement to my code behind
this.radUSBFiles.AddHandler(GridViewCell.MouseLeftButtonDownEvent, new MouseButtonE开发者_如何学GoventHandler(row_MouseDoubleClick), true);
After this the buttons stopped working. I believe the MouseLeftButtonDownEvent is not letting the control reach the event handlers of the button.
I am trying to calculate the column number where the click happend and set the Handled to true if the click happens on any area other than button columns.
Is there any better approach to this?
Please advice,
Regards,
John.
For you to know on what column you clicked, attach a commandname property to the column and handle it in the ItemCommand event.
Grid column mark up:
<telerik:GridButtonColumn ButtonType="ImageButton" CommandName="View" UniqueName="exportPDF" />
check for the commandname in the itemcommand event (code behind): if commandname == "View" { ....do something here.....}
See this link for more info.
精彩评论