Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WPF > ComboBox > Click event of the hyperlink doesn't get fired for the selected item.

Not answered Click event of the hyperlink doesn't get fired for the selected item.

Feed from this thread
  • Mausami avatar

    Posted on Oct 21, 2011 (permalink)

     

    Hello Telerik Team,

    I have a requirement where the rad combobox has a list of names. After selecting a value from the dropdown panel, the selected name should be displayed as a hyperlink.
    I have managed to get the hyperlink by using a DataTemplate in the SelectionBoxTemplate of the radcombobox as shown below.

     

    <UserControl.Resources>
    <DataTemplate x:Key="SelectionBoxTemplateKey">
                <TextBlock>
                    <Hyperlink Tag="{Binding Path=FocalUserId}" Name="hyplnkFocalFullName" 
                                    Click="hyplnkFocalFullName_Click">
                        <TextBlock Text="{Binding FocalFullName}" ></TextBlock>
                    </Hyperlink>
                </TextBlock>
            </DataTemplate>
    </UserControl.Resources  
      
      
    <Telerik:RadComboBox Name="radCmbFocal" IsEditable="False" Grid.Row="3" Grid.Column="5" Width="130"
          SelectedValue="{Binding Path=FocalId,Mode=TwoWay}"    SelectedValuePath="FocalId"
       DisplayMemberPath="FocalFullName" SelectionBoxTemplate="{StaticResource SelectionBoxTemplateKey}" 
      
    HorizontalAlignment="Left" Margin="7 0 0 0" VerticalAlignment="Center"
        
    SourceUpdated="radCmbFocal_SourceUpdated">                
    </Telerik:RadComboBox>

    But the click event of the hyperlink doesn't get's fired, nor does the cursor pointer changes to hand cursor on hovering over the selected value as it does for a normal hyperlink.

    Is there a solution to achieve this requirement.

    Thanks.

    Regards,
    Mausami.

    Reply

  • Dani Dani admin's avatar

    Posted on Oct 26, 2011 (permalink)

    Hello Mausami,

    When RadComboBox is in noneditable mode, you cannot edit the content of the SelectionBoxTemplate. This means that the hyperlink in the SelectionBoxTemplate will not be clickable and cursor inside of it cannot be visible either.  The NonEditable RadComboBox template contains a drop-down button and all it does is to open up the drop-down content. So a hyperlink placed in this button will not be clickable all by itself.

    I think your scenario will be best realized with a RadMenu rather than with a RadComboBox. You can use a RadMenuItem with nested RadMenuItems each with its own Command that can navigate to a particular Uri.

    I hope this helps.

    All the best,
    Dani
    the Telerik team
    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WPF > ComboBox > Click event of the hyperlink doesn't get fired for the selected item.
Related resources for "Click event of the hyperlink doesn't get fired for the selected item."

WPF ComboBox Features  |  Documentation  |  Demos  |  Telerik TV  |  Self-Paced Trainer  ]