Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
73 views
Hi Community,

I have to say, that I love the amount of functionality of the RAD Editor and the documentation, but I've got a huge problem and I hope to get help here.
I wanted to deploy the RAD Editor for MOSS 2007. I made several changes in several files. Nothing special and all documented by the documentation of Telerik. I made some changes in the ToolsFile.xml. New Buttons, restricted Colors... Everythings works fine. The main changes that cause the failure are documented here:

ConfigFile.xml
<configuration>
    <property name="ToolbarMode">ShowOnFocus</property>
    <property name="ToolsWidth">520px</property>
    <property name="OnClientLoad">OnClientLoad</property>
</configuration>

MOSSEditorTools
function OnClientLoad(editor, args)
{
    var style = editor.get_contentArea().style;
    style.fontFamily = "Verdana";
    style.fontSize = "0.7em";
}
 
Telerik.Web.UI.Editor.CommandList["LineDistance1"] = function(commandName, editor, args)
{
    var sel = editor.getSelectionHtml();
    editor.pasteHtml('<span style="line-height:1em;">' + sel + '</span>');
}
 
Telerik.Web.UI.Editor.CommandList["LineDistance15"] = function(commandName, editor, args)
{
    var sel = editor.getSelectionHtml();
    editor.pasteHtml('<span style="line-height:1.5em;">' + sel + '</span>');
}
 
Telerik.Web.UI.Editor.CommandList["LineDistance2"] = function(commandName, editor, args)
{
    var sel = editor.getSelectionHtml();
    editor.pasteHtml('<span style="line-height:2em;">' + sel + '</span>');
}


ToolsFile.xml
<tools>
    <tool name="Bold" shortcut="CTRL+B"/>
    <tool name="Italic" shortcut="CTRL+I"/>
    <tool name="Underline" shortcut="CTRL+U"/>
    <tool name="StrikeThrough" />
    <tool separator="true"/>
    <tool name="JustifyLeft" />
    <tool name="JustifyCenter" />
    <tool name="JustifyRight" />
    <tool name="JustifyFull" />
    <tool name="JustifyNone" />
    <tool separator="true"/>
    <tool name="LineDistance1" />
    <tool name="LineDistance15" />
    <tool name="LineDistance2" />
    <tool separator="true"/>
    <tool name="Indent" />
    <tool name="Outdent" />
    <tool separator="true"/>
    <tool name="InsertOrderedList" />
    <tool name="InsertUnorderedList" />
    <tool name="ToggleTableBorder" />
    <tool separator="true"/>
    <tool name="SelectAll" shortcut="CTRL+A"/>
  </tools>


This works fine in my image but when I deploy it on my test system nothing works. You can't even save your changes. The RAD Editor doesn't work anymore. And furthermore if I remove the lines from the MOSSEditorTools.js it works fine.
Can anybody help?
Stanimir
Telerik team
 answered on 21 Jan 2011
3 answers
101 views
Hi,

I am using the Inline insert and update feature of RadGrid, I have to validate the values entered if its blank i have to set the old value. Pls help me how to go about it.

regards
Jidesh
Veli
Telerik team
 answered on 21 Jan 2011
1 answer
79 views

I am using RarGrid on Sharepoint 2010 webparts. I am geeitng below error message during sorting/paging/filtering/conext menu.

I am using asp:scriptmanager and grid mapped with asp:scriptmanager.

 

I am getting The Controls collection cannot be modified because the control contains code blocks <% %>

Thanks,

Pavlina
Telerik team
 answered on 21 Jan 2011
3 answers
94 views
Hi

I am attempting to register the RadUpload control to an image button event.

Currently, I have the image button in place and I have created a separate page with the RadUpload control registered and I will be using an iframe to render in the background without being shown to the user.

I want the image button to open the actual file selection (browse button) from the image press, allow the user to select a file and pass this back to the originating page.

Is there a JavaScript method I can access that will allow me to do this?

Currently I have (Ignore the implicit drill down to the control, I am going to create a loop to find the "ruButton ruBrowse" class) :
$find('cRadUpload').get_element().getElementsByTagName('ul')[0].getElementsByTagName('li')[0].getElementsByTagName('input')[0].click();

But the image button does nothing when clicked...

Regards,
Jonathan
Dimitar Terziev
Telerik team
 answered on 21 Jan 2011
1 answer
143 views
Hello!

I want to use the radgrid control in excel-style like it is explained under http://www.telerik.com/community/code-library/aspnet-ajax/grid/excel-like-radgrid.aspx. I use the sample version 193898_excellikegrid.zip. I tested it with the actual version of the control/suite and it works fine.

It goes in the right the direction, but I want one further step: I want to achieve an excel-syle grid with grouping (one group level). Here is my code:

Default.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="RadGridTest._Default" Trace="true" TraceMode="SortByTime" Debug="true" %>
  
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
  
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  
<head runat="server">
    <title>RadGridTest</title>
    <script src="scripts.js" type="text/javascript"></script>
</head>
<body>
    <form id="form1" runat="server">
        <%--<asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>--%>
        <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:RadAjaxManager ID="RadAjaxManager1" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="RadGrid1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
        <div>
            <telerik:RadGrid ID="RadGrid1" runat="server" Skin="Simple" Width="100%"
                OnPreRender="RadGrid1_PreRender" OnDataBinding="RadGrid1_DataBinding" 
                OnNeedDataSource="RadGrid1_NeedDataSource">
                <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default"></HeaderContextMenu>
                <MasterTableView GridLines="Both" ShowHeader="true" TableLayout="Fixed" AutoGenerateColumns="true" Width="3000px"
                    EditMode="InPlace" >  
                  
                    <GroupByExpressions>
                        <telerik:GridGroupByExpression>
                            <SelectFields>
                                <telerik:GridGroupByField HeaderText="Department" FieldName="department"></telerik:GridGroupByField>
                            </SelectFields>
                            <GroupByFields>
                                <telerik:GridGroupByField FieldName="department" SortOrder="Ascending"></telerik:GridGroupByField>
                            </GroupByFields>
                        </telerik:GridGroupByExpression>
                    </GroupByExpressions>
                  
                    <Columns>
                        <telerik:GridBoundColumn HeaderText="id" DataField="id" UniqueName="id">
                            <HeaderStyle Width="30px" BackColor="DarkGray"/>
                            <ItemStyle Width="30px" BackColor="DarkGray"/>
                        </telerik:GridBoundColumn>
                          
                        <telerik:GridBoundColumn HeaderText="Department" DataField="department" UniqueName="department" Visible="false">
                            <HeaderStyle Width="150px" />
                            <ItemStyle Width="150px" />
                        </telerik:GridBoundColumn>
                          
                        <telerik:GridBoundColumn HeaderText="Firstname" DataField="firstname" UniqueName="firstname">
                            <HeaderStyle Width="150px" BackColor="DarkGray"/>
                            <ItemStyle Width="150px" BackColor="DarkGray"/>
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn HeaderText="Lastname" DataField="lastname" UniqueName="lastname">
                            <HeaderStyle width="150px" BackColor="DarkGray"/>
                            <ItemStyle Width="150px" BackColor="DarkGray"/>
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn HeaderText="Street" DataField="street" UniqueName="street">
                            <HeaderStyle width="250px" />
                            <ItemStyle Width="250px" />
                        </telerik:GridBoundColumn>         
                        <telerik:GridBoundColumn HeaderText="Number" DataField="number" UniqueName="number">
                            <HeaderStyle width="150px" />
                            <ItemStyle Width="150px" />
                        </telerik:GridBoundColumn>   
                        <telerik:GridBoundColumn HeaderText="Zip" DataField="zip" UniqueName="zip">
                            <HeaderStyle width="150px" />
                            <ItemStyle Width="150px" />
                        </telerik:GridBoundColumn>            
                        <telerik:GridBoundColumn HeaderText="City" DataField="city" UniqueName="city">
                            <HeaderStyle width="150px" />
                            <ItemStyle Width="150px" />
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn HeaderText="Phone" DataField="phone" UniqueName="phone">
                            <HeaderStyle width="150px" />
                            <ItemStyle Width="150px" />
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn HeaderText="Fax" DataField="fax" UniqueName="fax">
                            <HeaderStyle width="150px" />
                            <ItemStyle Width="150px" />
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn HeaderText="Mobile" DataField="mobile" UniqueName="mobile">
                            <HeaderStyle width="150px" />
                            <ItemStyle Width="150px" />
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn HeaderText="E-Mail" DataField="email" UniqueName="email">
                            <HeaderStyle width="250px" />
                            <ItemStyle Width="250px" />
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn HeaderText="Hired" DataField="hired" UniqueName="hired">
                            <HeaderStyle width="150px" />
                            <ItemStyle Width="150px" />
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn HeaderText="Comment" DataField="comment" UniqueName="comment">
                            <HeaderStyle Wrap="false" />
                            <ItemStyle Wrap="false" />
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn UniqueName="dummy">
                            <HeaderStyle Width="1px" />
                            <ItemStyle Width="1px" />
                        </telerik:GridBoundColumn>
                    </Columns>
                </MasterTableView>
                <ClientSettings>
                    <Scrolling AllowScroll="True" UseStaticHeaders="True" SaveScrollPosition="True" ScrollHeight="150px" FrozenColumnsCount="4">
                    </Scrolling>
                </ClientSettings>
                <FilterMenu EnableImageSprites="False"></FilterMenu>
            </telerik:RadGrid>
        </div>
    </form>
</body>
</html>

Default.aspx.cs
using System;
using System.Text;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using Telerik.Web.UI;
  
  
namespace RadGridTest
{
    public partial class _Default : System.Web.UI.Page
    {
  
        private readonly string GRID_SOURCE_SESSION_KEY = "GRID_SOURCE_SESSION_KEY";
          
        private DataTable GridSource
        {
            get
            {
  
                Object obj = Session[GRID_SOURCE_SESSION_KEY];
                if (obj != null)
                {
                    return (DataTable)obj;
                }
                else
                {
  
                    DataTable dt = new DataTable();
                    dt.Columns.Add("id");
                    dt.Columns.Add("department");
                    dt.Columns.Add("firstname");
                    dt.Columns.Add("lastname");
                    dt.Columns.Add("street");
                    dt.Columns.Add("number");
                    dt.Columns.Add("zip");
                    dt.Columns.Add("city");
                    dt.Columns.Add("phone");
                    dt.Columns.Add("fax");
                    dt.Columns.Add("mobile");
                    dt.Columns.Add("email");
                    dt.Columns.Add("birthday");
                    dt.Columns.Add("hired");
                    dt.Columns.Add("comment");
  
                    DataRow dr1 = dt.NewRow();
                    dr1["id"] = 1;
                    dr1["department"] = "IT";
                    dr1["firstname"] = "Test";
                    dr1["lastname"] = "Test";
                    dr1["comment"] = "This is a test.";
                    dt.Rows.Add(dr1);
  
                    DataRow dr2 = dt.NewRow();
                    dr2["id"] = 2;
                    dr2["department"] = "IT";
                    dr2["firstname"] = "Test";
                    dr2["lastname"] = "Collins";
                    dr2["comment"] = "Test";
                    dt.Rows.Add(dr2);
  
                    DataRow dr3 = dt.NewRow();
                    dr3["id"] = 3;
                    dr3["department"] = "Controlling";
                    dr3["firstname"] = "Test";
                    dr3["lastname"] = "Test";
                    dr3["comment"] = "...";
                    dt.Rows.Add(dr3);
  
                    DataRow dr4 = dt.NewRow();
                    dr4["id"] = 4;
                    dr4["department"] = "Sales";
                    dr4["firstname"] = "Steve";
                    dr4["lastname"] = "Test";
                    dr4["comment"] = "";
                    dt.Rows.Add(dr4);
  
                    DataRow dr5 = dt.NewRow();
                    dr5["id"] = 5;
                    dr5["department"] = "Purchasing Dep.";
                    dr5["firstname"] = "Michael";
                    dr5["lastname"] = "Smith";
                    dr5["comment"] = "Blablabla";
                    dt.Rows.Add(dr5);
  
                    DataRow dr6 = dt.NewRow();
                    dr6["id"] = 6;
                    dr6["department"] = "Purchasing Dep.";
                    dr6["firstname"] = "Tom";
                    dr6["lastname"] = "Jerry";
                    dr6["comment"] = "Alles wird gut!!";
                    dt.Rows.Add(dr6);
  
                    Session[GRID_SOURCE_SESSION_KEY] = dt;
  
                    return dt;
                }
            }
        }
  
        protected void RadGrid1_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
        {
            RadGrid1.DataSource = GridSource;
        }
  
        protected void RadGrid1_DataBinding(object sender, EventArgs e)
        {
            for (int i = 0; i < GridSource.Rows.Count; i++)
            {
                RadGrid1.EditIndexes.Add(i);
            }
        }
  
        protected void RadGrid1_PreRender(object sender, EventArgs e)
        {
            RadGrid1.Attributes.Add("onkeydown", "onKeyDown(this,event);");
            int itemsCount = 0;
            int columnsCount = 0;
            StringBuilder builder = new StringBuilder();
            // Attach the event handlers to the client side events of the TextBoxes. 
            foreach (GridDataItem item in RadGrid1.MasterTableView.Items)
            {
                if (item is GridDataItem)
                {
                    columnsCount = 0;
                    for (int i = 3; i < RadGrid1.MasterTableView.RenderColumns.Length; i++)
                    {
                        GridColumn column = RadGrid1.MasterTableView.RenderColumns[i];
                        TextBox textBox = (item[column.UniqueName].Controls[0]) as TextBox;
                        if (textBox != null)
                        {
                            textBox.Attributes.Add("ondblclick", "cellDoubleClickFunction('" + textBox.ClientID + "');");
                            textBox.Attributes.Add("onclick", "cellClick('" + textBox.ClientID + "');");
                        }
                        if (i == 2)
                        {
                            textBox.ReadOnly = true;
                            textBox.Attributes.Add("class", "readOnly");
                        }
                        columnsCount++;
                    }
                    itemsCount++;
                }
            }
            RadScriptManager.RegisterStartupScript(Page, Page.GetType(), "init", "colls = " + columnsCount + ";rows=" + itemsCount + ";", true);
        }
  
    }
}

My problem is, that I get an error after the method "RadGrid1_DataBinding" is done: System.ArgumentoutOfRangeException.

[ *** I think, that the grouping thing is the key like putting the items of a hierarchy RadGrid in edit mode (http://www.telerik.com/community/forums/aspnet-ajax/grid/how-to-put-the-grid-items-of-a-hierarchy-model-radgrid-in-edit-mode.aspx). ***]

==> it is not: the problem is, that I don't use AutoGeneratedColumns and I can'/don't want to use them. When I change my code, the page loads.

How must I change the code, that it will work with AutoGeneratedColumns = false???

And then it goes on:
With the excel-like RadGrid sample, the user can - for example - use the arrow keys and the tab key for navigation. When there are group rows and group footers, is there a way to recognize this, so that this rows can be skipped?

With my code, the javascript does not work as expected!?!?

Kind regards

Michael
Radoslav
Telerik team
 answered on 21 Jan 2011
1 answer
86 views
Hi Community!

I have got the following problem and I wanted to know whether there is a nice solution :)
I want to set my own paragraph styles in my RadEditor so I added the following XML the ToolsFile.xml:

<paragraphs>
    <paragraph name="<p class='custom-ueberschrift'>Überschrift</p>" value="p class='custom-ueberschrift'" />
    <paragraph name="<p class='custom-teilueberschrift'>Teilüberschrift</p>" value="p class='custom-teilueberschrift'" />
    <paragraph name="<p class='custom-text'>Text</p>" value="p class='custom-text'" />
  </paragraphs>

Unfortunately the classes are defined in a css file outside the iframe where the paragraphs should be shown. So the effect is: I select the text and set the paragraph style and nothing is show in the edit mode, of course... When I save the site the style is there. Can somebody tell me an elegant solution?
Stanimir
Telerik team
 answered on 21 Jan 2011
1 answer
98 views
Hello, I have a bar chart with some data, the problem is that the labels of each bar overlap one to earch other.
How can I fix this issue. (Attached is a screenshot)

Regards
Yavor
Telerik team
 answered on 21 Jan 2011
10 answers
174 views
Hello,

I have a problem with opening the radwindow control in firefox browser (It is working in all other browsers).

here is my java script code which opens the radwindow control in full width and full height:
function UseMainRadWindow() {
            var width = screen.width;
            var height = screen.height;
            var mapPosition = '<%= Session["MapPositionSession"].ToString() %>'
            var ctgrsLst = document.getElementById('ResultsLabel').innerText; 
            var oWnd = $find("<%= RadWindow1.ClientID %>");
            oWnd.show();
            oWnd.setUrl("Pages/FullMaps/MainMap.aspx?width=" + width.toString() + "&height=" + height.toString() + "&mapPosition=" + mapPosition.toString() + "&ctgrsLst=" + ctgrsLst.toString().replace(" & ", "."));
            oWnd.maximize();
        }

The above javascript code is placed on a MainMapWebUserControl.ascx, and "ResultsLabel" is placed on Default.aspx which calls MainMapWebUserControl.ascx.

Note, I tried the above code in other browsers and it is working fine whithout problems, but unfortunatily it is not working in firefox browser.
Please view the attached images: 1.jpg is the result on firefox and 2.jpg is the result on other browsers.

Please, I need your help,
It is apprecited to send me the modified code.

Regards,
Bader
Svetlina Anati
Telerik team
 answered on 21 Jan 2011
0 answers
69 views
Hi,

i'm using rad Async Upload control with Rad BinaryImage.
it doesn't work in Pop up page.
Please give the solution ASAP.

Thanks in Advance.
Naresh
Top achievements
Rank 2
 asked on 21 Jan 2011
3 answers
96 views
I am using version 4.5.4.0 and are trying to define the path to my custom table layout css file - I can easely define the path to a custom css file by writing this in my config file;

<property name="CssFiles">
  <item>/_layouts/1030/mypage/css/HtmlEditorCustomStyles.css</item>
</property>

But I cannot find a way to define the path to my HtmlEditorTableFormats.css - I have tried setting the TableLayoutCssFile property of my RadHtmlField control but this gives an error because the property does not exists and I have also tried putting it in my config file using

<property name="TableLayoutCssFile">
  <item>/_layouts/1030/mypage/css/HtmlEditorTableFormats.css</item>
</property>

but nor this works, so how can I define the path?
Stanimir
Telerik team
 answered on 21 Jan 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?