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
<
link
href
=
"App_Themes/Grid.TestStyle.css"
rel
=
"stylesheet"
type
=
"text/css"
/>
<
link
href
=
"App_Themes/Menu.TestStyle.css"
rel
=
"stylesheet"
type
=
"text/css"
/>
<
link
href
=
"App_Themes/Input.TestStyle.css"
rel
=
"stylesheet"
type
=
"text/css"
/>
<
link
href
=
"App_Themes/Slider.TestStyle.css"
rel
=
"stylesheet"
type
=
"text/css"
/>
<
link
href
=
"App_Themes/Calendar.TestStyle.css"
rel
=
"stylesheet"
type
=
"text/css"
/>
<
telerik:RadGrid
ID
=
"RadGrid1"
runat
=
"server"
AllowFilteringByColumn
=
"True"
AllowPaging
=
"True"
AllowSorting
=
"True"
DataSourceID
=
"SqlDataSource1"
GridLines
=
"None"
Skin
=
"TestStyle"
Width
=
"750px"
AllowAutomaticDeletes
=
"True"
AllowAutomaticUpdates
=
"True"
onitemupdated
=
"RadGrid1_ItemUpdated"
Culture
=
"en-GB"
EnableEmbeddedSkins
=
"False"
>
<
MasterTableView
DataSourceID
=
"SqlDataSource1"
AutoGenerateColumns
=
"False"
DataKeyNames
=
"Purchaser"
>
<
CommandItemSettings
ExportToPdfText
=
"Export to Pdf"
/>
<
RowIndicatorColumn
FilterControlAltText
=
"Filter RowIndicator column"
>
</
RowIndicatorColumn
>
<
ExpandCollapseColumn
FilterControlAltText
=
"Filter ExpandColumn column"
>
</
ExpandCollapseColumn
>
<
Columns
>
<
telerik:GridBoundColumn
DataField
=
"Purchaser"
FilterControlAltText
=
"Filter Purchaser column"
HeaderText
=
"Purchaser"
ReadOnly
=
"True"
SortExpression
=
"Purchaser"
UniqueName
=
"Purchaser"
>
<
ItemStyle
Width
=
"150px"
/>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"PurchaserName"
FilterControlAltText
=
"Filter PurchaserName column"
HeaderText
=
"Name"
SortExpression
=
"PurchaserName"
UniqueName
=
"PurchaserName"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
AllowFiltering
=
"False"
DataField
=
"ShortName"
FilterControlAltText
=
"Filter ShortName column"
HeaderText
=
"Short Name"
SortExpression
=
"ShortName"
UniqueName
=
"ShortName"
>
</
telerik:GridBoundColumn
>
<
telerik:GridEditCommandColumn
ButtonType
=
"ImageButton"
FilterControlAltText
=
"Filter EditCommandColumn column"
CancelImageUrl
=
"Cancel.gif"
EditImageUrl
=
"Edit.gif"
InsertImageUrl
=
"Update.gif"
UpdateImageUrl
=
"Update.gif"
>
</
telerik:GridEditCommandColumn
>
<
telerik:GridButtonColumn
ButtonType
=
"ImageButton"
CommandName
=
"Delete"
ConfirmText
=
"Are you sure you wish to delete this record?"
FilterControlAltText
=
"Filter column column"
Text
=
"Delete"
UniqueName
=
"column"
>
</
telerik:GridButtonColumn
>
</
Columns
>
<
EditFormSettings
EditFormType
=
"Template"
>
<
EditColumn
FilterControlAltText
=
"Filter EditCommandColumn column"
CancelImageUrl
=
"Cancel.gif"
EditImageUrl
=
"Edit.gif"
InsertImageUrl
=
"Update.gif"
UpdateImageUrl
=
"Update.gif"
>
</
EditColumn
>
<
FormTemplate
>
<
table
style
=
"width:100%;"
>
<
tr
>
<
td
style
=
"text-align: right; width: 129px"
>
Name:</
td
>
<
td
>
<
asp:TextBox
ID
=
"TextBox2"
runat
=
"server"
MaxLength
=
"50"
Text='<%# Bind("PurchaserName") %>' Width="150px"></
asp:TextBox
>
<
asp:RequiredFieldValidator
ID
=
"RequiredFieldValidator1"
runat
=
"server"
ControlToValidate
=
"TextBox2"
Display
=
"None"
ErrorMessage
=
"Name is required!"
ValidationGroup
=
"VG1"
></
asp:RequiredFieldValidator
>
<
asp:ValidatorCalloutExtender
ID
=
"RequiredFieldValidator1_ValidatorCalloutExtender"
runat
=
"server"
Enabled
=
"True"
TargetControlID
=
"RequiredFieldValidator1"
>
</
asp:ValidatorCalloutExtender
>
</
td
>
</
tr
>
<
tr
>
<
td
class
=
"style4"
style
=
"width: 129px; text-align: right"
>
Short Name:</
td
>
<
td
>
<
asp:TextBox
ID
=
"TextBox3"
runat
=
"server"
MaxLength
=
"15"
Text='<%# Bind("ShortName") %>' Width="110px"></
asp:TextBox
>
<
asp:RequiredFieldValidator
ID
=
"RequiredFieldValidator2"
runat
=
"server"
ControlToValidate
=
"TextBox3"
Display
=
"None"
ErrorMessage
=
"Short name is required!"
ValidationGroup
=
"VG1"
></
asp:RequiredFieldValidator
>
<
asp:ValidatorCalloutExtender
ID
=
"RequiredFieldValidator2_ValidatorCalloutExtender"
runat
=
"server"
Enabled
=
"True"
TargetControlID
=
"RequiredFieldValidator2"
>
</
asp:ValidatorCalloutExtender
>
</
td
>
</
tr
>
<
tr
>
<
td
class
=
"style4"
style
=
"width: 129px; text-align: right"
>
Type:</
td
>
<
td
>
<
asp:DropDownList
ID
=
"DropDownList5"
runat
=
"server"
SelectedValue='<%# Bind("Type") %>'>
<
asp:ListItem
>Non-Midlands</
asp:ListItem
>
<
asp:ListItem
>Midlands</
asp:ListItem
>
</
asp:DropDownList
>
</
td
>
</
tr
>
<
tr
>
<
td
class
=
"style4"
style
=
"width: 129px; text-align: right"
>
Sort Order:</
td
>
<
td
>
<
asp:TextBox
ID
=
"TextBox4"
runat
=
"server"
MaxLength
=
"3"
Text='<%# Bind("SortOrder") %>' Width="50px"></
asp:TextBox
>
</
td
>
</
tr
>
<
tr
>
<
td
class
=
"style4"
style
=
"width: 129px; text-align: right"
>
Corp Forms Group:</
td
>
<
td
>
<
asp:DropDownList
ID
=
"DropDownList6"
runat
=
"server"
DataSourceID
=
"SqlDataSource2"
DataTextField
=
"corpformsgroup"
DataValueField
=
"corpformsgroup"
SelectedValue='<%# Bind("CorpFormsGroup") %>'>
</
asp:DropDownList
>
</
td
>
</
tr
>
<
tr
>
<
td
class
=
"style4"
style
=
"width: 129px; text-align: right"
>
Corp Forms Sort:</
td
>
<
td
>
<
asp:TextBox
ID
=
"TextBox5"
runat
=
"server"
MaxLength
=
"3"
Text='<%# Bind("CorpFormsSort") %>' Width="50px"></
asp:TextBox
>
</
td
>
</
tr
>
<
tr
>
<
td
class
=
"style4"
style
=
"width: 129px; text-align: right"
>
NHS Net Address:</
td
>
<
td
>
<
asp:TextBox
ID
=
"TextBox6"
runat
=
"server"
Text='<%# Bind("NHSNetAddress") %>'
Width="350px"></
asp:TextBox
>
</
td
>
</
tr
>
</
table
>
<
br
/>
<
table
style
=
"width: 300px;"
>
<
tr
>
<
td
style
=
"width: 94px"
>
<
telerik:RadButton
ID
=
"RadButton1"
runat
=
"server"
CommandName
=
"Update"
Skin
=
"WebBlue"
Text
=
"Update"
ValidationGroup
=
"VG1"
>
</
telerik:RadButton
>
</
td
>
<
td
>
<
telerik:RadButton
ID
=
"RadButton2"
runat
=
"server"
CausesValidation
=
"False"
CommandName
=
"Cancel"
Skin
=
"WebBlue"
Text
=
"Cancel"
>
</
telerik:RadButton
>
</
td
>
</
tr
>
</
table
>
</
FormTemplate
>
</
EditFormSettings
>
</
MasterTableView
>
<
FilterMenu
EnableImageSprites
=
"False"
>
</
FilterMenu
>
<
HeaderContextMenu
CssClass
=
"GridContextMenu GridContextMenu_Default"
>
</
HeaderContextMenu
>
</
telerik:RadGrid
>