or
When a node of the treeview (in a combobox) is clicked, the text and value of this node is set to the selected item of the combobox. client side this works well. serverside the selectedvalue is rondomly empty.
function nodeClicking(sender, args) {
var comboBox = $find("<%= cbEmployees.ClientID %>");
var node = args.get_node()
comboBox.set_text(node.get_text());
comboBox.trackChanges();
var item = comboBox.get_items().getItem(0);
item.set_value(node.get_value());
item.set_text(node.get_text());
comboBox.commitChanges();
comboBox.hideDropDown();
comboBox.attachDropDown();
}
function SetPlaceHolders(sender, args) { var Tree = $find("<%=RadTreeView_CommonControls.ClientID%>"); var selectedNode = Tree.get_selectedNode(); var text = selectedNode.get_value(); if (text != null) { var editor = $find('<%= RadEditor_setupContent.ClientID %>'); editor.pasteHtml(text); } }
<dependentAssembly> <assemblyIdentity name="RadEditorSharepoint" publicKeyToken="1f131a624888eeed" culture="neutral" /> <bindingRedirect oldVersion="6.1.3.0" newVersion="6.1.6.0" /> </dependentAssembly><script> var isDirty = false; var resetControls = ""; // should be in , separated with # in ids var msg = 'You haven\'t saved your changes.\n Do you want to save changes ?'; $(document).ready(function () { alert($(".section :hidden").length); $(":submit,:reset ").click(function () { isDirty = false; alert("Dirty flag reset"); }); $(':input').change(function () { if (!isDirty) { alert("Dirty flag set") isDirty = true; } }); window.onbeforeunload = function () { if (isDirty) { return msg; } }; }); </script>
<telerik:RadGrid ID="RadGridUserInfo" CssClass="myRadGrid" GridLines="None" runat="server" AllowAutomaticDeletes="True" PageSize="12" AllowPaging="True" AutoGenerateColumns="False" OnItemUpdated="RadGridUserInfo_ItemUpdated" OnItemDeleted="RadGridUserInfo_ItemDeleted" OnItemInserted="RadGridUserInfo_ItemInserted" OnDataBound="RadGridUserInfo_DataBound" AllowFilteringByColumn="True" OnItemCreated="RadGridUserInfo_ItemCreated" OnInsertCommand="RadGridUserInfo_InsertCommand" OnUpdateCommand="RadGridUserInfo_UpdateCommand" OnNeedDataSource="RadGridUserInfo_NeedDataSource" OnEditCommand="RadGridUserInfo_EditCommand" OnItemDataBound="RadGridUserInfo_ItemDataBound" OnDeleteCommand="RadGridUserInfo_DeleteCommand" oncolumncreated="RadGridUserInfo_ColumnCreated"> <SelectedItemStyle Font-Names="Tahoma" Font-Size="11px" ForeColor="#8abe23" /> <MasterTableView Width="100%" CommandItemDisplay="TopAndBottom" DataKeyNames="UserInfoId" HorizontalAlign="NotSet" AutoGenerateColumns="False" Font-Names="Tahoma" EditFormSettings-FormStyle-ForeColor="Black" Font-Size="11px"> <CommandItemTemplate> <div style="padding: 5px 5px;" dir="rtl"> asp:LinkButton ID="LinkButton4" runat="server" Font-Names="Tahoma" CommandName="RebindGrid"><img style="border:0px;vertical-align:middle;" alt="" src="../Images/Icons/Refresh.gif" />به روزآوري اطلاعات</asp:LinkButton> </div> </CommandItemTemplate> <Columns> <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn"> <ItemStyle CssClass="MyImageButton" /> </telerik:GridEditCommandColumn> <telerik:GridButtonColumn ConfirmText="آيا از حذف ركورد جاري مطمئنيد؟" ConfirmDialogType="RadWindow" ConfirmTitle="حذف ركورد جاري" ButtonType="ImageButton" CommandName="Delete" Text="حذف" UniqueName="DeleteColumn"> <ItemStyle HorizontalAlign="Center" CssClass="MyImageButton" /> </telerik:GridButtonColumn> <telerik:GridDropDownColumn DataField="SiteOwnerId" EditFormColumnIndex="1" HeaderText="شركت فروشنده پنل" UniqueName="SiteOwnerId" ListTextField="SiteOwnerName" ListValueField="SiteOwnerId" DataSourceID="sds_SiteOwner" ColumnEditorID="GridDropDownEditor"> </telerik:GridDropDownColumn> </Columns> <EditFormSettings ColumnNumber="3" CaptionDataField="UserInfoId" CaptionFormatString="ويرايش اطلاعات" InsertCaption=""> <EditColumn ButtonType="ImageButton" InsertText="ثبت پنل" UpdateText="ويرايش پنل" UniqueName="EditCommandColumn1" CancelText="لغو ويرايش"> </EditColumn> </EditFormSettings> </MasterTableView> </telerik:RadGrid>