Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
72 views
Im building a web app using the MVC archirecture (MVC3).  Is it somehow possible to use the RadScheduler in an mvc applcation ?
If so, are there any examples ?
Plamen
Telerik team
 answered on 18 Sep 2012
1 answer
57 views
Hi All,

iam runing into to some techincal issue,i have telerik text box which is customized and i have EnableExtendedEditor icon control which will open text editor to change the value of textbox but when i disable EnableExtendedEditor it s not working i.e not disabling.

my code is like below

<tempo:TextBox runat="server" ID="txtMasterAIName" LabelCssClass="label" ControlCssClass="control" EnableExtendedEditor="true">
                                            <TextBox Width="200px" />
                                                <Label Text="Name:"></Label>
                                            <Validator CssClass="validation" PropertyName="MASTER_AI_NAME" SourceTypeName="CGI.ESG.TEMPO.ViewEntity.AIMasterView, CGI.ESG.TEMPO.ViewEntity"
                                                EnableClientScript="true" />
                                        </tempo:TextBox>

in javascript iam disabling like

 function OnClientSelectedIndexChanged(sender, eventArgs) {
            var item = eventArgs.get_item().get_value();
            var licensePersonCode = sender.get_attributes().getAttribute("LicensePersonCode");
            if (item == licensePersonCode) {
                var txtMasterAIName = $find('<%= txtMasterAIName.ClientID %>');
                txtMasterAIName.EnableExtendedEditor = false;
                launchLicenseeDefinitionWindow();
                return true;
            }

but its throwing javascript if i mention txtMasterAIName.EnableExtendedEditor = false; like object null


below is my custome textbox code
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="TempoTextBoxControl.ascx.cs" Inherits="CGI.ESG.TEMPO.Web.CommonControls.TempoTextBoxControl" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<%@ Register Assembly="CGI.ESG.TEMPO.Web" Namespace="CGI.ESG.TEMPO.Web.UIBase" TagPrefix="tempo" %>

<asp:Panel ID="pnlLabel" runat="server">
    <span id="lblValidatorFlag" runat="server" class="reqfield">*</span>
    <asp:Label ID="lblText" runat="server" AssociatedControlID="txtData" EnableViewState="false"></asp:Label>
</asp:Panel>
<asp:Panel ID="pnlControl" runat="server">
    <telerik:RadTextBox ID="txtData" runat="server">
    </telerik:RadTextBox>
    <tempo:ExtendedEditorPopup ID="edtPopup" runat="server" TextBoxID="txtData" NavigateUrl="~/Pages/AdvancedEditor.aspx"
        OnModalOK="popupExtendedEditor_ModalOK" OnModalShow="popupExtendedEditor_ModalShow" RadWindowID="wndEditor">
    </tempo:ExtendedEditorPopup>
    <tempo:ClientDataAnnotationValidator ID="valData" runat="server" ControlToValidate="txtData" />
</asp:Panel>


using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.ComponentModel;
using Telerik.Web.UI;
using CGI.ESG.TEMPO.Web.UIBase;
using System.Configuration;
using System.Reflection;
using CGI.ESG.TEMPO.Common.Aspects;
using System.Text;
using System.ComponentModel.DataAnnotations;

namespace CGI.ESG.TEMPO.Web.CommonControls
{
    [Themeable(true)]
    public partial class TempoTextBoxControl : TempoCommonUserControl
    {
        #region events
        public event EventHandler TextChanged
        {
            add { txtData.TextChanged += value; }
            remove { txtData.TextChanged -= value; }
        }
        #endregion

        #region properties
        protected override string TooltipDefaultText
        {
            get { return lblText.Text; }
        }

        public bool EnableExtendedEditor
        {
            get { return (bool?) ViewState["extEditor"] ?? true; }
            set { ViewState["extEditor"] = value; }
        }

        [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
        [PersistenceMode(PersistenceMode.InnerProperty)]
        [NotifyParentProperty(true)]
        [Category("Label Settings")]
        public Label Label
        {
            get { return lblText; }
        }

        [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
        [PersistenceMode(PersistenceMode.InnerProperty)]
        [NotifyParentProperty(true)]
        [Category("TextBox Settings")]
        public RadTextBox TextBox
        {
            get { return txtData; }
        }

        [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
        [PersistenceMode(PersistenceMode.InnerProperty)]
        [NotifyParentProperty(true)]
        [Category("Validator Settings")]
        public override ClientDataAnnotationValidator Validator
        {
            get { return valData; }
        }

        public string RequiredFieldIndicatorText
        {
            get { return lblValidatorFlag.InnerText; }
            set { lblValidatorFlag.InnerText = value; }
        }

        #region Label properties
        public string LabelCssClass
        {
            get { return pnlLabel.CssClass; }
            set { pnlLabel.CssClass = value; }
        }
        #endregion

        #region TextBox properties
        public string ControlCssClass
        {
            get { return pnlControl.CssClass; }
            set { pnlControl.CssClass = value; }
        }

        public string Text
        {
            get { return txtData.Text; }
            set { txtData.Text = value; }
        }

        public bool AutoPostBack
        {
            get { return txtData.AutoPostBack; }
            set { txtData.AutoPostBack = value; }
        }
        #endregion
        #endregion

        #region methods
        protected override void Page_Load(object sender, EventArgs e)
        {
            base.Page_Load(sender, e);
        }


        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
        }

        public override string ToolTip
        {
            get
            {
                return txtData.ToolTip;
            }
            set
            {
                txtData.ToolTip = value;
            }
        }

        public bool ReadOnly
        {
            get { return txtData.ReadOnly; }
            set { txtData.ReadOnly = value; }
        }

        protected void popupExtendedEditor_ModalShow(object sender, ModalOpenEventArgs e)
        {
            URLBuilder builder =new URLBuilder(URLBuilder.ServerBaseUrl() + "Pages/AdvancedEditor.aspx");
            builder["mode"] = this.ReadOnly ? "ro" : "rw";
            if (txtData.MaxLength > 0)
            {
                builder["len"] = this.txtData.MaxLength;
            }
            builder["title"] = this.lblText.Text.Replace(":","").Replace("*","");
            e.Url = builder.Url;
        }

        protected void popupExtendedEditor_ModalOK(object sender, ModalCloseEventArgs e)
        {
            if (!this.ReadOnly)
            {
                string newData = e.Result == null ? string.Empty : e.Result as string;
                if(newData != this.Text)
                {
                    this.Text = newData;
                    if (this.Page is TempoPage)
                    {
                        TempoPage page = this.Page as TempoPage;
                        page.IsDirty = page.TrackDirty;
                    }
                }
            }
        }
        #endregion

        protected override void InitializeValidator()
        {
            if (!string.IsNullOrEmpty(valData.SourceTypeName) && !string.IsNullOrEmpty(valData.PropertyName))
            {
                Type dataType = valData.GetValidatedType();
                PropertyInfo property = valData.GetValidatedProperty(dataType);
                object[] stringLengthAttributes = property.GetCustomAttributes(typeof(StringLengthAttribute), true);
                if (stringLengthAttributes.Length > 0)
                {
                    StringLengthAttribute attrib = stringLengthAttributes[0] as StringLengthAttribute;
                    if (attrib.MaximumLength > 0)
                    {
                        txtData.MaxLength = attrib.MaximumLength;
                    }
                }
                object[] requiredAttribute = property.GetCustomAttributes(typeof(RequiredAttribute), true);
                if (requiredAttribute.Length > 0)
                {
                    RequiredValidator = true;
                }
                else
                {
                    RequiredValidator = false;
                }
            }
            else
            {
                RequiredValidator = false;
            }
            ValidatorInitialized = true;
            edtPopup.Visible = txtData.MaxLength > 20 && EnableExtendedEditor != false;
        }

        protected override void SetReadOnly()
        {
            txtData.ReadOnly = true;
        }

        protected override System.Web.UI.HtmlControls.HtmlGenericControl RequiredIndicator
        {
            get { return lblValidatorFlag; }
        }
    }
}

please help me out to resolve the issue
Antonio Stoilkov
Telerik team
 answered on 18 Sep 2012
1 answer
93 views

 



Hi,

I have a quick question . In Telerik’s website,

(http://www.telerik.com/) we see this slider/menu bar at the top. When we click on button next to ‘Product families’ it closes or opens menu. What control does it use? Is it using Telrik controls? We want similar function in our website. I tried using RadMenu but I could not find a way to have Open/Close button at the top of menu for closing and opening menu.

Any help would be appreciated.

 

Thanks,

Kate
Telerik team
 answered on 18 Sep 2012
5 answers
332 views
How can we set the default skin sort style to GridTemplateColumn? It is working for GridBoundColumn but not for GridTemplateColumn. I have tried different colors from the Sortedbackcolor but I couldn't find the default color. Can somebody please help me with this?

<telerik:GridTemplateColumn HeaderText="Status" SortedBackColor="???" SortExpression="Active">
</telerik:GridTemplateColumn>

-Sree  
Galin
Telerik team
 answered on 18 Sep 2012
6 answers
102 views
I am using v2011.3.527.35 and I am having a rendering issue with the RadToolBar in IE8.  Please see attachment (RadToolBar2001.jpg).  There seems to be some overlapping or incorrect offset.  There is a default skin to use the "Default" theme.  The OnLoad function only set the visibility.  I am using the previous versions images, I believe.  Suggestions?

<telerik:RadToolBar ID="RadToolBar1" runat="server" EnableRoundedCorners="true" Style="float: right;"
                    OnButtonClick="MainToolbar_ButtonClick" OnClientButtonClicking="OnClientButtonClicking">
        <Items>
            <telerik:RadToolBarButton CommandName="Back" Text="Back" ImageUrl="~/Images/BackButton.gif" />
            <telerik:RadToolBarButton CommandName="Export" OnLoad="InquiryOrMaintenanceControl_Load" Text="Export" ImageUrl="~/Images/Export.gif" />
            <telerik:RadToolBarButton CommandName="Reset" OnLoad="InquiryOrMaintenanceControl_Load" Text="Reset" ImageUrl="~/Images/Reset.gif" />
            <telerik:RadToolBarButton CommandName="DeleteAll" OnLoad="DeleteAllButton_Load" Text="Delete All" ImageUrl="~/Images/Delete.gif" DisabledImageUrl="~/Images/Delete_d.gif" />
            <telerik:RadToolBarButton CommandName="Retrieve" OnLoad="InquiryOrMaintenanceControl_Load" Text="Retrieve" ImageUrl="~/Images/Retrieve1.gif" />
            <telerik:RadToolBarButton CommandName="Import" OnLoad="MaintenanceOnlyControl_Load" Text="Upload" ImageUrl="~/Images/uploadIcon.gif" />
        </Items>
</telerik:RadToolBar>

Thanks,
Rob
Kate
Telerik team
 answered on 18 Sep 2012
3 answers
168 views
I have a custom skin. I want to replace radcombobox with asp:dropdownlist.

I have following setting
<telerik:RadFormDecorator runat="server" ID="RadFormDecorator1" DecoratedControls="Select" />

It works fine but i want to change the font size of dropdownlist. For that i am using following style but it doesn't work. What else am i missing.
<style type="text/css">
       .rfdSelect_SkinName .rfdSelectOuter
       {
           font: 12px "Segoe UI" , Arial, sans-serif !important;
       }
   </style>



Bozhidar
Telerik team
 answered on 18 Sep 2012
3 answers
201 views
I am experiencing a problem where RADComboBox does not display the dropdown in Firefox, Chrome, or Opera.  IE9 does work.

Please help
Nencho
Telerik team
 answered on 18 Sep 2012
1 answer
35 views
Hi,

In VB.NET:
I have code which binds the DataSet during first time load and after postback that binded data exist.
In C#:
The same converted code after posback there is no data in RadCombo.

Below are the Telerik.Web.UI Version:
 VB.NET - Autoupdate(Set in Property pages)
    C#    - 2011.3.1115.40

Note: In watch list i have checked the data count in RadCombo,  i noticed after postback Vb.NET code holds the 2 data but in C# no data(Count = 0)

I am struck in this, Please guide to fix this.

Thanks,
Jawahar.
Andrey
Telerik team
 answered on 18 Sep 2012
3 answers
131 views
If a field used to display the image alt text is NOT type of string (e.g. int) then the alt text is not generated
E.g.

<telerik:GridBinaryImageColumn
        DataField="MyImage"
        DataAlternateTextField="MyId" DataType="System.Int32"
        DataAlternateTextFormatString="{0}"
        ImageAlign="Middle"
        HeaderText="Image" FooterText="Image"
        HeaderStyle-Width="50"
        AllowFiltering="false" AllowSorting="false"
        Groupable="False"  ResizeMode="Fit" ImageHeight="50px" ImageWidth="50px"
        ReadOnly="True" DefaultImageUrl="../img/noimage.png">
</telerik:GridBinaryImageColumn>


Radoslav
Telerik team
 answered on 18 Sep 2012
1 answer
84 views
Hello again,
This time I've encountered a problem with RadGrid.

I have following grid:

<asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional">
    <ContentTemplate>
    <telerik:RadGrid ID="UserGrid" runat="server" Culture="pl-PL" AutoGenerateColumns="False" PageSize="100"
        CellSpacing="0" GridLines="None" OnNeedDataSource="UserGrid_NeedDataSource"
        AllowCustomPaging="True"
        AllowFilteringByColumn="True" AllowSorting="True" EnableLinqExpressions="False"
        EnableHeaderContextMenu="True" OnInsertCommand="UserGrid_InsertCommand" OnUpdateCommand="UserGrid_UpdateCommand"
        OnItemDataBound="RadGrid1_ItemDataBound" GroupingEnabled="False">
        <mastertableview allowcustompaging="true" allowpaging="true" datakeynames="Id"
            pagerstyle-alwaysvisible="true" EditMode="InPlace" CommandItemDisplay="Top"  >
 
        <Columns>
            <telerik:GridEditCommandColumn UniqueName="EditCommandColumn" ButtonType="ImageButton"
                HeaderStyle-Width="56px" Resizable="false">
                <HeaderStyle Width="56px"></HeaderStyle>
                <ItemStyle CssClass="MyImageButton" />
            </telerik:GridEditCommandColumn>
            <telerik:GridBoundColumn HeaderText="lblName"
                UniqueName="Name" DataField="Name" >
            </telerik:GridBoundColumn>
            <telerik:GridDropDownColumn HeaderText="lblType" ColumnEditorID="GridDropDownColumnEditor1">
            </telerik:GridDropDownColumn>
        </Columns>
   </mastertableview>
 
</telerik:RadGrid>
<telerik:GridDropDownListColumnEditor ID="GridDropDownColumnEditor1" runat="server" />
</ContentTemplate>
 
</asp:UpdatePanel>

I'd like to hide/remove pager, so I try to remove pagerstyle-alwaysvisible property or to set it to false, the grid is rendered correctly and the pager is not shown. But whenever I try to edit a row, a javascript error is shown:

Sys.ArgumentUndefinedException: Sys.ArgumentUndefinedException: Value cannot be undefined. Parameter name: type
{name: "element", mayBeNull: true, domElement: true, optional: true}

As a result, DropDownList is disabled (I cannot open the list).

What can be the reason of this strange behaviour? In other pages I just removed all the properties associated with pager/paging and it works fine, but I didn't use GridDropDownListColumnEditor there, so no errors occured.

My web application is being developed using .NET 3.5 and Sharepoint 2010.

Thank you in advance,
Paweł


Edit: I've just noticed that removing allowcustompaging="true" allowpaging="true" properties causes the same problem.
Andrey
Telerik team
 answered on 18 Sep 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?