This is a migrated thread and some comments may be shown as answers.

[Solved] Table background images

7 Answers 139 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Roger Withnell
Top achievements
Rank 1
Roger Withnell asked on 09 Dec 2009, 11:39 PM
The ImageSrc icon to select a background image invokes the same DbContentProvider class as the Image Manager icon in the toolbar.

How do I invoke a different DbContentProvider class?

Thanking you in anticipation.

Roger

7 Answers, 1 is accepted

Sort by
0
Accepted
Rumen
Telerik team
answered on 11 Dec 2009, 04:13 PM
Hello Roger,

Yes, the ImageSrc icon uses the Image Manager and both uses the same DbcontentProvider class - this is by design. What you can do is to register the external dialogs paths and replace the <tools:ImageDialogCaller control inside the \EditorDialogs\TableProperties.ascx and CellProperties.ascx files with your own button that will launch a custom dialog.


Greetings,
Rumen
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Roger Withnell
Top achievements
Rank 1
answered on 13 Jan 2010, 05:19 PM
Thanks for your reply, Rumen.

Rather than adopt the solution you suggest, is it possible to send a flag to the DBContentProvider that indicates whether the ImageSrc icon was clicked in the toolbar or in the table (or cell) dialog?

Many thanks.

Roger
0
Rumen
Telerik team
answered on 18 Jan 2010, 09:00 AM
Hi Roger,

It is not possible to send a flag to the DBContentProvider but you can implement a custom button that will invoke the stanalone Image manager dialog. The following KB article will show you how to use the image manager as a standalone control: Using the Image and Document managers outside RadEditor.

Best regards,
Rumen
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Roger Withnell
Top achievements
Rank 1
answered on 18 Jan 2010, 06:12 PM
This is great, Rumen, but I get an error when running the code.

I have copied default.aspx and default.aspx.cs into my project, converting the default.aspx.cs to default.aspx.vb.

An error message said that DialogOpener was obsolete, so I changed it to RadDialogOpener as instructed and the file opened successfully.

But, when I click Open ImageManager, I get the error:

Line:121
Error: Sys.ArgumentNullException: Dialog Parameters for the ImageManager dialog do not exist
Parameter name: dialogName

Please advise.

Many thanks.

Roger

0
Rumen
Telerik team
answered on 19 Jan 2010, 02:01 PM
Hi Roger,

For your convenience I converted the C# code to VB.NET and attached a sample working project that demonstrates how to use the Image and Document manager dialogs outside of RadEditor.

All the best,
Rumen
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Roger Withnell
Top achievements
Rank 1
answered on 26 Jan 2010, 03:58 PM

Thanks for your reply and code, Rumen.

I have successfully built an image manager as a stand alone control that triggers from a custom button in the toolbar.

Now, I want to trigger it from the TableProperties.ascx file instead of the <tools.ImageDialogCaller control.

My control is:

<tr>
  <td style="padding: 3px 0;">
    <div class="propertyLabel" style="width: 104px;">
      <script type="text/javascript">document.write("Background Image");</script>:
    </div>
  </td>
  <td style="padding: 3px 0;">
    <input type="text" id="BgImageId" value="" />
    <webui:raddialogopener runat="server" id="DialogOpener1"></webui:raddialogopener>  
    <button onclick="fnDialogOpener()" />
  </td>
</tr>

and the function is:

<webui:RadCodeBlock ID="RadCodeBlock1" runat="server">
<script type="text/javascript">
    function fnDialogOpener() {
        $find('<%= DialogOpener1.ClientID %>').open('ImageManager', { CssClasses: [] });
        return false;
    }
</script>   
</webui:RadCodeBlock>

When I run this, the source code shows the function renders as follows:

<script type="text/javascript">
    function fnDialogOpener() {
        $find('').open('ImageManager', { CssClasses: [] });
        return false;
    }
</script>

Why doesn't <%= DialogOpener1.ClientID %> resolve?

Thanking you in anticipation.

Roger

0
Rumen
Telerik team
answered on 29 Jan 2010, 02:22 PM
Hi Roger,

You can find attached a sample example which demonstrates how to trigger the standalone ImageManager dialog from the TableProperties tab of the Table Wizard.
The new code is placed in the UserControl.ascx and TableProperties.ascx files.

Kind regards,
Rumen
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Editor
Asked by
Roger Withnell
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Roger Withnell
Top achievements
Rank 1
Share this question
or