Telerik Forums
UI for WPF Forum
4 answers
126 views

Hi,

Following the steps of the documentation I installed the theme of visual studio 2013:

http://docs.telerik.com/devtools/wpf/styling-and-appearance/styling-apperance-setting-a-theme-overview

The problem I have is that it works for me in all grids except one that I have filters (I do not know if it has anything to do with). 

As you can see in the picture 1.png works fine.

In the 2.png image we can see that the theme is applied in the grid header, but the shading and selection are of a different color (I guess the default theme). The same thing happens in the 3.png image that belongs to RadContextMenu, the shading is not of the visual studio 2013 theme.

<telerik:RadGridView Grid.Row="1" Name="DatagridResults" FilterOperatorsLoading="DatagridResults_OnFilterOperatorsLoading" Filtering="DatagridResults_OnFiltering" Filtered="DatagridResults_OnFiltered" ItemsSource="{Binding OptimizerResults}" helpers1:BarLogColumnsBindingBehavior.Columns="{Binding ResultsOptimizerColumns}" Loaded="DatagridResults_OnLoaded" MouseDoubleClick="ResultsOnMouseDoubleClick" Sorting="DatagridResults_OnSorting" Sorted="DatagridResults_OnSorted" ShouldCloseFilteringPopupOnKeyboardFocusChanged="True" IsReadOnly="True" ShowGroupPanel="False" CanUserDeleteRows="False" CanUserInsertRows="False" AreRowDetailsFrozen="True" CanUserReorderColumns="False" CanUserResizeRows="False" CanUserResizeColumns="False" RowIndicatorVisibility="Collapsed" IsFilteringAllowed="True" EnableColumnVirtualization="True" FrozenColumnsSplitterVisibility="Collapsed">
    <telerik:RadContextMenu.ContextMenu>
        <telerik:RadContextMenu ItemsSource="{Binding MenuItemContextMenuItemsCollection}" >
            <telerik:RadContextMenu.ItemContainerStyle>
                <Style TargetType="telerik:RadMenuItem">
                    <Setter Property="IsCheckable" Value="True"/>
                    <Setter Property="IsChecked" Value="{Binding IsChecked}"/>
                    <Setter Property="Command" Value="{Binding Command}"/>
                    <Setter Property="Header" Value="{Binding Header}"/>
                    <Setter Property="CommandParameter" Value="{Binding RelativeSource={RelativeSource Self}}" />
                </Style>
            </telerik:RadContextMenu.ItemContainerStyle>
        </telerik:RadContextMenu>
    </telerik:RadContextMenu.ContextMenu>
</telerik:RadGridView>

 

Do you think it may be happening? Thank you.

 

Regards,

Gerard.

 

 

 

Gerard
Top achievements
Rank 1
 answered on 19 Jun 2017
1 answer
188 views

I was planning to use Winform-Gantt View. but I heard that recurring task is not supported in Winform Gantt-View.
(http://www.telerik.com/forums/show-multiple-tasks-on-one-line-in-gantt-view)

Thus, I change my plan to apply WPF GanttView for my project.
I tried many things using Telerik WPF demo for applying our project.
but I have some problems to do it.  

 

1. Is it possible to show miliseconds timeline in a Gantt View?

 I can only show in the minimum timeline as a minute (day:hour:01) 
Is it possible  to show miliseconds? or in a second?

2.  In the recurrent task, is it possible to custom move? (not all just one task)

Thanks , Hyeon

Martin
Telerik team
 answered on 19 Jun 2017
1 answer
176 views
Hello Telerik Team,
                              I have one problem in my WPF project. I was getting issues when we select more than 6000 documents from radgridview after select these documents i was selecting 1 documents . so it was taking near about 45 seconds time to select the single document. so from telerik team someone suggested to update the telerik versions with the newer one. after upgradation all the radmenuitems were not working and some UI things also not working,i have attached the snapshots of the radmenuitems. what i have to do for it to fix these issues.

Regards
Raju Tiwari
Stefan
Telerik team
 answered on 19 Jun 2017
3 answers
255 views

I must be missing something simple. I'm just trying to work with the background colors for the TabItems. I've made a Control Template and Style. When I explore the Live Visual Tree, I find that BorderVisual is being defined from the default Implicit Styles file. Everything else above seems to be pulling correctly from the Style and Template I've made. What am I doing wrong?

                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
                    xmlns:telerik1="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls"
                    xmlns:telerikNavigation="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation"
                    xmlns:telerikPrimitives="clr-namespace:Telerik.Windows.Controls.Primitives;assembly=Telerik.Windows.Controls"
                    xmlns:telerikTabControl="clr-namespace:Telerik.Windows.Controls.TabControl;assembly=Telerik.Windows.Controls.Navigation"
                    xmlns:telerikNavigationPrimitives="clr-namespace:Telerik.Windows.Controls.Primitives;assembly=Telerik.Windows.Controls.Navigation">
    <ControlTemplate x:Key="JobTypeTabItemTemplate" TargetType="{x:Type telerik:RadTabItem}">
        <Grid x:Name="wrapper">
            <Border x:Name="BorderVisual"
                    CornerRadius="3,3,0,0"
                    BorderBrush="{TemplateBinding BorderBrush}"
                    Background="{TemplateBinding Background}"
                    BorderThickness="{TemplateBinding BorderThickness}"/>
            <telerikPrimitives:LayoutTransformControl x:Name="OrientationTransform">
                <ContentControl x:Name="HeaderElement"
                                IsTabStop="False"
                                Content="{TemplateBinding Header}"
                                ContentTemplate="{TemplateBinding HeaderTemplate}"
                                Foreground="{TemplateBinding HeaderForeground}"
                                HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                Margin="{TemplateBinding Padding}"
                                ContentStringFormat="{TemplateBinding HeaderStringFormat}"
                                ContentTemplateSelector="{TemplateBinding HeaderTemplateSelector}"
                                SnapsToDevicePixels="True"/>
            </telerikPrimitives:LayoutTransformControl>
        </Grid>
        <ControlTemplate.Triggers>
            <Trigger Property="IsMouseOver" Value="True">
                <!--<Setter TargetName="BorderVisual" Property="Background" Value="{telerik1:Office2016Resource ResourceKey=AccentMouseOverBrush}"/>
                            <Setter TargetName="BorderVisual" Property="BorderBrush" Value="{telerik1:Office2016Resource ResourceKey=AccentMouseOverBrush}"/>-->
                <Setter TargetName="BorderVisual" Property="Background" Value="{telerik1:Office2016Resource ResourceKey=AlternativeBrush}"/>
                <Setter TargetName="BorderVisual" Property="BorderBrush" Value="{telerik1:Office2016Resource ResourceKey=AlternativeBrush}"/>
                <Setter TargetName="HeaderElement" Property="Foreground" Value="{telerik1:Office2016Resource ResourceKey=MarkerBrush}"/>
            </Trigger>
            <Trigger Property="IsSelected" Value="True">
                <!--<Setter TargetName="BorderVisual" Property="Background" Value="{telerik1:Office2016Resource ResourceKey=AlternativeBrush}"/>
                            <Setter TargetName="BorderVisual" Property="BorderBrush" Value="{telerik1:Office2016Resource ResourceKey=AlternativeBrush}"/>-->
                <Setter TargetName="BorderVisual" Property="Background" Value="{telerik1:Office2016Resource ResourceKey=AccentMouseOverBrush}"/>
                <Setter TargetName="BorderVisual" Property="BorderBrush" Value="{telerik1:Office2016Resource ResourceKey=AccentMouseOverBrush}"/>
                <Setter TargetName="HeaderElement" Property="Foreground" Value="{telerik1:Office2016Resource ResourceKey=MarkerInvertedBrush}"/>
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>
    <Style x:Key="JobTypeTabItemStyle" TargetType="{x:Type telerik:RadTabItem}" BasedOn="{StaticResource RadTabItemStyle}">
        <Setter Property="Template" Value="{StaticResource JobTypeTabItemTemplate}"/>
        <Setter Property="FontFamily" Value="{telerik1:Office2016Resource ResourceKey=FontFamily}"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="BorderThickness" Value="1 1 1 0"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="MinWidth" Value="5"/>
        <Setter Property="MinHeight" Value="5"/>
        <Setter Property="HeaderForeground" Value="{telerik1:Office2016Resource ResourceKey=MarkerInvertedBrush}"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="Template" Value="{StaticResource TabItemTemplate}"/>
        <Setter Property="Padding" Value="18,6,18,3" />
        <Setter Property="Header" Value="{Binding TabText}"/>
        <Setter Property="FontSize" Value="14"/>
    </Style>
</ResourceDictionary>
Stefan
Telerik team
 answered on 19 Jun 2017
2 answers
126 views

Hi, I has a diagram, and use ExportToImage method to export to png, but the png file is 0KB, and can't diaplay in windows photo viewer, why?

The code is:

namespace OpenDiagramdemo
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public RadDiagram diagram;
        public MainWindow()
        {
            InitializeComponent();
            diagram = new RadDiagram();
            //the shapes up to 500, display is slow
            for(int i = 0; i < 1000; i++)
            {
                RadDiagramShape s = new RadDiagramShape();
                s.Stroke = Brushes.Red;
                s.BorderBrush = Brushes.Red;
                s.StrokeThickness = 2;
                s.IsEditable = false;
                s.Foreground = Brushes.Transparent;
                s.Background = Brushes.Transparent;
                s.Width = 113;
                s.Height = 76;
                s.X = i;
                s.Y = i;
                s.Geometry = ShapeFactory.GetShapeGeometry(CommonShapeType.EllipseShape);//"M0.5,0.5L111.5,0.5 111.5,74.5 0.5,74.5z"
                diagram.AddShape(s);
            }
        }
       
        private void MenuItem_Click(object sender, RoutedEventArgs e)
        {
            FileStream fs = File.Open("D:\\\\tt.png", FileMode.Create);
            this.diagram.ExportToImage(fs);
            fs.Close();
        }
    }
}

When run this program, make a diagram And draw a menu in xaml. Define the menu click event MenuItem_Click. Click menu and see the result described above.

Thanks!

Jonathan
Top achievements
Rank 1
 answered on 16 Jun 2017
2 answers
129 views

Hi, I have problem with RadialGauge. When I set BarIndicator value = 100 and it disappear. Please help me!

 

<telerik:RadRadialGauge x:Name="radGauge">
            <telerik:RadialScale x:Name="radialScale"
                                 IsInteractive="True"
                                 RangeLocation="OverOutside"
                                 LabelRotationMode="None"
                                 Radius="0.9"
                                 StartAngle="270"
                                 SweepAngle="360"
                                 Max="100"
                                 MinorTickBackground="Transparent"
                                 MiddleTickBackground="Transparent"
                                 MajorTickBackground="Transparent"
                                 ShowLastLabel="False"
                                 LabelTemplate="{StaticResource CustomRadialLabelTemplate}">
                <telerik:RadialScale.Indicators>
                    <telerik:BarIndicator
                        x:Name="bar"
                        StartWidth="0.15"
                        EndWidth="0.15"
                        EmptyFill="LightGray"
                        telerik:ScaleObject.Location="OverCenter"/>
 
                </telerik:RadialScale.Indicators>
            </telerik:RadialScale>
        </telerik:RadRadialGauge>
TuDN
Top achievements
Rank 1
 answered on 16 Jun 2017
1 answer
95 views

Hey community,

the row redorder sample doesn't work within a RadLayoutControl. It looks like as if the RadLayoutControl would intercept the DragEvent, so the  GiveFeedbackEventArgs is not called within the RowReorderBehavior.

Can you provide me a sample or give me a hint please.

 

Kind regards,

Lars

Lars D.
Top achievements
Rank 1
 answered on 16 Jun 2017
7 answers
2.1K+ views

I am using a radGridView in Master/Detail scenario using MVVM; the selected item is displayed in a custom form that allows editing.
The Form's DataContext and the Grid's SelectedItem are bound to a property in the ViewModel.
When the Grid's selection is changing, I check if the Form is in Edit mode, and if so I cancel the selection change.

This works as it should.

However, there are some circumstances where the Grid's ItemSource (CollectionViewSource) changes and the Grid looses track of the SelectedItem. I can throw NotifyPropertyChanged on the property, and the grid doesn't notice. When the grid is in this state and the user selects a row, the logic in SelectionChanging does not prevent the SelectedItem from changing. In fact it sets the SelectedItem to null, rather than the attempted selection row.

I really need to prevent the SelectedItem from changing (or becoming null) while the item is being edited. I think the best way would be to prevent the grid from getting into this strange state.

How can I force the grid to realize its SelectedItem, if NotifyPropertyChanged is not doing the trick?

Does the grid loose its SelectedItem binding when the Itemssource updates?

 

 

XAML:
    <telerik:RadGridView Grid.RowSpan="2" ShowGroupPanel="False" AutoGenerateColumns="False" IsFilteringAllowed="False"
        ItemsSource="{Binding Zones.View}"  x:Name="grd_ZoneBins" IsReadOnly="True" EditTriggers="None"
        SelectedItem="{Binding SelectedZone, Mode=TwoWay}"
        SelectionChanging="grd_ZoneBins_SelectionChanging" >
        <telerik:RadGridView.Columns>
            <telerik:GridViewDataColumn Header="Zone" DataMemberBinding="{Binding Name}" Width="*" />
            <telerik:GridViewDataColumn Header="Active" DataMemberBinding="{Binding IsActive}" />
        </telerik:RadGridView.Columns>
    </telerik:RadGridView>

CodeBehind:
    private void grd_ZoneBins_SelectionChanging(object sender, Telerik.Windows.Controls.SelectionChangingEventArgs e)
    {
        if (EditableWorkSpace_ZoneBins.Mode == EditMode.Editable) //this is a custom control
            e.Cancel = true;
    }

ViewModel:
    //Properties
    private List<Part_Zone> _zones;
    public CollectionViewSource Zones { get; set; }
    private Part_Zone m_SelectedZone;
    public Part_Zone SelectedZone
    {
        get { return m_SelectedZone; }
        set { m_SelectedZone = value; NotifyPropertyChanged("SelectedZone");}
    }

    public Model() //constructor
    {
        Zones = new CollectionViewSource();
        Zones.SortDescriptions.Add(new SortDescription("Name", ListSortDirection.Ascending));
        LoadData();
    }

    private void LoadData()
    {
        _zones = GetZones();
        Zones.Source = _zones;
        SelectedZone = Zones.View.CurrentItem as Part_Zone; //first item
    }

    public void Refresh()
    {
        LoadData();
        //at this point the grid doesn't seem aware that the SelectedZone is its SelectedItem
    }

    public void StartEdit()
    {
        View.EditableWorkSpace_ZoneBins.Mode = EditMode.Editable;
        NotifyPropertyChanged("SelectedZone"); // just in case
    }

Steps to reproduce:
1) load data
2) select item in grid
3) refresh data - grid looses selectedItem. SelectedZone is not null.
4) start edit
5) change selection - gets canceled due to Edit mode
6) SelectedZone is set to null.


Stefan
Telerik team
 answered on 16 Jun 2017
6 answers
337 views

Dear Admin

I just use RadGridView control for excel content shown in MVVM pattern, and before amount excel data, I do not know exact columns and rows shown in RadGridView, so I use datatable as my datasource binded to RadGridView's ItemsSource. But actually I would like to change some columns  datatype from string to Image, I try to add AutoGeneratingColumn event and set CellTemplate for specified columns, and the result was that there was no response after loading and only shut-down whole window.

so in this case is there any other workaround to archive similar case? any ideas I do really appreciate.

Yoan
Telerik team
 answered on 15 Jun 2017
2 answers
1.1K+ views
What is the best event to detect when a new row has been added via binding?

For instance I have a WPF (form application) with a grid bound to a ObservableCollection<foo> class. When I add a new object to the collection, it is added to grid automatically.

I want to detect that a new row has been added by the grid and put the select a cell and put it in edit mode.

I'm currently accomplishing this task using the RowLoaded event and it is working. However, once there are enough rows added that cause the grid to have a vertical scroll bar AND the user then scrolls up in the grid then the RowLoaded event fires again ... even though the row already exists. So I've had to had special code to really identify in RowLoaded when the event fired from a true add to the collection.

I would like to know if there is another event to use and I've inspected several of them. I thought DataLoaded would work and it fires, however I cannot figure out a way to make a particular cell selected and placed in mode via this event. The code that I'm using that is working in RowLoaded event is this
if (e.DataElement != null)
{
    ((GridViewCell)e.Row.Cells[7]).BeginEdit();
}

Thanks ... Chad
Ujwal
Top achievements
Rank 1
 answered on 15 Jun 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?