Telerik Forums
UI for ASP.NET AJAX Forum
7 answers
297 views

I would like Image Manager to display a list of images from a database so that they can be inserted into the editor.

I am using asp.net 3.5, Visual Web Developer 2008 Express and VB.

I understand that to do this I need to build a Custom FileBrowserContent Provider as described in:

http://www.telerik.com/help/aspnet-ajax/customfilebrowsercontentprovider.html

I have created MyContentProvider class in MyCustomProvider namespace as per the above help page and added:

<%@ Register Namespace = "MyCustomProvider" TagPrefix = "MyCp" Assembly="App_Code" %>

But when I add:

RadEditor1.ImageManager.ContentProviderTypeName = "ContentProviders.RadEditor.MyContentProvider, App_Code" to my code behind, the Image Manager page has the following error:

Value cannot be null.
Parameter name: type
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentNullException: Value cannot be null.
Parameter name: type

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. 

Stack Trace:

[ArgumentNullException: Value cannot be null.
Parameter name: type]
   System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) +7679178
   Telerik.Web.UI.RadFileExplorer.InitContentProvider(String selectedUrl) +226
   Telerik.Web.UI.RadFileExplorer.InitContentProvider() +138
   Telerik.Web.UI.RadFileExplorer.BindExplorer() +48
   Telerik.Web.UI.RadFileExplorer.OnLoad(EventArgs e) +139
   System.Web.UI.Control.LoadRecursive() +50
   System.Web.UI.Control.LoadRecursive() +141
   System.Web.UI.Control.LoadRecursive() +141
   System.Web.UI.Control.LoadRecursive() +141
   System.Web.UI.Control.LoadRecursive() +141
   System.Web.UI.Control.LoadRecursive() +141
   System.Web.UI.Control.LoadRecursive() +141
   System.Web.UI.Control.LoadRecursive() +141
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627

I've also tried setting it with the example (from the Help page above):

RadEditor1.FileBrowserContentProviderTypeName = typeof(DatabaseContentProvider).AssemblyQualifiedName

but I don't know the VB syntax for this.

Your help would be much appreciated.

Thanking you in anticipation.

Roger

 

Rumen
Telerik team
 answered on 13 Sep 2011
1 answer
208 views
Hi,
We have a situation where we have a RadEditor (on an object edit page) that has two EditorToolGroups.  When opening an existing object, the RadEditor is visible with the page opening and the second EditorToolGroup starts a second line in the header, as it should.  However, when creating a new object, the RadEditor is only needed sometimes so it is not visible when the page is initially rendered.  In this case, the second EditorToolGroup starts at the end of the first EditorToolGroup and seems to be constrained horizontally to the space between where it started and the end of the line, thus it wraps to several lines, all to the far right of the ToolBar.  This may be further complicated (or not) by the fact that the RadEditor is contained in a user control (.ascx) file.  I have attached the RadEditor definition below.

Thanks for your help,
Dan Norton

<telerik:RadEditor ID="BodyEditor" Runat="server" 
                    Width="600px" Height="255px"
                    EditModes="Design, Preview"
                    EnableResize="false"
                    StripFormattingOnPaste="All" 
                    SkinID="DefaultSetOfTools"
                    MaxTextLength="4000" 
                    OnClientCommandExecuting="OnClientCommandExecuting" 
                    >
    <Tools>
        <telerik:EditorToolGroup Tag="toolBar">
            <telerik:EditorDropDown Name="FormatBlock" Text="Normal" />
            <telerik:EditorDropDown Name="FontName" Text="Font" Width="125" />
            <telerik:EditorDropDown Name="RealFontSize" Text="Size" />
            <telerik:EditorSeparator Visible="true" />
            <telerik:EditorDropDown Name="ddnFieldSelect_WO" Text="Add Work Order Field" Width="125" />
            <telerik:EditorDropDown Name="ddnFieldSelect_EV" Text="Add Event Field" Width="125" />
        </telerik:EditorToolGroup>
        <telerik:EditorToolGroup>
            <telerik:EditorTool Name="Bold" Text="Bold" />
            <telerik:EditorTool Name="Italic" Text="Italic" />
            <telerik:EditorTool Name="Underline" Text="Underline" />
            <telerik:EditorSeparator Visible="true" />
            <telerik:EditorTool Name="JustifyLeft" Text="Align Left" />
            <telerik:EditorTool Name="JustifyCenter" Text="Center" />
            <telerik:EditorTool Name="JustifyRight" Text="Align Right" />
            <telerik:EditorTool Name="JustifyFull" Text="Justify Full" />
            <telerik:EditorSeparator Visible="true" />
            <telerik:EditorTool Name="InsertOrderedList" Text="Ordered List" />
            <telerik:EditorTool Name="InsertUnorderedList" Text="Unordered List" />
            <telerik:EditorSeparator Visible="true" />
            <telerik:EditorTool Name="Outdent" Text="Outdent" />
            <telerik:EditorTool Name="Indent" Text="Indent" />
            <telerik:EditorTool Name="ForeColor" Text="Text Color" />
            <telerik:EditorTool Name="BackColor" Text="Background Color" />
            <telerik:EditorSeparator Visible="true" />
            <telerik:EditorTool Name="InsertLink" Text="Insert Link" />
            <telerik:EditorSeparator Visible="true" />
            <telerik:EditorTool Name="Cut" Text="Cut" />
            <telerik:EditorTool Name="Copy" Text="Copy" />
            <telerik:EditorTool Name="Paste" Text="Paste" />
            <telerik:EditorSeparator Visible="true" />
            <telerik:EditorTool Name="Undo" Text="Undo" />
            <telerik:EditorTool Name="Redo" Text="Redo" />
            <telerik:EditorSeparator Visible="true" />
            <telerik:EditorTool Name="AjaxSpellCheck" Text="Spell Checker" />
        </telerik:EditorToolGroup>
    </Tools>
    <Modules>
        <telerik:EditorModule Name="RadEditorStatistics" Visible="true" />
    </Modules>
    <RealFontSizes>
        <telerik:EditorRealFontSize Value="8pt" />
        <telerik:EditorRealFontSize Value="9pt" />
        <telerik:EditorRealFontSize Value="10pt" />
        <telerik:EditorRealFontSize Value="11pt" />
        <telerik:EditorRealFontSize Value="12pt" />
        <telerik:EditorRealFontSize Value="14pt" />
        <telerik:EditorRealFontSize Value="16pt" />
        <telerik:EditorRealFontSize Value="18pt" />
        <telerik:EditorRealFontSize Value="20pt" />
        <telerik:EditorRealFontSize Value="22pt" />
        <telerik:EditorRealFontSize Value="24pt" />
        <telerik:EditorRealFontSize Value="26pt" />
        <telerik:EditorRealFontSize Value="28pt" />
        <telerik:EditorRealFontSize Value="36pt" />
        <telerik:EditorRealFontSize Value="48pt" />
        <telerik:EditorRealFontSize Value="72pt" />
    </RealFontSizes>
</telerik:RadEditor>
Rumen
Telerik team
 answered on 13 Sep 2011
5 answers
132 views
Hi,
We're using this editor with html that contains a number of expando attributes.  The actual HTML elements are SPAN tags.  The problem is that when we style these tags, i.e. change font size, all of the expando attributes are cleared.

I tried using the OnClientCommandExecuting event to grab all attributes and the OnClientCommandExecuted event to re-apply them.  Unfortunately it seems to be after the "Executed" event that the attributes are removed.

Is there a way to prevent this behaviour or to hook into a later event to re-apply these expando attributes?
Rumen
Telerik team
 answered on 13 Sep 2011
1 answer
61 views
Hi,

We are using scheduler. When displaying the scheduler the not alligned properly (Picture attached).

Used the css

.rsTimelineView .rsAllDayRow
{
    height: 25px !important;
}

Please let me know how to resolve the issue.

Thanks
pradeep
Top achievements
Rank 1
 answered on 13 Sep 2011
1 answer
63 views
Upon clicking check box and firing the new event I load an adjacent ListBox. All this is done in an AJax Panel and works fine. The ComboBox then collapse. I would like to keep the ComboBox open and collapse it when I click on a button located else where on the page.
Thanks
Kalina
Telerik team
 answered on 13 Sep 2011
1 answer
106 views
Hi,

I am experiencing a very odd issue. If you have a RadAsyncUpload in an UpdatePanel on Windows XP you get the following js error:

'Error: uncaught exception: Syntax error, unrecognized expression: [object Object]'

This error appears to be related to JQuery. I get the error in any browser on Windows XP but on no browser on Windows Vista. The following code will reproduce the error:

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head runat="server">
    <title>RadAsyncUpload in UpdatePanel on Windows XP Test</title>
</head>
<body>
    <form runat="server" enctype="multipart/form-data">
        <asp:ScriptManager runat="server" />
        <asp:UpdatePanel ID="UpdatePanel" runat="server"><ContentTemplate>
            <rad:RadAsyncUpload runat="server" MultipleFileSelection="Automatic" />
            <asp:Button runat="server" OnClick="OnClick" Text="Run Test" />
        </ContentTemplate></asp:UpdatePanel>
    </form>
</body>
</html>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
 
public partial class _Default : System.Web.UI.Page
{
    protected void OnClick(object sender, EventArgs e)
    {
        System.Web.UI.ScriptManager.RegisterStartupScript(UpdatePanel, typeof(string), Guid.NewGuid().ToString(), "alert('Successful');", true);
    }
}

Or you can test at http://xptest.abcweblink.com/

Notice that the mere presence of the RadAsyncUpload causes the error even though it doesn't actually do anything.

Thank you for any assistance.

Jeff Paetkau
Genady Sergeev
Telerik team
 answered on 13 Sep 2011
4 answers
373 views
Basically need a way to check that the newly inserted record does not already exist in the rad grid.

my insert command code looks like below. and it works fine for checking that not a blank record is inserted, I just need to add a check that a name does not already exist. Any help would be appreciated.

Protected

Sub cEventTypesGrid_InsertCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles cEventTypesGrid.InsertCommand

 

 

Dim editedItem As GridEditableItem = TryCast(e.Item, GridEditableItem)

 

Dim vLogin As TableCell = editedItem("Name")

Dim vTxtLogin As String = (CType(vLogin.Controls(0), RadComboBox)).SelectedValue


If
vTxtLogin = "" Then

 

Throw New Exception("Name cannot be blank."

End If

Jayesh Goyani
Top achievements
Rank 2
 answered on 13 Sep 2011
2 answers
101 views

Hello everybody i am a little bit stuck and unable to figure aout the problem i am having.... my buttun in bellow form doesn't do anything, this example is guided from http://demos.telerik.com/aspnet-ajax/editor/examples/saveindatabase/defaultcs.aspx only differnce is that i use sql database, here is my example:

this is cs
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
using Telerik.Web.UI;


public partial class editVijesti_vijesti : System.Web.UI.Page
{
   
protected void Page_Load(object sender, EventArgs e)
   
{
       
if (!Page.IsPostBack)
       
{
           
ReadAllRecords();
       
}
   
}

   
   
public void btnSpremi_Click(object sender, EventArgs e)
   
{
       
SqlConnection connection = CreateConnection();
       
SqlCommand command= null;

       
if (uredeneVijesti.Value != string.Empty)
       
{
            command
= new SqlCommand("UPDATE Vijesti SET Datum = Now(), TijeloVijesti = @content WHERE vijestiID= @nid", connection);
            command
.Parameters.AddWithValue("content", EditorVijesti.Content);
            command
.Parameters.AddWithValue("nid", Convert.ToInt32(uredeneVijesti.Value));
       
}

       
else
       
{
            command
= new SqlCommand("INSERT INTO Vijesti (Datum, TijeloVijesti) VALUES (Now(), @content)", connection);
            command
.Parameters.AddWithValue("content", EditorVijesti.Content);
           
       
}
       
try
       
{
            command
.ExecuteNonQuery();
       
}
       
catch (Exception)
       
{ }
        connection
.Close();
       
this.Response.Redirect(this.Request.Url.PathAndQuery);

   
}


   
protected SqlConnection CreateConnection()
   
{
       
SqlConnection connection = new SqlConnection();
        connection
.ConnectionString = "Data Source=mssql3.mojsite.com,1555;Initial Catalog=iskratrade_hai;Persist Security Info=True;User ID=iskratrade_hai;Password=091011br"; connection.Open();
       
return connection;
   
}

   
   
protected void gridVijesti_ItemCommand(object sender, DataGridCommandEventArgs args)
   
{
       
SqlConnection connection = CreateConnection();
       
if (args.CommandName == "Delete")
       
{
           
SqlCommand com = new SqlCommand("DELETE FROM  Vijesti WHERE vijestiID =@nid", connection);
            com
.Parameters.AddWithValue("nid", args.Item.Cells[0].Text);
            com
.ExecuteNonQuery();
            connection
.Close();
       
}
       
else if (args.CommandName == "Edit")
       
{
           
SqlCommand command = new SqlCommand("SELECT TijeloVijesti FROM Vijesti WHERE vijestiID= @nid", connection);
            command
.Parameters.AddWithValue("nid", args.Item.Cells[0].Text);
           
SqlDataReader record = command.ExecuteReader();
           
if (record.Read())
           
{
               
EditorVijesti.Content = record.GetString(0);
                uredeneVijesti
.Value = args.Item.Cells[0].Text;
           
}
           
else
           
{
               
EditorVijesti.Content = "";
                uredeneVijesti
.Value = "";
           
}
            record
.Close();

       
}
        connection
.Close();
       
ReadAllRecords();
   
}
   
private void ReadAllRecords()
   
{
       
SqlConnection connection = CreateConnection();
       
SqlCommand command2 = new SqlCommand("SELECT vijestiID, Datum, TijeloVijesti FROM Vijesti", connection);
        gridVijesti
.DataSource = command2.ExecuteReader();
        gridVijesti
.DataBind();
        connection
.Close();
   
}
 
}
 
and this is aspx page:
 
<asp:ScriptManager ID="scriptmanager" runat="server"/>
           
       
       
<div>
         
<input type="hidden" name="uredeneVijesti" runat="server" id="uredeneVijesti" />

   
<telerik:RadEditor ID="EditorVijesti" runat="server" SkinID="DefaultSetOfTools"
            height
="500px" Width="800px">
           
<Modules>
             
<telerik:EditorModule Name="RadEditorStatistics" Visible="false" Enabled="true" />
               
<telerik:EditorModule Name="RadEditorDomInspector" Visible="false" Enabled="true" />
                           
<telerik:EditorModule Name="RadEditorNodeInspector" Visible="false" Enabled="true" />
                           
<telerik:EditorModule Name="RadEditorHtmlInspector" Visible="false" Enabled="true" />
           
</Modules>
     

    <ImageManager ViewPaths="~/
editVijesti" UploadPaths="~/editVijesti/slike/novo" DeletePaths="~/editVijesti/slike/obrisano" />
    <FlashManager DeletePaths="
editVijesti/slike/obrisano" UploadPaths="~/editVijesti/slike/novo" ViewPaths="~/editVijesti/slike" />
    <DocumentManager DeletePaths="
editVijesti/slike/obrisano" UploadPaths="~/editVijesti/slike/novo" ViewPaths="~/editVijesti/slike" />
    <MediaManager DeletePaths="
editVijesti/slike/obrisano" UploadPaths="~/editVijesti/slike/novo" ViewPaths="~/editVijesti/slike" />
    <TemplateManager DeletePaths="
editVijesti/slike/obrisano" UploadPaths="~/editVijesti/slike/novo" ViewPaths="~/editVijesti/slike" />
        </telerik:RadEditor>

        <br />
        <asp:Button ID="
btnSpremi" runat="server" Text="Spremi u bazu" OnClick="btnSpremi_Click" />
        <br />
        <br />
       <asp:DataGrid ID="
gridVijesti" runat="server" BorderWidth="1px" CellPadding="3"
            AutoGenerateColumns="
False" Width="620px"
            OnItemCommand="
gridVijesti_ItemCommand">
         <HeaderStyle Font-Names="
Verdana" ForeColor="Black" BackColor="#d3e5fa" />
           
<Columns>
             
               
<asp:BoundColumn DataField="vijestiID"></asp:BoundColumn>
               
<asp:ButtonColumn CommandName="Delete" ButtonType="LinkButton"
                   
HeaderText="Obriši" Text="Delete"></asp:ButtonColumn>
               
<asp:ButtonColumn ButtonType="LinkButton" CommandName="Edit" HeaderText="Uredi" Text="Uredi"></asp:ButtonColumn>
               
<asp:BoundColumn DataField="Datum" HeaderText="Datum"></asp:BoundColumn>

             
<asp:BoundColumn DataField="TijeloVijesti" HeaderText="Tekst"></asp:BoundColumn>
             
           
</Columns>
       </
asp:DataGrid>

   
</div>



problem is with the button btnSpremi no insert to database, tables are set to Datum-- datetame (data type) , vijestiID----int -is identity incremenet seed, and TijeloVijesti --nvarchar(MAX) .. .. unable to insert to database read from databse is working good delete also but insert nothing... please if you can look at the code,.. regards

Rumen
Telerik team
 answered on 13 Sep 2011
1 answer
80 views
Pavlina
Telerik team
 answered on 13 Sep 2011
6 answers
112 views
Hi,

i want to disable checkbox of recursion in case user is editing indivisual appointment of recurrsive appointment. any idea to acheive that. if editing is for series checkbox needs to be enabled else disabled.


Thanks
Kevin
Top achievements
Rank 1
 answered on 13 Sep 2011
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?