Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
81 views
I am using RadEditor for content editing. I have set its content programmatically like 

RadEditor1.Content = Conversion.ToString(Cms.HtmlContent);

But it's not loading contents and the RadEditor also is disabled.

Any help will be appreciated.

Thanks
Ianko
Telerik team
 answered on 20 Nov 2013
11 answers
333 views
Hi,
I have a header control in my RadGrid set out as:

<

 

 

telerik:GridBoundColumn DataField="RaisingFactor" HeaderText="Raising Factor" UniqueName="RaisingFactor" ReadOnly="true" Visible="true" DataFormatString="{0:N2}"></telerik:GridBoundColumn>

 


I wish to re-set the value of the text of this control after the Update has been made on the row that it belongs to.

Its a field that is calculated based on the values of 3 other fields. I wish the new value of this header to display straight after Update.

Any advice?

Thank you.
Kostadin
Telerik team
 answered on 20 Nov 2013
5 answers
137 views
Hi there,

I have a single instance of RadEditor on a page which I am using for text entry of multiple fields by moving in the DOM.
All works fine except when I have EnableTrackChanges set to false I notice a significant delay between text entry and text appearance on the screen. I don't think I can have EnableTrackChanges flag on for my requirement. Can you please assist me to avoid that delay without setting EnableTrackChanges flag?

Thank you.
Ianko
Telerik team
 answered on 20 Nov 2013
1 answer
98 views
Assuming "Date" is of type DateTime, I know it's possible to do the following:

<telerik:GridGroupByExpression>
     <SelectFields>
         <telerik:GridGroupByField FieldName="Date" />
     </SelectFields>
     <GroupByFields>
         <telerik:GridGroupByField FieldName="Date" SortOrder="Ascending" />
     </GroupByFields>
 </telerik:GridGroupByExpression>

I've replaced my DateTime property with a new custom class called MonthAndYear.

[Serializable]
protected class MonthAndYear : IComparable<MonthAndYear>
{
    public int Month { get; set; }
    public int Year { get; set; }
 
    public string monthString
    {
        get
        {
            return CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(Month);
        }
    }
 
    public MonthAndYear(int month, int year)
    {
        Month = month;
        Year = year;
    }
 
    public MonthAndYear(DateTime dateTime)
    {
        Month = dateTime.Month;
        Year = dateTime.Year;
    }
 
    public static MonthAndYear Now
    {
        get
        {
            return new MonthAndYear(DateTime.Now.Month, DateTime.Now.Year);
        }
    }
 
    public static MonthAndYear FromDate(DateTime date)
    {
        return new MonthAndYear(date.Month, date.Year);
    }
 
    public MonthAndYear AddMonths(int num)
    {
        DateTime tempDate = new DateTime(Year, Month, 1);
        tempDate = tempDate.AddMonths(num);
        return new MonthAndYear(tempDate.Month, tempDate.Year);
    }
 
    public MonthAndYear AddYears(int num)
    {
        int newYear = Year + num;
        return new MonthAndYear(Month, newYear);
    }
 
    public static bool operator >(MonthAndYear a, MonthAndYear b)
    {
        if (a.Year == b.Year)
            return a.Month > b.Month;
        else if (a.Year > b.Year)
            return true;
        else
            return false;
    }
 
    public static bool operator <(MonthAndYear a, MonthAndYear b)
    {
        if (a.Year == b.Year)
            return a.Month < b.Month;
        else if (a.Year < b.Year)
            return true;
        else
            return false;
    }
 
    public static bool operator >=(MonthAndYear a, MonthAndYear b)
    {
        return a > b || a == b;
    }
 
    public static bool operator <=(MonthAndYear a, MonthAndYear b)
    {
        return a < b || a == b;
    }
 
    public static bool operator ==(MonthAndYear a, MonthAndYear b)
    {
        return a.Month == b.Month && a.Year == b.Year;
    }
 
    public static bool operator !=(MonthAndYear a, MonthAndYear b)
    {
        return !(a.Month == b.Month && a.Year == b.Year);
    }
 
    public override bool Equals(object obj)
    {
        if (obj == null)
        {
            return false;
        }
        MonthAndYear m = obj as MonthAndYear;
        if ((System.Object)m == null)
        {
            return false;
        }
 
        return this.Month == m.Month && this.Year == m.Year;;
    }
 
    public override string ToString()
    {
        return new DateTime(Year, Month, 1).ToString();
    }
 
    public override int GetHashCode()
    {
        int hash = 23;
        hash = hash * 31 + Month.GetHashCode();
        hash = hash * 31 + Year.GetHashCode();
        return hash;
    }
 
    public int CompareTo(MonthAndYear other)
    {
        if (this < other) return -1;
        if (this == other) return 0;
        return 1;
    }
}

Now when I try to group by Date, I get an IndexOutOfRange exception that says "Cannot find column Date." If I remove the GridGroupByExpression, everything works just fine minus the fact that my data isn't grouped by Date. Is there a way to use custom objects in RadGrid's grouping functionality? Or at least a way to mimic grouping by DateTime?   
Konstantin Dikov
Telerik team
 answered on 20 Nov 2013
7 answers
313 views

Can someone tell me how to set default "target" property to "New Window" in Document Manager Dialog of RadEditor ?  ( Currently default target is “None” ).  I don't want to do this way http://www.telerik.com/community/forums/aspnet/editor/document-link-deafult-target-blank.aspx .  

Ianko
Telerik team
 answered on 20 Nov 2013
21 answers
639 views
Hello,

I am using a RadEditor on it's own page and I want to be able to resize the Manager Dialog boxes that appear on the screen (Image Manager, File Manager, etc).

I have tried setting the DialogOpener.Window.Behaviors and DialogOpener.Window.InitialBehaviors in code behind and they don't seem to have any effect.  They also don't save in the ASPX page.

What can I do to allow for these dialog windows to be resizable?

I am using Q1 2009 beta.

Shawn
Fit2Page
Top achievements
Rank 2
Bronze
Iron
Iron
 answered on 20 Nov 2013
7 answers
637 views
Hi There,

I have an issue while using dropdownlist control. I am assigning margin to body of the webpage. While assigning margin the startup position of the dropdown items are moving towards right side from the control actual position.

What would be solution for this issue. This issue is there even with datepicker too.

Regards

Anandh G
Kate
Telerik team
 answered on 20 Nov 2013
1 answer
236 views
I have an aspx that loads a TabStrip control and MultiPage control. The TabStrip is populated in the code-behind. The MultiPage is created only for the first tab. When the user clicks on another tab, the MultiPage is created at that point.

Each MultipPage PageView loads a .ascx when the tab is selected by clicking on it.

On tab 1, I have an ascx that loads a RadGrid. The grid contains a button, that when clicked, I want to select tab 2. The MultiPage PageView for tab 2 has not been created yet. The .aspx page has logic to create the PageView, if not created yet, in the TabClick event.

In the codebehind for the click event for the button on Tab 2, I can locate the tab control on the parent page and issue a select on tab 2, but that does not trigger the click event on the tab.

How do I get the aspx to create the new PageView?

This is my .aspx page that creates the tabs dynamically and the pageviews, when needed:
Imports Telerik.Web.UI
Public Class Clients
    Inherits System.Web.UI.Page
 
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
 
        If Not Page.IsPostBack Then
            Dim dal As New Navigation
            Dim ds As DataSet = dal.NavigationSelect(1)
            Dim bAddPageView As Boolean = True
 
            For Each row As DataRow In ds.Tables(0).Rows
                AddTab(row.Item("NavName"), bAddPageView)
                bAddPageView = False
            Next
        End If
    End Sub
 
    Private Sub AddTab(ByVal tabName As String, ByVal bAddPageView As Boolean)
        Dim tab As RadTab = New RadTab
 
        tab.Text = tabName
 
        NavTabStrip.Tabs.Add(tab)
 
        If bAddPageView Then
            AddPageView(tab)
        End If
    End Sub
 
    Protected Sub RadMultiPage1_PageViewCreated(ByVal sender As Object, ByVal e As RadMultiPageEventArgs)
        Dim userControlName As String = e.PageView.ID + ".ascx"
 
        Dim userControl As Control = Page.LoadControl(userControlName)
 
        userControl.ID = e.PageView.ID & "_userControl"
        e.PageView.Controls.Add(userControl)
 
    End Sub
 
    Private Sub AddPageView(ByVal tab As RadTab)
        Dim pageView As RadPageView = New RadPageView
 
        pageView.ID = tab.Text.Replace(" ", "")
 
        RadMultiPage1.PageViews.Add(pageView)
        tab.PageViewID = pageView.ID
 
    End Sub
 
    Protected Sub NavTabStrip_TabClick(ByVal sender As Object, ByVal e As RadTabStripEventArgs)
        Dim pageView As RadPageView = RadMultiPage1.FindControl(e.Tab.Text.Replace(" ", ""))
 
        If IsNothing(pageView) Then
            AddPageView(e.Tab)
        End If
        e.Tab.PageView.Selected = True
    End Sub
 
    Private Shared Function FindControlRecursive(Root As Control, Id As String) As Control
 
        If Root.ID = Id Then
            Return Root
        End If
 
        For Each Ctl As Control In Root.Controls
 
            Dim FoundCtl As Control = FindControlRecursive(Ctl, Id)
 
            If FoundCtl IsNot Nothing Then
                Return FoundCtl
            End If
        Next
 
        Return Nothing
 
    End Function
 
End Class

This is the aspx page itself:

<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Clients.aspx.vb" Inherits="MainApp.Clients" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
 
<!DOCTYPE html>
 
<head id="Head1" runat="server">
    <title></title>
    <link href="../Css/Clients.css" rel="stylesheet" type="text/css" />
</head>
 
<body>
    <form id="form1" runat="server">
        <div style="position: relative">
            <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
                <Scripts>
                    <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
                    <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
                    <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
                </Scripts>
            </telerik:RadScriptManager>
            <telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server">
                <AjaxSettings>
                    <telerik:AjaxSetting AjaxControlID="RadTabStrip1">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="RadTabStrip1" />
                            <telerik:AjaxUpdatedControl ControlID="RadMultiPage1" />
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                    <telerik:AjaxSetting AjaxControlID="RadMultiPage1">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="RadMultiPage1" />
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                </AjaxSettings>
            </telerik:RadAjaxManagerProxy>
            <script type="text/javascript">
                function onTabSelecting(sender, args) {
                    if (args.get_tab().get_pageViewID()) {
                        args.get_tab().set_postBack(false);
                    }
                }
            </script>
            <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" HorizontalAlign="NotSet">
 
                <telerik:RadTabStrip ID="NavTabStrip" runat="server" OnClientTabSelecting="onTabSelecting" SelectedIndex="0" Width="1000px" MultiPageID="RadMultiPage1" Skin="Forest" Align="Justify" OnTabClick="NavTabStrip_TabClick" />
                <telerik:RadMultiPage ID="RadMultiPage1" runat="server" SelectedIndex="0" OnPageViewCreated="RadMultiPage1_PageViewCreated" />
 
            </telerik:RadAjaxPanel>
        </div>
 
    </form>
</body>
</html>

This is the ascx page that is loaded in tab !. I have simplified it by just having the button in there.

<%@ Control Language="vb" AutoEventWireup="false" CodeBehind="ClientListing.ascx.vb" Inherits="MainApp.ClientListing" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
 
<telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy2" runat="server">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="ClientListing">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="ClientListing" LoadingPanelID="RadAjaxLoadingPanel1"></telerik:AjaxUpdatedControl>
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManagerProxy>
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" />
 
<telerik:RadGrid ID="ClientListing" ShowGroupPanel="false" PageSize="5" AllowPaging="True" runat="server" AllowSorting="True" AllowFilteringByColumn="true" ShowHeader="False"
    OnNeedDataSource="ClientListing_NeedDataSource" CssClass="RadGrid">
    <PagerStyle Mode="NextPrevAndNumeric"></PagerStyle>
    <MasterTableView TableLayout="Fixed">
        <ItemTemplate>
              <telerik:RadButton ID="Edit" runat="server" Text="Edit" Skin="Forest" Width="105px" OnClick="Edit_Click">
                  <Icon PrimaryIconCssClass="rbEdit"
              </telerik:RadButton>
        </ItemTemplate>
    </MasterTableView>
</telerik:RadGrid>


This is the codebehind for the ascx page:

Imports Telerik.Web.UI
Public Class ClientListing
    Inherits System.Web.UI.UserControl
 
 
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
 
    End Sub
 
    Protected Sub Edit_Click(sender As Object, e As EventArgs)
        Dim rts As RadTabStrip = DirectCast(Me.Parent.FindControl("NavTabStrip"), RadTabStrip)
 
        rts.Tabs(1).Selected = True
        rts.Tabs(1).PageView.Selected = True  'This will throw an error because PageView has not been created yet
 
    End Sub
End Class



Nencho
Telerik team
 answered on 20 Nov 2013
3 answers
469 views
My requirement says that i need a editor to edit xslt file. Which is generated from the database and shown in radedtior content.
The end users are allowed to edit the design mode and are allowed to save the data back to the database.

When i use ContentAreaMode="Div" as soon as the page loads the above alert message gets triggered which i
don't wanted. kindly suggest me how to fix the above issue.
I want the ContentAreaMode="Div"
 




<%@ Page Title="" Language="C#" AutoEventWireup="true" MasterPageFile="~/MasterPages/Normal.Master"
  
CodeBehind="EditEmailTemplate.aspx.cs" Inherits="EditEmailTemplate"
  
ValidateRequest="false" %>
  
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
  
<%@ Register Src="~/UserControls/metadata.ascx" TagName="Meta" TagPrefix="VT" %>
  
<%@ Register Src="~/UserControls/BottomPageScripts.ascx" TagName="Tracking" TagPrefix="VT" %>
  
<%@ Register Src="~/UserControls/SecurityControl.ascx" TagName="Security" TagPrefix="VT" %>
  
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
  
<link href="App_Themes/Daimler/style.css" rel="stylesheet" type="text/css" />
  
</asp:Content>
  
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder2" runat="server">
  
<hr />
  
<asp:Panel runat="server" ID="pnlhead">
  
<div style="vertical-align: middle">
  
<table style="margin-left: 4%;" class="dashboard-advanced-search">
  
<tr>
  
<td style="vertical-align: middle; width: 8%" class="label">
  
<asp:Label ID="lblSub" runat="server" Text="Subject: "></asp:Label>
  
</td>
  
<td style="vertical-align: middle; width: 34%">
  
<asp:TextBox ID="txtSubject" runat="server" Style="width: 320px;"></asp:TextBox>
  
</td>
  
<td style="vertical-align: middle; width: 4%">
  
</td>
  
<td style="vertical-align: middle; width: 7%" class="label">
  
<asp:Label ID="lblType" runat="server" Text="Name: "></asp:Label>
  
</td>
  
<td style="vertical-align: middle; width: 42%">
  
<asp:TextBox ID="txtType" runat="server" Style="width: 260px;"></asp:TextBox>
  
</td>
  
</tr>
  
</table>
  
</div>
  
</asp:Panel>
  
<hr />
  
<asp:Panel ID="Panel1" runat="server" HorizontalAlign="Center" Width="94%">
  
<asp:Label ID="lblMessage" runat="server" Text="Record saved successfully." Visible="true"
  
Font-Bold="true" ForeColor="Green" Font-Size="Small"></asp:Label>
  
<br />
  
</asp:Panel>
  
</asp:Content>
  
<asp:Content ID="Content4" ContentPlaceHolderID="ContentPlaceHolder3" runat="server">
  
<div style="padding-left: 1%; padding-right: 1%;">
  
<telerik:RadTabStrip ID="tbtemplate" runat="server" MultiPageID="RadMultiPage1" Skin="Black"
  
SelectedIndex="0" OnTabClick="tbtemplate_TabClick" OnLoad="tbtemplate_Load">
  
<tabs>
  
<telerik:RadTab Text="XSLT" CssClass="tabStrip" Selected="True">
  
</telerik:RadTab>
  
<telerik:RadTab Text="Preview" CssClass="tabStrip">
  
</telerik:RadTab>
  
</tabs>
  
</telerik:RadTabStrip>
  
<div style="padding-bottom: 0.6%; padding-top: 0.3%;">
  
<asp:Panel ID="Panelbtn" runat="server" HorizontalAlign="Right" Width="98%">
  
<asp:ImageButton ID="btnSave" runat="server" ImageUrl="images/btn-save.png" OnClick="btnSave_Click" />
  
     
  
<asp:ImageButton ID="btnCancel" runat="server" ImageUrl="~/images/btn-cancel.png"
  
OnClick="btnCancel_Click" />
  
</asp:Panel>
  
</div>
  
<div>
  
<telerik:RadEditor ContentAreaMode="Div" runat="server" ID="RadEditor1" 
  
EditModes="Preview,Design" AutoResizeHeight="true" Height="715" >
  
<modules>
  
<telerik:EditorModule Enabled="false" Visible="false" />
  
  
</modules>
  
</telerik:RadEditor>
  
</div>
  
</div>
  
</asp:Content>
Ianko
Telerik team
 answered on 20 Nov 2013
5 answers
119 views
We have an application that can potentially pull in a LOT of items into a grid control. So many that we've had to put a limit in of 300. However, the users want to see the TOTAL number of items as well as the "maximum allowed" number of items. So if we've got 1,000 records and a per-page count of 25, they'd like to see "300 of 1000 in 12 pages". Is there a way to do this? I've experimented with the VirtualItemCount property but that doesn't seem to quite do it.

Thanks in advance for any helpful replies, even if it's just "No, this can't be done in this control!"
Jerry
Top achievements
Rank 1
 answered on 20 Nov 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
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?