Dim gtc As New GridTemplateColumnWith gtc .UniqueName = "gtcQuest" .HeaderTemplate = New clsGridViewTemplate(GridItemType.Header, "Quest", "Quest.", "") .FilterTemplate = New clsGridViewTemplate(GridItemType.EditItem, "", "", "") .ItemTemplate = New clsGridViewTemplate(GridItemType.Item, "pnlQuest", "", "") .HeaderStyle.Width = Unit.Pixel(60) .HeaderStyle.HorizontalAlign = HorizontalAlign.CenterEnd WithradGrid.MasterTableView.Columns.AddAt(0, gtc)Dim btnQuest As New ButtonbtnQuest.ID = "btnQuest"DirectCast(e.Item.FindControl("pnlQuest"), Panel).Controls.Add(btnQuest)string customerName = (MultiView1.Views[3].FindControl("txtCustomerName") as TextBox).Text;int age = int.Parse((MultiView1.Views[3].FindControl("txtAge") as TextBox).Text);
Protected Sub RadGrid1_ItemInserted(ByVal source As Object, ByVal e As GridInsertedEventArgs) Handles
If e.Exception IsNot Nothing
e.ExceptionHandled =
e.KeepInInsertMode =
DisplayMessage(
True, "Employee cannot be inserted. Reason: " & Convert
DisplayMessage(
False, "Employee inserted"
End
Dim gridEditFormItem As GridEditFormItem = DirectCast(e.Item, GridEditFormItem
Dim dropDownList As DropDownList = DirectCast(gridEditFormItem.FindControl("ddlTOC"), DropDownList
Dim TextBox As TextBox = DirectCast(gridEditFormItem.FindControl("TextBox8"), TextBox
End
<telerik:RadPageView ID="RadPageView2" runat="server">
<telerik:RadGrid ID="RadGrid1" runat="server" CssClass="RadGrid" GridLines="None"
AllowPaging="True" PageSize="20" AllowSorting="True" AutoGenerateColumns="False"
ShowStatusBar="True" AllowAutomaticDeletes="True" AllowAutomaticInserts="True"
AllowAutomaticUpdates="True" OnItemDeleted="RadGrid1_ItemDeleted" OnItemInserted="RadGrid1_ItemInserted"
OnItemUpdated="RadGrid1_ItemUpdated" OnItemCommand="RadGrid1_ItemCommand" OnPreRender="RadGrid1_PreRender">
<MasterTableView CommandItemDisplay="TopAndBottom" DataKeyNames="الأجراء">
function
OnNodeChecked(sender,eventArgs) {
var tree = $find('rdtOutputColumns');
var button = $get("btnOK");
if (tree.get_checkedNodes().length > 0) {
button.disabled = false;
}
else {
button.disabled =
true;
}
}
This works fine for intially enabling the button when a user checks one or more of the child nodes but if previously checked nodes are unchecked then the get_checkedNodes().length reports that 1 node is still checked and so my button is never disabled again.
Has anybody got any ideas as to why the get_checkNodes() function is returning a node that is no longer checked?
Many thanks
Antony