Telerik Forums
UI for WPF Forum
1 answer
184 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
267 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
131 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
136 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
98 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.2K+ 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
352 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
1 answer
204 views
How to hide plus sign from RadGridView row, if no childrows exist ?
Lance | Senior Manager Technical Support
Telerik team
 answered on 14 Jun 2017
1 answer
579 views

Hello,

I have a combobox on which i am trying to modify the default tooltip style.This is applicable when I am hovering on individual combobox items and I should get the tooltip. Right now for tooltip , we are showing up the text value. But I want to override this deafult style and show the description instead. (Note that description is a user defined property).

The code snippet right now is:

<Style.Resources>
            <Style TargetType="{x:Type ComboBoxItem}" BasedOn="{StaticResource ComboBoxItemStyle}">
                <!--<Setter Property="ToolTip" Value="{Binding ToolTipDescription, Mode=TwoWay}"/>-->
                <Setter Property="ToolTip" Value="{Binding}"/>
            </Style>
        </Style.Resources>

 

Here while setting the property "tooltip" <Setter Property="ToolTip" Value="{Binding ToolTipDescription, Mode=TwoWay}"/>. I tried doing something like this. Here I exposed a public property from my class which is holding the description value that I need to show when i am hovering on the individual item. But the binding is not working.

 

I need your input to proceed further.

Dinko | Tech Support Engineer
Telerik team
 answered on 14 Jun 2017
Narrow your results
Selected tags
Tags
GridView
General Discussions
Chart
RichTextBox
Docking
ScheduleView
ChartView
TreeView
Diagram
Map
ComboBox
TreeListView
Window
RibbonView and RibbonWindow
PropertyGrid
DragAndDrop
TabControl
TileView
Carousel
DataForm
PDFViewer
MaskedInput (Numeric, DateTime, Text, Currency)
AutoCompleteBox
DatePicker
Buttons
ListBox
GanttView
PivotGrid
Spreadsheet
Gauges
NumericUpDown
PanelBar
DateTimePicker
DataFilter
Menu
ContextMenu
TimeLine
Calendar
Installer and Visual Studio Extensions
ImageEditor
BusyIndicator
Slider
Expander
TileList
PersistenceFramework
DataPager
Styling
TimeBar
OutlookBar
TransitionControl
Book
FileDialogs
ToolBar
ColorPicker
TimePicker
SyntaxEditor
MultiColumnComboBox
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
DesktopAlert
WatermarkTextBox
BarCode
SpellChecker
DataServiceDataSource
EntityFrameworkDataSource
RadialMenu
ChartView3D
Data Virtualization
BreadCrumb
ProgressBar
Sparkline
LayoutControl
TabbedWindow
ToolTip
CloudUpload
ColorEditor
TreeMap and PivotMap
EntityFrameworkCoreDataSource (.Net Core)
HeatMap
Chat (Conversational UI)
VirtualizingWrapPanel
Calculator
NotifyIcon
TaskBoard
TimeSpanPicker
BulletGraph
WebCam
CardView
DataBar
Licensing
FilePathPicker
PasswordBox
Rating
SplashScreen
Accessibility
Callout
CollectionNavigator
Localization
AutoSuggestBox
HighlightTextBlock
Security
TouchManager
StepProgressBar
VirtualKeyboard
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?