Quantcast
Channel: Telerik Forums RSS
Viewing all articles
Browse latest Browse all 78072

Styling the text within a DataFormDataField

$
0
0

I've got a series of DataFormDataFields, and I want the text within one of the boxes (if generated) to call a function if it's clicked once. When I attempt to style the text, I lose the textbox itself. All I want is for the DataMemberBinding to be blue and have an underline so it looks like a hyperlink almost. Here's what I'm trying:

 

<telerik:DataFormDataField  x:Name="Number"
                                                Label="Number"
                                                LabelPosition="Above"
                                                Foreground="{DynamicResource StandardForeground}"
                                                Grid.Row="1"
                                                Margin="0"
                                                IsReadOnly="True"
                                                Mode="ReadOnly"
                                                Padding="2"
                                                DataMemberBinding="{Binding DataContext.Number, Mode=OneWay, RelativeSource={RelativeSource AncestorType=UserControl}, UpdateSourceTrigger=PropertyChanged}"Template="{DynamicResource HyperlinkNumber}"/>
 
 
            <ControlTemplate x:Key="HyperlinkNumber"TargetType="{x:Type telerik:DataFormDataField}">
   <Grid x:Name="PART_DataFormDataFieldGrid"Margin="2">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition/>
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition/>
   <RowDefinition/>
                </Grid.RowDefinitions>
 
                <ContentControl x:Name="PART_Label"Grid.Row="0"Grid.Column="0"Content="Number"Foreground="{DynamicResource StandardForeground}"  Margin="5,0,0,2"/>
<ContentControl x:Name="PART_FieldsContentPresenter"Grid.Row="1"Grid.Column="0"Content="{Binding DataContext.Number, Mode=OneWay, RelativeSource={RelativeSource AncestorType=UserControl}, UpdateSourceTrigger=PropertyChanged}"Margin="2"Foreground="Blue"/>
    </Grid>
            </ControlTemplate>

 

Once I hit this point, the textbox looking element disappears so I haven't even tried getting the underline or making the element clickable. Is there some additional content control that will make the box appear? Thanks.


Viewing all articles
Browse latest Browse all 78072

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>