Hi all, I am trying to set up my grid so when a person double clicks on a row it fires a code behind click event that I have for a button within the CommandItemTemplate but I can't seem to manage it. Below is what code I think will be relevant, any help will be greatly appreciated.
Thanks.
As you can see I have the client event;
Which triggers;
The button is within the CommandItemTemplate;
The click event for this button is;
This ScriptManager code for "showClaimPopup" is;
This probably isn't the best way to go about what I am trying to achieve so any advice or guidance would be great.
Thanks.
As you can see I have the client event;
<ClientEvents OnRowDblClick=
"RowDblClick"
/>
Which triggers;
function
RowDblClick(sender, eventArgs) { document.getElementById(
'<%= editJourneyButton.ClientID %>'
).click(); }
The button is within the CommandItemTemplate;
<asp:LinkButton ID=
"editJourneyButton"
OnClick=
"editJourneyButton_Click"
runat=
"server"
CssClass=
"btn btn-inverse"
Text=
"Edit selected"
><i
class
=
"fa fa-edit"
></i> Edit Selected</asp:LinkButton>
The click event for this button is;
protected
void
editJourneyButton_Click(
object
sender, EventArgs e)<br> {<br><br> ErrorList.Items.Clear();<br><br>
if
(journeysGrid.SelectedItems.Count == 0)<br> {<br> ScriptManager.RegisterClientScriptBlock(
this
,
this
.GetType(),
"noItemSelected"
,
"noItemSelected();"
,
true
);<br> }<br>
else
<br> {<br> GridDataItem selectedItem = (GridDataItem)journeysGrid.SelectedItems[0];<br> TravelFormUC.resetForm();<br> TravelFormUC.refHiddenField.Value = selectedItem.GetDataKeyValue(
"journeyId"
).ToString();<br> TravelFormUC.setupForm();<br> ScriptManager.RegisterClientScriptBlock(
this
,
this
.GetType(),
"showClaimPopup"
,
"showClaimPopup();"
,
true
);<br> }
This ScriptManager code for "showClaimPopup" is;
function
showClaimPopup() {<br> $(
'#modal-claimform'
).modal(
'show'
)<br> }
This probably isn't the best way to go about what I am trying to achieve so any advice or guidance would be great.