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

Expand/Collapse Icon not changing on Dynamic Docks

7 Answers 153 Views
Dock
This is a migrated thread and some comments may be shown as answers.
George
Top achievements
Rank 1
George asked on 08 Mar 2010, 08:21 AM
Is anyone else running into this?

If I create a Dock in HTML, the Expand/Collapse command icon changes as expected.
However, if I create a Dock in Code-Behind, the Expand/Collapse command icon does not change.
I get the same result if I set a custom icon with CssClass and AlternateCssClass.
I'm hoping I'm just missing something...

Also, as a secondary question, the Expand/Collapse Command doesn't seem to want to postback to the server even if I set it's AutoPostback to true.  I have a specific need for this, but it refuses to fire.  (Again, this seems to happen on a dock created in codebehind.)

Telerik... If I'm missing something, if you can supply a quicky sample app demostrating the expand/collapse working properly when created from code-behind... all the better!

Thanks, Kuba

7 Answers, 1 is accepted

Sort by
0
Pero
Telerik team
answered on 10 Mar 2010, 05:33 PM
Hi Kuba,

I have attached a sample project that creates a dock control dynamically in the code behind and attaches an event handler to the RadDock.Command event. You will notice that the EpxandCollapse image is changed and the page is posted back to the server, when the dock is expanded/collapsed.

Kind regards,
Pero
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
George
Top achievements
Rank 1
answered on 12 Mar 2010, 09:00 PM
Hi Pero,

Whatever my issue was with the default icons resolved when I installed 2010.1.(312).  So, on that aspect, it was just me, however, I would like to use custom icons for expand/collapse (that fall in line with icons I'm using for custom commands).  However, using custom icons is still not working.

The problem may be my perception on how the control works.  Here is how I create the expand/collapse command for the dock...
DockExpandCollapseCommand dcCustomerExCo = new DockExpandCollapseCommand();  
dcCustomerExCo.Text = "Expand/Colapse";  
dcCustomerExCo.Name = "CustomerExCo";  
dcCustomerExCo.CssClass = "trakerDockCollapseIcon";  
dcCustomerExCo.AlternateCssClass = "trakerDockExpandIcon";  
dcCustomerExCo.AutoPostBack = false;  
 
I, of course, Add it to the collection later in the code.

Here are the CSS Classes used:
.trakerDockExpandIcon{margin-top:2pxwidth15pxbackground:url(../../images/expand.gif) !important; background-repeat:no-repeat !important;}  
.trakerDockCollapseIcon{margin-top:2pxwidth15pxbackground:url(../../images/collapse.gif) !important; background-repeat:no-repeat !important;}  
 

I assume that AlternateCssClass is the "other" icon when the dock is collaped.  Is that a correct assumption?  I also tried setting AutoPostBack to true, but that made no difference (and would rather not do that anyway... for this command).

If my assumption is wrong, please let me know.  If my assumption is correct... any ideas why it doesn't work?

Thanks, Greg
0
George
Top achievements
Rank 1
answered on 12 Mar 2010, 09:18 PM
Hi Pero,

It appears I have answered my own question, but wanted you to confirm the bug.  This occurs in even the most current internal build (2010.1.312)...

If you assign the command a name:

dcCustomerExCo.Name = "CustomerExCo";  

I thought maybe it was problem with the Telerik Base Stylesheets looking for a particular name, but I couldn't find anything like that in the base, or the skin being used (which is a knock-off of the Windows7 skin).

If you can please confirm this bug, I'd appreciate it.

Thanks, Greg
0
George
Top achievements
Rank 1
answered on 16 Mar 2010, 06:16 AM
Hi Pero,

Would you guys like me to open a support ticket to get this confirmed?

Thanks, Greg
0
Pero
Telerik team
answered on 18 Mar 2010, 09:26 AM
Hello Greg,

You need to override .rdCollapse and .rdExpand RadDock selectors to specify custom images for the ExpandCollapse Command. The CSS should look like the following:
<style type="text/css">
    .rdCollapse
    {
        background: url('img/Collapse.png') no-repeat 0 0 !important;
    }
    .rdExpand
    {
        background: url('img/Expand.png') no-repeat 0 0 !important;
    }
    .rdCollapse:hover
    {
        background: url('img/Collapse_Hover.png') no-repeat 0 0 !important;
    }
    .rdExpand:hover
    {
        background: url('img/Expand_Hover.png') no-repeat 0 0 !important;
    }
</style>

For your convenience I attached a fully working sample project that uses custom image for the ExpandCollapse command.

PS. My recommendation is to use image sprite for all the DockCommand images instead of using single image for every command.

All the best,
Pero
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Greg
Top achievements
Rank 2
answered on 18 Mar 2010, 07:00 PM
Hi Pero,

Think you for your reply.  Yes, I understand I could override the css classes involved.  Or, as I stated, simply not name the command.  The question/problem I have with this is why naming the command causes the problem.  From my perspective, that shouldn't be happening.  Though either workaround works, it's still a "workaround".

Though it isn't a major issue, I believe it an issue that should be reviewed and corrected (though I'd agree it is not a high priority issue).

I will open a support ticket to "officially" log it.

Thanks, Greg
0
Pero
Telerik team
answered on 19 Mar 2010, 10:08 AM
Hi Greg,

Yes, changing the Name of the ExpandCollapse command (or any of the "built-in" commands - Close, PinUnpin, ExpandCollapse) will break its functionality. Additionally setting CssClass/AlternateCssClass and Text/AlternateText works OK. I attached a sample showing this.


Kind regards,
Pero
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Dock
Asked by
George
Top achievements
Rank 1
Answers by
Pero
Telerik team
George
Top achievements
Rank 1
Greg
Top achievements
Rank 2
Share this question
or