Telerik Forums
UI for WPF Forum
7 answers
942 views

The items shown in my grid have properties of the type

public class CheckerProperty
{
  ...
  public object Value { get; private set; }
  public bool Changed { get; private set; }
}

(So there is an itm.Status property of type CheckerProperty and a itm.Diameter of type CheckerProperty etc.) The Value should be shown, and when the Changed property is true, the background should have a different colour.

Since there are a lot of diferent properties and I would like to have a single style that handles the background change. Something like:

<Style x:Key="stlChangeCheckerProp" TargetType="telerik:GridViewCell" BasedOn="{StaticResource GridViewCellStyle}">
    <Setter Property="telerik:GridViewCell.Background" Value="Transparent" />
    <Style.Triggers>
        <DataTrigger Binding="{Binding RelativeSource={x:Static RelativeSource.Self}}" Value="True">
            <Setter Property="telerik:GridViewCell.Background" Value="{StaticResource brChange}" />
        </DataTrigger>
    </Style.Triggers>
</Style>

I'm struggling with the binding. How can I bind to the Changed property of the cell's value? It seems when I use RelativeSource, as in this example, I get the GridViewCell itself. When I use no RelativeSource, I get the item itself and I don't know which property (Status, Diameter etc.) is being displayed.

How can I set up the binding correctly?

Boardy
Top achievements
Rank 1
Veteran
 answered on 03 Nov 2017
4 answers
333 views

Is there a problem with RowSpan support in RadAutoCompleteBox class? The vertical scroll bar doesn't seem to extend all the way.

Try this out with your "Highlight Matching Items Text" example in your samples browser software.

Add new row to the grid:

<Grid.RowDefinitions>
    <RowDefinition Height="Auto"/>
    <RowDefinition Height="Auto"/>
    <RowDefinition Height="*"/>
</Grid.RowDefinitions>

 

Then set RadAutoCompleteBox object's RowSpan to 2:

Grid.RowSpan="2"

 

Then subscribe to Loaded event in Example.xaml.cs:

public Example()
{
    InitializeComponent();
 
    AutoComplete.Loaded += AutoComplete_Loaded;
}
 
private void AutoComplete_Loaded(object sender, RoutedEventArgs e)
{
    RadWatermarkTextBox watermark = (sender as RadAutoCompleteBox).ChildrenOfType<RadWatermarkTextBox>().FirstOrDefault();
    if (watermark != null)
    {
        watermark.AcceptsReturn = true;
        watermark.TextWrapping = TextWrapping.Wrap;
        watermark.VerticalAlignment = VerticalAlignment.Center;
        watermark.VerticalScrollBarVisibility = ScrollBarVisibility.Visible;
    }
}

 

Then run the example and you see how the scroll bar is only the height of the first row. It grows when you type text with new rows. Doesn't look good if you want to always show the vertical scroll bar (disabled when not enough text to scroll).

Haven't tested this with horizontal scroll bar.

By the way, is there a way to configure the RadAutoCompleteBox object to use textwrapping in XAML. I only found the above way by googling and I'd like not to use events. Handled with extending the class and subscribing to the event in the extended class' code.

Stefan
Telerik team
 answered on 01 Nov 2017
1 answer
356 views

I'm using RadGridView with RowDetailsTemplate. I'm using the MVVM Light toolkit and everything works fine with updating values in the RowDetails if I were to click a button in the parent row. RaisePropertyChanged works great, values in the RowDetail updates as expected. The problem I'm seeing and I don't think this control is going to work how I'd like to is what if I click a button in the parent row that changes the number of rows in the RowDetailsTemplate. I change the collection that the RowDetailsTemplate is bound to but it's not redrawing correctly. Instead of displaying the new set of rows it just deletes all rows and ends there. Is there a way to force the RowDetailsTemplate to redraw? I read somewhere that the LoadingRowDetails event is only raised once but in this case, changing the collection should be enough to force the detail rows to redraw. Or at least that's what I would think.

Thanks

Craig

Craig
Top achievements
Rank 1
 answered on 01 Nov 2017
6 answers
393 views

Hi,
the application is based on MVVM using Prism with MEF.
I have converted  windows tree view control to Telerik RadTreeview control. everything worked fine except that the ItemContainerStyle defined is somehow disabling the tree to be shown.  if I remove the ItemContainerStyle from the Radtreeview the tree becomes visible but with not styling.
 by using the windows treeview with same ItemcontainerStyle work fine.
Following is the code.

<uxc:UxtWindow.Resources>
 <HierarchicalDataTemplate x:Key="SiteWizardTemplate" 
                                  ItemsSource="{Binding Steps}" >
            <StackPanel Orientation="Horizontal">
                <TextBlock Text="{Binding DisplayAs}" />
            </StackPanel>
        </HierarchicalDataTemplate>
    </uxc:UxtWindow.Resources>
  
 <telerik:RadTreeView  IsVirtualizing="True"
                         ItemsSource="{Binding Wizard.WizardSections}" 
                          ItemTemplate="{StaticResource SiteWizardTemplate}"                                          
                               PreviewMouseDown="TreeView_PreviewMouseDown" >
                            
                               <telerik:RadTreeView.ItemContainerStyle>
                                <Style TargetType="{x:Type telerik:RadTreeViewItem}">
                                    <Setter Property="FontSize" Value="18" />
                                    <Setter Property="FontStyle" Value="Italic" />
                                    <Setter Property="Margin" Value="0,5,0,10" />
                                    <Setter Property="Foreground" Value="Black" />
                    </telerik:RadTreeView.ItemContainerStyle>
                      
                            
</telerik:RadTreeView>
Martin Ivanov
Telerik team
 answered on 01 Nov 2017
1 answer
142 views

Is there an easy way to set the initial height of the description panel without pulling the entire template out.

Martin Ivanov
Telerik team
 answered on 01 Nov 2017
5 answers
218 views

Hi!

I need to change RadDropDownButton's disabled style.

Code:

<Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="telerik:RadDropDownButton">
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsEnabled" Value="False">
                            <Setter Property="Foreground"  Value="Red" />
                        </Trigger>

Foreground changes it style.  But it is something like watermark.

How can I remove it? And increase it's contrast.

Thanks in advance

Dinko | Tech Support Engineer
Telerik team
 answered on 01 Nov 2017
6 answers
75 views

Hi there,

I've found the examples for all the other CustomxDialog types, but I haven't found one for CustomStyleFormattingPropertiesDialog

Can somebody give a little guidance?

Michael
Top achievements
Rank 1
Veteran
 answered on 01 Nov 2017
2 answers
279 views

Hi, is there any way I can style label for DataFormDataField inside code-behind file or XAML ? For example, I have such layout and need to change label's foreground color:

<telerik:DataFormDataField x:Name="someNameHere" VerticalAlignment="Top" Grid.Row="2" Grid.Column="1" Label="{Binding Source={x:Static p:Resources.someValue}, Mode=OneTime, StringFormat='{}{0} :'}">                     

    <telerik:RadDateTimePicker x:Name="datePicker" SelectedDate="{Binding ControlDefinition.selectedDate, StringFormat='{}{0:T} {0:d}', Mode=TwoWay}"/>               </telerik:DataFormDataField>

 

Thanks in advance.

FirstName
Top achievements
Rank 1
 answered on 31 Oct 2017
3 answers
174 views

Hi, wisers,

I'm using RadGridView (2013.2.0724.40) under .net 4.5 to display some objects whose properties will only be known at run time. Googled and it seems ICustomTypeProvider is a good fit. I implemented it to my class and tried to set RadGridView to AutoGenerateColumns = True. But the properties dynamically added to the class are not shown in the generated grid, only those fixed properties. I tried DataGrid in .net itself and it works fine, the dynamic properties are shown in the DataGrid in column.

It seems that RadGridView itself doesn't support ICustomTypeProvider like .net DataGrid. Is there any possibility to achieve this in RadGridView?

Stefan
Telerik team
 answered on 31 Oct 2017
5 answers
290 views

Hi there,

We have the following scenario:  a Diagram with 323 items and 470 links takes about 8 seconds to display the first time.  Is this reasonable and expected?  What should we be looking at to improve this load time, please?

We do intend to show the entirety of the Diagram with all items and links at once, so we can't take advantage of Virtualization.

Profiling results indicate that the largest chunk of time is indeed spent in the Diagram constructor.

A large chuck of time is spent in RadDiagram.UpdateStylesAndTemplates, which is called three times (I suspect for the setting of each of ShapeStyle, ContainerShapeStyle, and ConnectionStyle) and seems to do plenty of work each time.  I think this says that we already have the GraphSource populated before we hit the definitions of those styles (this is true based on reading order of the xaml).

What other sorts of things could we look at? 

 

Thanks,

-David

 

 

 

 

 

 

 

 

Petar Mladenov
Telerik team
 answered on 31 Oct 2017
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?