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

Set BackGroundImage to RadDock

16 Answers 335 Views
Dock
This is a migrated thread and some comments may be shown as answers.
bhogavalli
Top achievements
Rank 1
bhogavalli asked on 11 Nov 2010, 07:06 AM
How  to set background image to raddock.

Thanks
Suresh

16 Answers, 1 is accepted

Sort by
0
Emanuel Varga
Top achievements
Rank 1
answered on 11 Nov 2010, 10:12 AM
Hello Suresh,

Sorry there is no clean and nice way of doing this,

But you can use this code to add an image primitive to the dock's children collection:
var splitPanelElement = radDock1.RootElement.Children[0] as SplitPanelElement;
var imagePrimitive = new ImagePrimitive();
imagePrimitive.Image = new Bitmap(@"c:\Work\axIcon.png");
splitPanelElement.Children.Add(imagePrimitive);

Hope this helps, if you have any other questions or comments, please let me know,

Best Regards,
Emanuel Varga
Telerik WinForms MVP
0
bhogavalli
Top achievements
Rank 1
answered on 11 Nov 2010, 10:25 AM
hi team,

I used the code in this way.

     SplitPanelElement i_radelemet = radDock1.RootElement.Children[0] as SplitPanelElement;
            ImagePrimitive i_imagepr=new ImagePrimitive();
            i_imagepr.Image = new Bitmap("C:\\temp\\ActiveAlarmList.png");
            i_radelemet.Children.Add(i_imagepr);


i am attaching file ,where i need a image ,but the above code does not work.Add does not display a image on raddock.

the Red color block where i need place an image.in the attached file

thanks
suresh
0
Emanuel Varga
Top achievements
Rank 1
answered on 11 Nov 2010, 10:30 AM
Hello again,

There is no attached image to your last post.

Best Regards,
Emanuel Varga
Telerik WinForms MVP
0
Emanuel Varga
Top achievements
Rank 1
answered on 11 Nov 2010, 10:36 AM
Hello again,

Sorry, I've just tested it again, and it is working, are you sure that is the location of your image?
You could try it with a verbatim string, but it shouldn't make a difference.
i_imagepr.Image = new Bitmap(@"C:\temp\ActiveAlarmList.png");

Please check the Image property of the i_imagepr after you set the image for null.

Hope this helps, if you have any other questions or comments, please let me know,

Best Regards,
Emanuel Varga
Telerik WinForms MVP
0
bhogavalli
Top achievements
Rank 1
answered on 11 Nov 2010, 10:50 AM
Hi team,

Attached file contain the information in debug mode.the bmp  file is present in the location.

But the image is not placed on raddock.please help.

Thanks
suresh
0
Emanuel Varga
Top achievements
Rank 1
answered on 11 Nov 2010, 10:52 AM
Hello again,

Which version of the telerik controls are you using?
With the Q2 version everything is working like this.

Best Regards,
Emanuel Varga
Telerik WinForms MVP
0
bhogavalli
Top achievements
Rank 1
answered on 11 Nov 2010, 10:55 AM
hi team,

Exe version:RadControls_WinForms_2010_1_10_504_dev.exe

Winforms Q1 2010 sp2.

Thanks
Suresh.
0
Emanuel Varga
Top achievements
Rank 1
answered on 11 Nov 2010, 10:57 AM
Could you please try updating to the latest version Q3 2010?

This should solve your problem.

Best Regards,
Emanuel Varga
Telerik WinForms MVP
0
bhogavalli
Top achievements
Rank 1
answered on 11 Nov 2010, 11:00 AM
hi team,

I have only a licensed version of RadControls_WinForms_2010_1_10_504_dev.exe.

If i  need to have  Q3 i have  to buy one more licensed copy .

Please let me know the details.Thanks a lot for the help.

Thanks
suresh.
0
Emanuel Varga
Top achievements
Rank 1
answered on 11 Nov 2010, 11:30 AM
Hello again,

Not even to Q2?

Best Regards,
Emanuel Varga
Telerik WinForms MVP
0
Stefan
Telerik team
answered on 17 Nov 2010, 11:01 AM
Hello bhogavalli,

Thank you for writing.

The desired behavior cannot be achieved with your version of our WinForms suite. You need to update to our latest release in order to be able set a background image. Feel free to download our Trial version from your account and give it a try.
 
Greetings,
Stefan
the Telerik team
See What's New in RadControls for WinForms in Q3 2010 on Wednesday, November 17, 11am Eastern Time: Register here>>
0
nc
Top achievements
Rank 1
answered on 09 Aug 2011, 09:06 AM
Hi
I would be thankful if you send the code in VB.NET for setting the Dock Control background .

Best Regards
0
Stefan
Telerik team
answered on 11 Aug 2011, 11:58 AM
Hello,

Thank you for writing.

Here is the requested code:
Dim lightVisualElement = New LightVisualElement
lightVisualElement.BackgroundImageLayout = ImageLayout.Stretch
lightVisualElement.BackgroundImage = New Bitmap("C:\Program Files (x86)\Telerik\RadControls for WinForms Q2 2011\Examples\QuickStart\Resources\06.png")
splitPanelElement.Children.Add(lightVisualElement)

I hope it helps.
 
Best wishes,
Stefan
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

0
Mattias Hermansson
Top achievements
Rank 1
answered on 22 Sep 2012, 06:29 PM

Hello,
is this still the right approach for applying a background image to a RadDock(want background when no DocumentWindow is shown):

var splitPanelElement = radDock1.RootElement.Children[0] as SplitPanelElement; 
var imagePrimitive = new ImagePrimitive(); 
imagePrimitive.Image = new Bitmap(@"c:\Work\axIcon.png"); 
splitPanelElement.Children.Add(imagePrimitive);

Because I could not get it to work.
I'm using WinForms Q2 2012 SP2(012.2.912.40)
0
Stefan
Telerik team
answered on 25 Sep 2012, 01:44 PM
Hello Anders,

The approach is the same, just the primitive should be added to the MainDocumentContainer:
void radButton1_Click(object sender, EventArgs e)
{
    var imagePrimitive = new ImagePrimitive();
    imagePrimitive.StretchHorizontally = true;
    imagePrimitive.StretchVertically = true;
    imagePrimitive.Image = new Bitmap(@"C:\img.png");
    radDock1.MainDocumentContainer.SplitPanelElement.Children.Add(imagePrimitive);
}

I hope this helps.
 
Kind regards,
Stefan
the Telerik team
RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
0
Mattias Hermansson
Top achievements
Rank 1
answered on 26 Sep 2012, 02:56 PM
@Stefan

Thanks, worked perfectly!
Tags
Dock
Asked by
bhogavalli
Top achievements
Rank 1
Answers by
Emanuel Varga
Top achievements
Rank 1
bhogavalli
Top achievements
Rank 1
Stefan
Telerik team
nc
Top achievements
Rank 1
Mattias Hermansson
Top achievements
Rank 1
Share this question
or