I'm currently working with a grid that has checkboxes in first column, I'm using row edit templates, but I want to ignore the call to the row edit template on the checkbox column, because right now if I click the checkbox with the row selected it will fire the event.
Thank you,
Cláudio Correia
While doing some tests with a single grid I found that this event wont fire when I have AllowUpdateDefault="RowTemplateOnly"...any way to go around this problem?
Thank you for the reply, I'm not using the cellclickaction="Edit" property, the rows launch the edit template on a second click on the row. I tried using the solution you sugested by the event doesn't get fired, this is how I declared it:
<ClientSideEvents BeforeEnterEditModeHandler="uwg1_BeforeEnterEditModeHandler"></ClientSideEvents>
But nothing is happening, I put a "alert('test')" inside the function but it never reaches it.
Do I need to had something else to the grid?
Hi Claudio,
I assume the default cell click action is set to Edit. So it opens the RowEditTemplate after you click the checkbox, right? If you don't want to open the RowEditTemplate, then the BeforeEnterEditModeHandler should be included on the client side. To include the handler, open the properties window for WebGrid, then expand DisplayLayout --> ClientSideEvents and click on the event and select add a new handler. This will create the javaScript method signature in the HTML source page. Now you can add code to handle the event. Here is a sample:
function UltraWebGrid1_BeforeEnterEditModeHandler(gridName, cellId)
{
//Add code to handle your event here.
var col = igtbl_getColumnById(cellId);
if(col.HeaderText == 'CheckBoxColumn')
return(true);
}
This way when the cells in the CheckBoxColumn are clicked, the RowEditTemplate doesn’t open.
I hope this helps.
Thanks