I would like to stop row selection with the following code...it's not working;
If
ddlYearMo < currYearMo Then
Else
Hi davefevold,
In what way is this code not working for you? Changing the select type affects what the user will be able to do after, but it does not clear the selected rows collection. Maybe you could be a little clearer on your scenario?
regards,David Young
within the sub "Protected Sub wdgLiftCnt_InitializeRow(ByVal sender As Object, ByVal e As Infragistics.Web.UI.GridControls.RowEventArgs) Handles wdgLiftCnt.InitializeRow" I want to be able to allow row selection (I have a row editing template setup) based on a date selection on the screen...if the date selection is before current month, I don't want the user to be able to edit any data, it date selected is current month, allow editing...4tthe following code doesn't seem to work though...I'm still able to click on the r8ow selector a5nd bring0 up the edit template even though "SelectType" is set to none.
Me.wdgLiftCnt.Behaviors.Selection.RowSelectType = GridControls.SelectType.None
Me.wdgLiftCnt.Behaviors.Selection.RowSelectType = GridControls.SelectType.Single
End If
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>
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?
This is odd that when ever I click on a row. this code fires twice?
Why is that?
Is there any help with this problem. I have an urgent requirement to resolve this problem.
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); }}