Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
70 views
Hi All,

Just noticed that when we copy text from an MS Word (2007) document that has comments inserted that they are appearing as footnotes in the Radeditor.  Example of code below:

<P>The <A>transitional provisions in the <em>Act 2009</em> </A><A id=_anchor_1 language=JavaScript>[b1]</A> (PPS Act) are designed to facilitate a seamless changeover.</P>
<DIV>
<HR align=left SIZE=1 width="33%">
  
<DIV>
<DIV id=_com_1 language=JavaScript><A></A>
<P> <A>[b1]</A>In hoverfield: < Chapter 9, <em>Act</em> <em>09</em>.> </P></DIV></DIV></DIV>


We have got the radeditor converting <b> and <i> tags to <strong> and <em> and also have the radeditor stripping span, font and inline CSS styles on paste.

Cheers,

Troy
Rumen
Telerik team
 answered on 31 Jan 2011
5 answers
925 views
Hi all,

I had the following, (which worked till I upgraded my Controls)
a method which returned via an arraylist any and all RadGrids found on a page ..i.e.

Logger.findRadGrids(Page.Controls);
which is as follows

 

    public RadGrid findRadGrids(ControlCollection collection)

 

    {

 

        RadGrid result;

 

 

        foreach (Control ctrl in collection)

 

        {

 

            if (ctrl.Controls.Count > 0)

 

            {

                result = findRadGrids(ctrl.Controls);

 

                if (result != null)

 

                {

                    RadGrids.Add(result);

                }

            }

 

            else if (ctrl.GetType() == typeof(RadGrid))

 

            {

                RadGrids.Add(ctrl);

            }

 

            else if (ctrl.GetType() == typeof(Telerik.Web.UI.RadGrid))

 

            {

                RadGrids.Add(ctrl);

            }

        }

 

return null;

 

}


I then iterated thru this arraylist...getting the ItemCommand which I could then validate commandtypes against authorizations per user.
and log these.
//Originally...

 

foreach (RadGrid grid in Logger.RadGrids)

 

 

{

 

 

 grid.ItemCommand += new GridCommandEventHandler(grid_ItemCommand);

 

 

}
//Now (mixed versions of RadCtls  requiring .WebControls and .Web.UI )

 

for

(int i = 0; i < Logger.RadGrids.Count; ++i)

 

{

 

    if (Logger.RadGrids[i].GetType() == typeof(Telerik.Web.UI.RadGrid))

 

    {

        Telerik.Web.UI.

RadGrid grid = (Telerik.Web.UI.RadGrid)Logger.RadGrids[i];

 

 

        grid.ItemCommand +=

new Telerik.Web.UI.GridCommandEventHandler( grid_ItemCommand);

 

    }

 

    else

 

 

 

    {

        Telerik.WebControls.

RadGrid grid = (Telerik.WebControls.RadGrid)Logger.RadGrids[i];

 

        grid.ItemCommand +=

new GridCommandEventHandler( grid_ItemCommand);

 

    }

}

 


//Authorize or disallow actions on Grids

 

 

public void grid_ItemCommand(object source, GridCommandEventArgs e)

 

{

 

GridDataItem dataItem = new GridDataItem(((RadGrid)source).MasterTableView, 0, 0);

 

 

Hashtable htValues = new Hashtable();

 

 

switch (e.CommandName)

 

{

 

case RadGrid.UpdateCommandName:

 

{

 

if (!PagePrivilege.EditData)

 

{

disallowAction(

"Not allowed to Edit any Data");

 

e.Canceled =

true;

 

}

dataItem = ((

GridDataItem)((RadGrid)source).EditItems[0]);

 

 

goto extract;

 

}

 

case RadGrid.DeleteCommandName:

 

{

 

if (!PagePrivilege.DeleteData)

 

{

disallowAction(

"Not allowed to Delete any Data");

 

e.Canceled =

true;

 

}

dataItem = e.Item

as GridDataItem;

 

 

goto extract;

 

}

 

case RadGrid.PerformInsertCommandName:

 

{

 

if (!PagePrivilege.AddData)

 

{

disallowAction(

"Not allowed to insert any Data");

 

e.Canceled =

true;

 

}

((

RadGrid)source).MasterTableView.GetInsertItem().ExtractValues(htValues);

 

 

goto logg;

 

}

extract:

{

dataItem.ExtractValues(htValues);

 

goto logg;

 

}

logg:

{

 

this.Logger.logEvent(e.CommandName, htValues, 1);

 

 

break;

 

}

 

default:

 

{

 

break;

 

}

}

 


Now with the new versions of the controls, this generated the following error

Error 109 No overload for 'grid_ItemCommand' matches delegate 'Telerik.Web.UI.GridCommandEventHandler' 

How do I go about fixing this please


TIA
Neal

Neal
Top achievements
Rank 1
 answered on 31 Jan 2011
4 answers
359 views
Hi,
I have created a web sites in which I have created a master page and created a web content form which I have connected it to that master page and in that content form I have placed a rad editor. The rad editor is not working on that page and if I created a simple web page and not connected it with master page then its working fine. So please give me some suggestion to fix this problem.
Code on aspx page is

<%@ Page Title="" Language="C#" MasterPageFile="~/DefaultMaster.Master" AutoEventWireup="true" CodeBehind="AddNewsletter.aspx.cs" Inherits="Aciron.Touch.AddNewsletter" Theme="Default" MaintainScrollPositionOnPostback="true"%>

<%@ Register src="UserControls/Header.ascx" tagname="Header" tagprefix="uc1" %>

<%@ Register src="UserControls/SubHeader.ascx" tagname="SubHeader" tagprefix="uc2" %>

<%@ Register src="UserControls/Footer.ascx" tagname="Footer" tagprefix="uc3" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

<uc1:Header ID="Header1" runat="server" />

</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" runat="server">

<uc2:SubHeader ID="SubHeader1" runat="server" />

</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder3" runat="server">

<div>

<telerik:RadEditor ID="txtMessage" CssClass="Normal12px" runat="server" ContentFilters="MakeUrlsAbsolute" OnClientCommandExecuting="OnClientCommandExecuting" OnClientLoad="OnClientLoad" >

<CssClasses>

<telerik:EditorCssClass Name="Clear Class" Value="" />

</CssClasses>

<Content></Content>

<ImageManager UploadPaths="~/Images" DeletePaths="~/Images" ViewPaths="~/Images" />

<TemplateManager UploadPaths="~/Templates" DeletePaths="~/Templates" ViewPaths="~/Templates" />

</telerik:RadEditor>

</div>

</asp:Content>

<asp:Content ID="Content4" ContentPlaceHolderID="ContentPlaceHolder4" runat="server">

<uc3:Footer ID="Footer1" runat="server" />

</asp:Content>
I am attaching a screenshot that shows the tooltip on rad editor.Thanks.

Rumen
Telerik team
 answered on 31 Jan 2011
2 answers
181 views
Good day! I have gor such a grid on page

<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ExpertAdvice.ascx.cs" Inherits="Pharm.New.UserModules.ExpertAdvice" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

<br />
<telerik:RadGrid ID="grQuestions" runat="server" CssClass="MyGridClass" ShowHeader="false"
        AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" Skin="FarmPortal2" EnableEmbeddedSkins="false"
        GridLines="None" Width="100%" PageSize="10" GroupPanel-Width="100%">
<MasterTableView TableLayout="Auto" Width="100%">
    <PagerStyle AlwaysVisible="true" />
    <Columns>
        <telerik:GridBoundColumn DataField="Id" HeaderText="Id" ReadOnly="True" UniqueName="Id" SortExpression="Id"  Visible="false"/>
        <telerik:GridBoundColumn DataField="Post" HeaderText="?????" ReadOnly="True" UniqueName="Post" SortExpression="Post"  />
    </Columns>
</MasterTableView>
    <ClientSettings EnableRowHoverStyle="true" AllowColumnsReorder="True" AllowDragToGroup="True" Resizing-EnableRealTimeResize="true"
        ReorderColumnsOnClient="True">
        <Selecting AllowRowSelect="True" />
    </ClientSettings>
</telerik:RadGrid>

When I click first and last page buttons in Grid paging I have got an error which asks me to add enableEventValidation="false" string into <pages> in Web.config file in my project (for example I use RadGrid with paging in other pages of my project and first and last page buttons works fine there).
After I add enableEventValidation="false" string into <pages> in Web.config file in my project first and last page buttons click do not work too - there is no more error, but nothing happens at all. prev/newx page buttons works well. All other gid's first and last page buttons work well. What can I do?

Thank you,
Lina
Pavlina
Telerik team
 answered on 31 Jan 2011
3 answers
216 views
Hi,
I want to rebind my RadComboBox and my CheckBoxList once the RadWindow had been closed. I have this javascript that runs on the OnClientClose event of RadWindow:

function closeRadwindow() {
            $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest();
        }



This script invoke an ajaxRequest() in the OnClientclose event handler. Then in the Event handler rebind the radcombobox.

Private Sub RadAjaxManager1_AjaxRequest(ByVal sender As Object, ByVal e As Telerik.Web.UI.AjaxRequestEventArgs) Handles RadAjaxManager1.AjaxRequest
        ddClient.DataBind()
        chckSoftware.DataBind()
    End Sub

But I can't still rebind my RadComboBox and CheckBoxList. Any suggestion/help will be greatly appreciated.

Thanks!

Georgi Tunev
Telerik team
 answered on 31 Jan 2011
0 answers
67 views
Hello I am using Radgrid, and Image control when i close radwindow my parent control is refresh except  Image Control. 
how can i rebind image control also.
Amitkumar
Top achievements
Rank 1
 asked on 31 Jan 2011
1 answer
94 views
I get the following error when I place a RadListBox inside the edit template of a RadGrid and ajaxify them with the RadAjaxManagerProxy:

 Microsoft JScript runtime error: 'Telerik.Web.UI.RadListBox' is null or not an object

Here's a sample of code
<telerik:RadAjaxManagerProxy ID="RadAjaxProxy1" runat="server">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="updatePanel">           
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="updatePanel"
                       LoadingPanelID="RadAjaxLoadingPanel2" /> 
                <telerik:AjaxUpdatedControl ControlID="RadGrid1" />          
            </UpdatedControls>
        </telerik:AjaxSetting>       
    </AjaxSettings>
</telerik:RadAjaxManagerProxy>
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel2" runat="server" Skin="Default" />
 
<asp:Panel ID="updatePanel" runat="server">
 
<telerik:RadGrid ID="RadGrid1" runat="server" DataSourceID="myDataSource" AllowAutomaticInserts="false"
     AllowAutomaticUpdates="false" AllowPaging="true" PageSize="50"
     AllowAutomaticDeletes="true" onitemcommand="RadGrid1_ItemCommand"
        oninsertcommand="RadGrid1_InsertCommand"
        onupdatecommand="RadGrid1_UpdateCommand">
        <MasterTableView AutoGenerateColumns="False" DataSourceID="myDataSource"
        HeaderStyle-HorizontalAlign="Center" CommandItemDisplay="Top">
            <Columns>
                <telerik:GridEditCommandColumn ButtonType="ImageButton" EditText="Edit" />
                <telerik:GridBoundColumn DataField="Field1" HeaderText="Field1"
                    ItemStyle-HorizontalAlign="Center" ReadOnly="true" >
                </telerik:GridBoundColumn>
            </Columns>
            <EditFormSettings EditFormType="Template">
             <FormTemplate>
              <div>
              <table>
              <tr>
              <td>
              <asp:TextBox ID="txtField1" runat="server" Text='<%# Bind("Field1") %>' />
              </td>
              <td valign="top">                                   
             <telerik:RadListBox ID="lstBox1" runat="server"
                              DataSourceID="listboxDataSource" 
                             DataTextField="TextField" DataValueField="ValueField" Height="200px" Width="400px"
              CheckBoxes="true" />                                
             </td>
              </tr>
              </table>                      
                <div class="commandLinksDiv">
                 <asp:LinkButton ID="lnkBtnUpdate" runat="server"
    CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'
                 CssClass="commandLinks" ValidationGroup="vldEditForm">
                    <img src="../../Styles/images/Update.gif" alt="" />
                      <span><%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %></span>
                 </asp:LinkButton>
                 <asp:LinkButton ID="lnkBtnCancel" runat="server" CausesValidation="false"
                     CommandName="Cancel" CssClass="commandLinks" Text="Cancel">
                  <img src="../../Styles/images/Cancel.gif" alt="" />
                  <span>Cancel</span>
                  </asp:LinkButton>
                 </div>
                </div>
             </FormTemplate>
                <EditColumn ButtonType="ImageButton" CancelText="Cancel" InsertText="Insert"
                    UniqueName="EditCommandColumn1" UpdateText="Update">
                </EditColumn>
            </EditFormSettings>
        </MasterTableView>
    </telerik:RadGrid>
</asp:Panel>

I get the error when I am debugging from Visual Studio and go into edit or insert mode.  Has anyone had this problem or know how to fix it?
Helen
Telerik team
 answered on 31 Jan 2011
1 answer
107 views
Hi all i have a very strange behavior concerning he RadNumericTextbox. I have numeric textboxes that are used in a grid edit template. These numeric textboxes allow for decimal typed values.

After initial insert the values are displayed correctly in the grid (see picture "numeric_tb_issue_p1.png"). when i however edit the record again the numeric values seem to be multiplied by 10.000 (see picture "numeric_tb_issue_p2.png" ). I have no clue whats so ever what's causing this behavior.

Doe anyone have any ideas how to solve this ? Below you can find the settings of one of the numeric textboxes for reference. 

 

<telerik:RadNumericTextBox ID="UnitPrice_RadNumericTextBox" runat="server"

 

 

NumberFormat-DecimalDigits="2" NumberFormat-GroupSeparator="" MaxLength="6" Text='<%# Bind("UnitPrice") %>' Type="Currency"

 

 

ontextchanged="UnitPrice_RadNumericTextBox_TextChanged" AutoPostBack="true"

 

 

CssClass="orderline-input">

 

Maria Ilieva
Telerik team
 answered on 31 Jan 2011
2 answers
159 views

I'm trying to integrate RadContextMenu into GridView , I'm ware of example which do this with RagGrid but I prefer to do it with normal gridview, I add this code into my TemplateField :

<telerik:RadContextMenu ID="ChooseDesktopImage" runat="server"
            EnableRoundedCorners="true" EnableShadows="true" OnClientItemClicked="OpenTagging">
            <Targets>
                <telerik:ContextMenuElementTarget ElementID="lblFileName" />
            </Targets>
            <Items>
                <telerik:RadMenuItem Text="Tag" Value='<%# Bind("workspace_file_mapping_id")  %>' />
            </Items>
        </telerik:RadContextMenu>

But I get compile error which says :

The RadMenuItem control with a two-way databinding to field workspace_file_mapping_id must have an ID.

Is that even possible to do what I want?

Regards
Mazdak
Mazdak
Top achievements
Rank 1
 answered on 31 Jan 2011
1 answer
53 views
Hello,

With IE i have a problem : when i click on add button to add an input to select files , it creates  2 !!
And after postback ,  the second file have the same file name of the first file ??

Thanks!!
Dimitar Terziev
Telerik team
 answered on 31 Jan 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?