or

| <telerik:RadComboBox runat="server" ID="ddl_ParentCustomer" Width="410px" Height="300px" |
| EnableLoadOnDemand="true" HighlightTemplatedItems="true" EnableVirtualScrolling="true" |
| OnItemsRequested="RadComboBoxCustomerOnItemsRequested" OnItemDataBound="RadComboBoxCustomerOnItemDataBound" |
| EmptyMessage="-Selecteer-"> |
| <HeaderTemplate> |
| <table border="0" cellpadding="0" cellspacing="0" width="100%"> |
| <tr> |
| <td style="width: 220px;"> |
| ComapanyName |
| </td> |
| <td style="width: 50px;"> |
| ZipCode |
| </td> |
| <td> |
| City |
| </td> |
| </tr> |
| </table> |
| </HeaderTemplate> |
| <ItemTemplate> |
| <table border="0" cellpadding="0" cellspacing="0" width="100%"> |
| <tr> |
| <td style="width: 220px;"> |
| <%# Eval("Name")%> |
| </td> |
| <td width="50px;"> |
| <%# Eval("ZipCode")%> |
| </td> |
| <td> |
| <%# Eval("City")%> |
| </td> |
| </tr> |
| </table> |
| </ItemTemplate> |
| </telerik:RadComboBox> |
| protected void RadComboBoxCustomerOnItemsRequested(object o, RadComboBoxItemsRequestedEventArgs e) |
| { |
| string sFilter = e.Text; |
| // safety check |
| if (sFilter.Length > 100 || sFilter.IndexOf(";") != -1) return; |
| ddl_ParentCustomer.Items.Clear(); |
| var customers = (from c in Customer.GetAllParentCustomers() |
| where c.Name.StartsWith(sFilter) |
| select new |
| { |
| CustomerId = c.Id, |
| c.Name, |
| c.ZipCode, |
| c.City |
| }).Page((e.NumberOfItems / 20) + 1, 20).ToList(); |
| ddl_ParentCustomer.DataSource = customers; |
| ddl_ParentCustomer.DataBind(); |
| } |
| protected void RadComboBoxCustomerOnItemDataBound(object sender, RadComboBoxItemEventArgs e) |
| { |
| object o = e.Item.DataItem; |
| e.Item.Text = o.GetType().GetProperty("Name").GetValue(o, null).ToString(); |
| e.Item.Value = o.GetType().GetProperty("CustomerId").GetValue(o, null).ToString(); |
| } |
| public void SetValues(Customer customer) |
| { |
| if(customer.ParentCustomerId > 0) |
| { |
| ddl_ParentCustomer.SelectedValue = customer.ParentCustomerId.ToString(); |
| } |
| } |
| 'CODE FOR GENERATING THE TREE |
| uxRadTreeView.DataTextField = "LocationCombo" |
| uxRadTreeView.DataFieldID = "AuditEntryID" |
| uxRadTreeView.DataValueField = "AuditEntryID" |
| uxRadTreeView.DataSource = groups |
| uxRadTreeView.DataBind() |
| Dim template As NodeTemplate = New NodeTemplate() |
| template._InEditMode = _InEditMode |
| For Each node As RadTreeNode In uxRadTreeView.GetAllNodes() |
| template.InstantiateIn(node) |
| node.Expanded = True |
| node.DataBind() |
| Next |
| ' TEMPLATE CODE |
| Class NodeTemplate |
| Implements ITemplate |
| Public _InEditMode As Boolean |
| Public Sub New() |
| End Sub |
| Public Sub InstantiateIn(ByVal container As Control) Implements System.Web.UI.ITemplate.InstantiateIn |
| Dim uxLocationCombo As Label = New Label() |
| uxLocationCombo.ID = "uxLocationCombo" |
| uxLocationCombo.Width = 300 |
| AddHandler uxLocationCombo.DataBinding, AddressOf nodeText_DataBinding |
| container.Controls.Add(uxLocationCombo) |
| If _InEditMode Then |
| Dim uxScore As RadNumericTextBox = New RadNumericTextBox() |
| uxScore.ID = "uxScore" |
| uxScore.Enabled = True |
| uxScore.Width = 60 |
| uxScore.MinValue = 1 |
| uxScore.MaxValue = 5 |
| uxScore.ShowSpinButtons = True |
| uxScore.NumberFormat.DecimalDigits = 0 |
| AddHandler uxScore.DataBinding, AddressOf uxScore_DataBinding |
| container.Controls.Add(uxScore) |
| Else |
| Dim uxScore As Label = New Label() |
| uxScore.ID = "uxScore" |
| uxScore.Enabled = True |
| uxScore.Width = 60 |
| AddHandler uxScore.DataBinding, AddressOf uxScoreLabel_DataBinding |
| container.Controls.Add(uxScore) |
| End If |
| Dim uxNotScored As CheckBox = New CheckBox() |
| uxNotScored.ID = "uxNotScored" |
| uxNotScored.Enabled = _InEditMode |
| uxNotScored.Width = 60 |
| AddHandler uxNotScored.DataBinding, AddressOf uxNotScoredCheckbox_DataBinding |
| container.Controls.Add(uxNotScored) |
| End Sub |
| Private Sub uxScoreLabel_DataBinding(ByVal sender As Object, ByVal e As EventArgs) |
| Try |
| Dim target As Label = DirectCast(sender, Label) |
| Dim node As RadTreeNode = DirectCast(target.BindingContainer, RadTreeNode) |
| target.Text = node.Attributes("Score").ToString() |
| 'target.Attributes("onClick") = "onNodeClick(" & node.Attributes("DocumentTypeID").ToString() & ");" |
| Catch ex As Exception |
| End Try |
| End Sub |
| Private Sub uxScore_DataBinding(ByVal sender As Object, ByVal e As EventArgs) |
| Try |
| Dim target As RadNumericTextBox = DirectCast(sender, RadNumericTextBox) |
| Dim node As RadTreeNode = DirectCast(target.BindingContainer, RadTreeNode) |
| target.Text = node.Attributes("Score").ToString() |
| 'target.Attributes("onClick") = "onNodeClick(" & node.Attributes("DocumentTypeID").ToString() & ");" |
| Catch ex As Exception |
| End Try |
| End Sub |
| Private Sub uxNotScoredCheckbox_DataBinding(ByVal sender As Object, ByVal e As EventArgs) |
| Try |
| Dim target As CheckBox = DirectCast(sender, CheckBox) |
| Dim node As RadTreeNode = DirectCast(target.BindingContainer, RadTreeNode) |
| target.Checked = CBool(node.Attributes("NotScored").ToString()) |
| 'target.Attributes("onClick") = "onNodeClick(" & node.Attributes("AuditEntryID").ToString() & ");" |
| Catch ex As Exception |
| End Try |
| End Sub |
| Private Sub nodeText_DataBinding(ByVal sender As Object, ByVal e As EventArgs) |
| Try |
| Dim target As Label = DirectCast(sender, Label) |
| Dim node As RadTreeNode = DirectCast(target.BindingContainer, RadTreeNode) |
| target.Text = node.Attributes("LocationCombo").ToString() |
| 'target.Attributes("onClick") = "onNodeClick(" & node.Attributes("DocumentTypeID").ToString() & ");" |
| Catch ex As Exception |
| End Try |
| End Sub |
| End Class |
| ' CODE IN THE UPDATE BUTTON CALLBACK |
| For Each node As RadTreeNode In uxRadTreeView.Nodes |
| i += 1 |
| idArray(i) = node.Value |
| scoreArray(i) = DirectCast(node.TemplateControl.FindControl("uxScore"), RadNumericTextBox).Value.ToString() |
| If DirectCast(node.TemplateControl.FindControl("uxNotScored"), CheckBox).Checked Then |
| noScoreArray(i) = "1" |
| Else |
| noScoreArray(i) = "0" |
| End If |
| Next |
| double max = Math.Floor(chart.PlotArea.YAxis.MaxValue); |
| double step = Math.Round( max / 10); |
| chart.PlotArea.YAxis.Clear(); |
| chart.PlotArea.YAxis.AutoScale = false; |
| chart.PlotArea.YAxis.AddRange(0, max, step); |
| AxisSegment seg = new AxisSegment(); |
| seg.Name = "asdfasdfasdf"; |
| seg.MaxValue = 3000; |
| seg.MinValue = 100; |
| seg.Step = 1000; |
| chart.PlotArea.YAxis.ScaleBreaks.Segments.Add(seg); |
| chart.PlotArea.YAxis.ScaleBreaks.MaxCount = 1; |
| chart.PlotArea.YAxis.ScaleBreaks.Enabled = true; |
| WMPagina is a Rad window manager var wlogin = WMPagina.Windows.Find(delegate(RadWindow w) { return w.ID == "LoginWindow"; }); |
| wlogin.AutoSize = true; |
| wlogin.VisibleOnPageLoad = true; |
| <telerik:RadToolBarButton runat='server' ImageUrl='~/Images/monitor.png' Value='Monitored' CommandName='Monitored' Text='Monitored' Enabled='false' CheckOnClick='true'> |
| </telerik:RadToolBarButton> |
In the code behind, during Page_Load, we set button.Checked = true;
In the described state, its style flicks from Checked to Unchecked whenever the cursor hovers over the button. It also seems to do some sort of ajax call when this happens. I tried catching the OnMouseOver event of the toolbar in order to cancel the event but it won't fire when the button is disabled. Is there a way to ensure that the button can be set to checked and disabled in the Code Behind and will not respond to any user action?

| <%@ Control Language="C#" AutoEventWireup="true" CodeFile="CustomSectionEditForm.ascx.cs" Inherits="ModulesAdministration.Articles.__Components.CustomSectionEditForm" %> |
| <%@ Register src="../../__Components/EditForm/CustomSectionBoxEditFormTemplate.ascx" tagname="CustomSectionBoxEditFormTemplate" tagprefix="SciDev" %> |
| <%@ Register src="../../__Components/EditForm/CustomSectionEditFormCancel.ascx" tagname="CustomSectionEditFormCancel" tagprefix="SciDev" %> |
| <%@ Register src="../../__Components/EditForm/CustomSectionEditFormSave.ascx" tagname="CustomSectionEditFormSave" tagprefix="SciDev" %> |
| <%@ Register src="CustomSectionComboBoxTreeView.ascx" tagname="CustomSectionComboBoxTreeView" tagprefix="SciDev" %> |
| <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel" runat="server" > |
| </telerik:RadAjaxLoadingPanel> |
| <telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy" runat="server"> |
| <AjaxSettings> |
| <telerik:AjaxSetting AjaxControlID="PanelEditForm"> |
| <UpdatedControls> |
| <telerik:AjaxUpdatedControl ControlID="PanelEditForm" LoadingPanelID="RadAjaxLoadingPanel" /> |
| </UpdatedControls> |
| </telerik:AjaxSetting> |
| </AjaxSettings> |
| </telerik:RadAjaxManagerProxy> |
| <asp:Panel ID="PanelEditForm" runat="server"> |
| <SciDev:CustomSectionBoxEditFormTemplate ID="CustomSectionBoxEditFormTemplate" runat="server" |
| HeaderText="Please edit the record bellow:" > |
| <ContentTemplate> |
| <asp:FormView ID="FormViewEdit" runat="server" DefaultMode="Edit" DataKeyNames="Id" |
| DataSourceID="CustomObjectDataSourceEditDataSourceID" |
| Width="100%"> |
| <EditItemTemplate> |
| <!-- <edit fields section> --> |
| <div style="margin-top: 0px; margin-bottom: 0px;"> |
| <asp:Label ID="LabelId" runat="server" Text='<%# Bind("Id") %>' visible="false" /> |
| <asp:Label ID="LabelCultureCode" runat="server" Text='<%# Bind("CultureCode") %>' visible="false" /> |
| <table cellpadding="0" cellspacing="0" width="100%"> |
| <tr> |
| <td style="width: 100%"> |
| <!-- <Note> --> |
| <div style="margin-top: 2px; margin-bottom: 24px;"> |
| <table cellpadding="0" cellspacing="0" width="100%"> |
| <tr> |
| <td align="left" valign="middle"> |
| <SciDev:CustomLabel ID="CustomLabelNote" runat="server" |
| Localizable="true" |
| CssClass="WebsiteSkeleton_Font_TextNote" |
| Text="Note: The fields marked with (*) are mandatory and the those marked with (@) are multilanguage !"/> |
| </td> |
| </tr> |
| </table> |
| </div> |
| <!-- </Note> --> |
| </td> |
| </tr> |
| <tr> |
| <td style="width: 100%"> |
| <!-- <Parent category> --> |
| <div style="margin-top: 2px; margin-bottom: 8px;"> |
| <table cellpadding="0" cellspacing="0" width="100%"> |
| <tr> |
| <td align="left" valign="middle"> |
| <%= Translator.Translate("Parent category")%> |
| </td> |
| <td align="left" valign="middle" style="width: 85%;"> |
| <SciDev:CustomSectionComboBoxTreeView ID="CustomSectionComboBoxTreeView" runat="server" |
| SelectedValue='<%# Bind("IdParent") %>' /> |
| </td> |
| </tr> |
| </table> |
| </div> |
| <!-- </Parent category> --> |
| </td> |
| </tr> |
| <tr> |
| <td style="width: 100%"> |
| <!-- <Author> --> |
| <div style="margin-top: 2px; margin-bottom: 2px;"> |
| <table cellpadding="0" cellspacing="0" width="100%"> |
| <tr> |
| <td align="left" valign="middle"> |
| <SciDev:CustomLabelDecorated ID="CustomLabelDecoratedAuthor" runat="server" |
| Localizable="true" |
| Mandatory="true" |
| Multilanguage="true" |
| Text="Author"/> |
| </td> |
| <td align="left" valign="middle" style="width: 85%;"> |
| <SciDev:CustomRadTextBox ID="CustomRadTextBoxAuthor" runat="server" |
| Width="256px" |
| Mandatory="true" |
| Text='<%# Bind("Author") %>' /> |
| </td> |
| </tr> |
| </table> |
| </div> |
| <!-- </Author> --> |
| </td> |
| </tr> |
| <tr> |
| <td style="width: 100%"> |
| <!-- <Subject> --> |
| <div style="margin-top: 2px; margin-bottom: 2px;"> |
| <table cellpadding="0" cellspacing="0" width="100%"> |
| <tr> |
| <td align="left" valign="middle"> |
| <SciDev:CustomLabelDecorated ID="CustomLabelDecoratedSubject" runat="server" |
| Localizable="true" |
| Mandatory="true" |
| Multilanguage="true" |
| Text="Subject"/> |
| </td> |
| <td align="left" valign="middle" style="width: 85%;"> |
| <SciDev:CustomRadTextBox ID="CustomRadTextBoxSubject" runat="server" |
| Width="512px" |
| Height="32px" |
| TextMode="MultiLine" |
| Mandatory="true" |
| Text='<%# Bind("Subject") %>' /> |
| </td> |
| </tr> |
| </table> |
| </div> |
| <!-- </Subject> --> |
| </td> |
| </tr> |
| <tr> |
| <td style="width: 100%"> |
| <!-- <Summary, Content, Description, Comments> --> |
| <div style="margin-top: 2px; margin-bottom: 2px;"> |
| <table cellpadding="0" cellspacing="0" width="100%"> |
| <tr> |
| <td> |
| <telerik:RadTabStrip ID="RadTabStrip" runat="server" SelectedIndex="0" Skin="Default" |
| Width="100%" |
| MultiPageID="RadMultiPageEdit"> |
| <Tabs> |
| <telerik:RadTab runat="server"> |
| <TabTemplate> |
| <SciDev:CustomLabelDecorated ID="CustomLabelDecoratedSummary" runat="server" |
| Localizable="true" |
| Mandatory="true" |
| Multilanguage="true" |
| Text="Summary"/> |
| </TabTemplate> |
| </telerik:RadTab> |
| <telerik:RadTab runat="server"> |
| <TabTemplate> |
| <SciDev:CustomLabelDecorated ID="CustomLabelDecoratedContent" runat="server" |
| Localizable="true" |
| Mandatory="true" |
| Multilanguage="true" |
| Text="Content"/> |
| </TabTemplate> |
| </telerik:RadTab> |
| <telerik:RadTab runat="server"> |
| <TabTemplate> |
| <SciDev:CustomLabelDecorated ID="CustomLabelDecoratedDescription" runat="server" |
| Localizable="true" |
| Multilanguage="true" |
| Text="Description"/> |
| </TabTemplate> |
| </telerik:RadTab> |
| <telerik:RadTab runat="server"> |
| <TabTemplate> |
| <SciDev:CustomLabelDecorated ID="CustomLabelDecoratedComments" runat="server" |
| Localizable="true" |
| Multilanguage="true" |
| Text="Comments"/> |
| </TabTemplate> |
| </telerik:RadTab> |
| </Tabs> |
| </telerik:RadTabStrip> |
| <telerik:RadMultiPage ID="RadMultiPageEdit" runat="server" Width="100%" |
| SelectedIndex="0"> |
| <telerik:RadPageView ID="RadPageViewSummary" runat="server"> |
| <SciDev:CustomRadEditor ID="CustomRadEditorSummary" runat="server" |
| Content='<%# Bind("Summary") %>' /> |
| </telerik:RadPageView> |
| <telerik:RadPageView ID="RadPageViewContent" runat="server"> |
| <SciDev:CustomRadEditor ID="CustomRadEditorContent" runat="server" |
| Content='<%# Bind("Content") %>' /> |
| </telerik:RadPageView> |
| <telerik:RadPageView ID="RadPageViewDescription" runat="server"> |
| <SciDev:CustomRadEditor ID="CustomRadEditorDescription" runat="server" |
| Content='<%# Bind("Description") %>' /> |
| </telerik:RadPageView> |
| <telerik:RadPageView ID="RadPageViewComments" runat="server"> |
| <SciDev:CustomRadEditor ID="CustomRadEditorComments" runat="server" |
| Content='<%# Bind("Comments") %>' /> |
| </telerik:RadPageView> |
| </telerik:RadMultiPage> |
| </td> |
| </tr> |
| </table> |
| </div> |
| <!-- </Summary, Content, Description, Comments> --> |
| </td> |
| </tr> |
| <tr> |
| <td style="width: 100%"> |
| <!-- <ActivationDateTime> --> |
| <div style="margin-top: 8px; margin-bottom: 2px;"> |
| <table cellpadding="0" cellspacing="0" width="100%"> |
| <tr> |
| <td align="left" valign="middle"> |
| <%= Translator.Translate("ActivationDateTime")%> |
| </td> |
| <td align="left" valign="middle" style="width: 85%;"> |
| <SciDev:CustomRadDateTimePicker ID="CustomRadDateTimePicker" runat="server" |
| Localizable="true" |
| DbSelectedDate='<%# Bind("ActivationDateTime") %>' /> |
| </td> |
| </tr> |
| </table> |
| </div> |
| <!-- </ActivationDateTime> --> |
| </td> |
| </tr> |
| <tr> |
| <td style="width: 100%"> |
| <!-- <IsLocked> --> |
| <div style="margin-top: 2px; margin-bottom: 2px;"> |
| <table cellpadding="0" cellspacing="0" width="100%"> |
| <tr> |
| <td align="left" valign="middle"> |
| <%= Translator.Translate("IsLocked")%> |
| </td> |
| <td align="left" valign="middle" style="width: 85%;"> |
| <asp:CheckBox ID="CheckBoxIsLocked" runat="server" Checked='<%# Bind("IsLocked") %>' /> |
| </td> |
| </tr> |
| </table> |
| </div> |
| <!-- </IsLocked> --> |
| </td> |
| </tr> |
| <tr> |
| <td style="width: 100%"> |
| <!-- <IsDeleted> --> |
| <div style="margin-top: 2px; margin-bottom: 2px;"> |
| <table cellpadding="0" cellspacing="0" width="100%"> |
| <tr> |
| <td align="left" valign="middle"> |
| <%= Translator.Translate("IsDeleted")%> |
| </td> |
| <td align="left" valign="middle" style="width: 85%;"> |
| <asp:CheckBox ID="CheckBoxIsDeleted" runat="server" Checked='<%# Bind("IsDeleted") %>' /> |
| </td> |
| </tr> |
| </table> |
| </div> |
| <!-- </IsDeleted> --> |
| </td> |
| </tr> |
| </table> |
| </div> |
| <!-- </edit fields section> --> |
| <!-- <save cancel section> --> |
| <div style="margin-top: 8px; margin-bottom: 8px;"> |
| <table cellpadding="0" cellspacing="5"> |
| <tr> |
| <td> |
| <div style="margin-top: 0px; margin-bottom: 0px; margin-left: 16px; margin-right: 16px; "> |
| <SciDev:CustomSectionEditFormSave ID="CustomSectionEditFormSave" runat="server" |
| OnSaveClick="CustomButtonSave_Click" /> |
| </div> |
| </td> |
| <td> |
| <div style="margin-top: 0px; margin-bottom: 0px; margin-left: 16px; margin-right: 16px; "> |
| <SciDev:CustomSectionEditFormCancel ID="CustomSectionEditFormCancel" runat="server"/> |
| </div> |
| </td> |
| </tr> |
| </table> |
| </div> |
| <!-- </save cancel section> --> |
| </EditItemTemplate> |
| </asp:FormView> |
| <SciDev:CustomObjectDataSourceEdit ID="CustomObjectDataSourceEdit" runat="server" |
| DataSourceID="CustomObjectDataSourceEditDataSourceID" |
| DataObjectTypeName="Project.PresentersTier.Presenters.InteractiveWorld.ArticlePresenter" |
| TypeName="Project.PresentersTier.PresenterControllers.InteractiveWorld.ArticlePresenterCtrl" |
| SelectMethodOnCreateMode="CreateDefault" |
| InsertMethodOnCreateMode="MakePersistent" |
| SelectMethodOnUpdateMode="GetByIdAndCultureCode" |
| UpdateMethodOnUpdateMode="MakePersistent" |
| OnValidation="CustomObjectDataSourceEdit_Validation" |
| OnInserted="CustomObjectDataSourceEdit_Inserted" |
| OnUpdated="CustomObjectDataSourceEdit_Updated" > |
| </SciDev:CustomObjectDataSourceEdit> |
| </ContentTemplate> |
| </SciDev:CustomSectionBoxEditFormTemplate> |
| </asp:Panel> |
| <ClientSettings Resizing-AllowColumnResize="True" ReorderColumnsOnClient="True" Resizing-EnableRealTimeResize="True" AllowRowHide="True" AllowKeyboardNavigation="True" AllowColumnsReorder="True" AllowColumnHide="True" EnableAlternatingItems="False" /> |