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

Is there a way to add a button on a PanelBarGroupElement and control its visibility.

4 Answers 73 Views
Panelbar (obsolete as of Q2 2010)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Khizar Khan
Top achievements
Rank 1
Khizar Khan asked on 02 Feb 2010, 05:57 PM

I have 10 panelbargroupelements and when the mouse is hovering on each of them there should a button visible and enabled to click, otherwise it should not be visible.

also, on click of the button I want to get which groupelement was clicked.
thanks for your help in advance.

Regards,
khizar

4 Answers, 1 is accepted

Sort by
0
Martin Vasilev
Telerik team
answered on 05 Feb 2010, 03:49 PM
Hi Khizar Khan,

Thank you for writing.

RadPanelBar does not support adding buttons into group captions out of the box. However, you can implement this feature using the hierarchy of RadElements. I have prepared a small sample application that demonstrates this approach. Please, find it as an attachment to this message. Let me know if you have any additional questions.

Regards,
Martin Vasilev
the Telerik team

Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Follow the status of features or bugs in PITS and vote for them to affect their priority.
0
Khizar Khan
Top achievements
Rank 1
answered on 08 Feb 2010, 02:19 PM
Thanks a lot for a very quick reply.

It has solved my problem.

Regards,
Khizar
0
Khizar Khan
Top achievements
Rank 1
answered on 15 Feb 2010, 04:43 PM
Hi,

 I now want to convert the panelbargroupelement as a hyperlink when mouse is entered and as button when leaves...
any suggestions?

Regards,
Khizar
0
Martin Vasilev
Telerik team
answered on 18 Feb 2010, 02:59 PM
Hi Khizar Khan,

I am not sure if I understand your requirement very well, but RadPanelBar does not supports hipper link text out of the box. However, you can make the text underlined and use Hand cursor to mimicry hiper-link:

Font _fontPrototype;
  
void SubscribeEvents()
{
    this.radPanelBar1.LoadElementTree();
    int i = 0;
  
    foreach (RadPanelBarGroupElement element in this.radPanelBar1.Items)
    {
        element.Caption = String.Format("Group {0}", i++);
        RadPanelBarVisualElement visualElement = element.GetCaptionElement();
        if (_fontPrototype == null)
        {
            _fontPrototype = visualElement.Font;
        }
  
        visualElement.MouseEnter+=new EventHandler(visual_MouseEnter);
        visualElement.MouseLeave+=new EventHandler(visual_MouseLeave);
    }
}
  
void visual_MouseLeave(object sender, EventArgs e)
{
    RadPanelBarVisualElement visualElement = (RadPanelBarVisualElement)sender;
    visualElement.Font = _fontPrototype;
    this.Cursor = Cursors.Default;
}
  
void visual_MouseEnter(object sender, EventArgs e)
{
    RadPanelBarVisualElement visualElement = (RadPanelBarVisualElement)sender;
    visualElement.Font = new Font(_fontPrototype, FontStyle.Underline);
    this.Cursor = Cursors.Hand;
}

Let me know if you need additional assistance.

Regards,
Martin Vasilev
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
Panelbar (obsolete as of Q2 2010)
Asked by
Khizar Khan
Top achievements
Rank 1
Answers by
Martin Vasilev
Telerik team
Khizar Khan
Top achievements
Rank 1
Share this question
or