I would like to stop row selection with the following code...it's not working;
If
ddlYearMo < currYearMo Then
Else
Daryl007, I'm using the following code while opening a RowEditTemplate:
function wdgShuttleAdj_onTemplateOpening(sender, args) { var e = document.getElementById("ctl00_cphContent_lblMsg"); e.innerText = "";
var auth = document.getElementById("ctl00_cphContent_lblAuth"); if (auth.innerText == "View") { args.set_cancel(true); }
var cellValue = args.get_row().get_cell(8).get_value(); if (cellValue != "") { args.set_cancel(true); }}
Is there any help with this problem. I have an urgent requirement to resolve this problem.
This is odd that when ever I click on a row. this code fires twice?
Why is that?
Hi folks,
I have been trying to use the above as a sample reference.
my code below.
function webdatagrid_Selection_RowSelectionChanging(sender, eventArgs) { var UR = '<%=Session("USER_ROLE")%>'; var UI = '<%=Session("UserID")%>'; var UR1 = UR.toUpperCase(); var UI1 = UI.toUpperCase(); if (UR1 == "ADVISOR") { var myval = eventArgs.getNewSelectedRows().getRow(0).get_cell(3).get_value().toUpperCase(); if (myval != UI1) { //Cancel selection eventArgs.set_cancel(true); } } }
If I insert a break point in the code, the code segments works every time.
However if I remove the breakpoint, the code seems to fail the comparison.
Ideas?
Hello davefevold,you can do this on the client like subscribe for RowSelectionChanging event and cancel selection if the data selection is before the current month.
<script type="text/javascript"> function WebDataGrid1_Selection_RowSelectionChanging(sender, eventArgs) {... //Check if ddlYearMo < currYearMo if (ddlYearMo < currYearMo) { //Cancel selection eventArgs.set_cancel(true); }}</script>