Telerik Forums
UI for WPF Forum
1 answer
190 views
The documentation for RadSpreadsheet says that it supports PixelBased scrolling. How do I enable this? I tried setting the attached property ScrollViewer.CanContentScroll = False, but it doesn't appear to have worked.
Tanya
Telerik team
 answered on 30 May 2016
1 answer
81 views

RadScheduleView: clipping appointment name in Edit mode.

Hi, I need the appointment name in the schedule control to auto-expand to fit whatever the name of the appointment is. This is most troublesome in Edit mode, I get something like "This is the na..." - the rest of the name is clipped in the scheduler grid.

Please advise with a work-around.

Telerik.Windows.Controls.dll v. 2016.1.217.40

Barry

Yana
Telerik team
 answered on 30 May 2016
1 answer
186 views

Hello,

I'm following this document and are able to create the child gridview.

http://docs.telerik.com/devtools/wpf/controls/radgridview/hierarchical-gridview/basic-hierarchies

My need now is I want to have a double click event tied to the child gridview then get the parent row data (object).

Are there any sample codes or guidance?

Thanks,

Brew

 

Dilyan Traykov
Telerik team
 answered on 30 May 2016
7 answers
136 views

A peculiar behavior we have found with the RadCalendar control:

We have a custom DayButtonStyleSelector set to an instance of a RadCalendar. This StyleSelector sets the Visibility of days that do not belong to the month displayed as Collapsed, instead of being grayed out as they normally would be.

Furthermore, we dynamically change the number of columns displayed dependent on the width available to the RadCalendar.

The StyleSelector works as intended when loading the Calendar and when increasing the column count, but when we reduce the column count by reducing the space available for the RadCalendar control, the last column seems to ignore the StyleSelector and displays the days of the following month in grey.

However, using Snoop we found out that the Style is applied - and consequently overridden by a locally set Visibility.

This only happens for the last column, and only when reducing the number of columns. Please see the attached screenshots (1.jpg shows the Calendar after loading, 2.jpg shows the calendar after expanding enough to display a third column, 3.jpg shows the calendar after reducing it back to 2 columns).

A code sample to illustrate this problem:

 

<Window x:Class="MainWindow"
       Title="MainWindow" Height="200" Width="400">
    <telerik:RadCalendar VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Name="cal" />
</Window>

 

And the code behind (please excuse the VB.Net):

 

Imports Telerik.Windows.Controls.Calendar
Class MainWindow
    Private Const MinCalendarWidth = 150
    Public Sub New()
        ' This call is required by the designer.
        InitializeComponent()
        ' Add any initialization after the InitializeComponent() call.
        cal.DayButtonStyle = Nothing
        cal.DayButtonStyleSelector = New CDayStyleSelector()
    End Sub
    Protected Overrides Sub OnRenderSizeChanged(sizeInfo As SizeChangedInfo)
        MyBase.OnRenderSizeChanged(sizeInfo)
        Dim CalendarColumns = Math.Max(1, CInt(Math.Floor(sizeInfo.NewSize.Width / MinCalendarWidth)))
        If cal.Columns <> CalendarColumns Then
            cal.Columns = CalendarColumns
        End If
    End Sub
    Private Class CDayStyleSelector
        Inherits StyleSelector
        Private _HideButtonStyle As New Style
        Public Sub New()
            _HideButtonStyle.Setters.Add(New Setter(VisibilityProperty, Visibility.Collapsed))
        End Sub
        Public Overrides Function SelectStyle(item As Object, container As DependencyObject) As Style
            Dim Content = TryCast(item, CalendarButtonContent)
            If Content IsNot Nothing AndAlso Content.ButtonType = CalendarButtonType.Date Then
                If Not Content.IsFromCurrentView OrElse Content.IsInAnotherView Then
                    Return _HideButtonStyle 'Hide all Buttons of other months
                End If
            End If
            Return MyBase.SelectStyle(item, container)
        End Function
    End Class
End Class

 

You can observe the problem described by changing the width of the window.

Kalin
Telerik team
 answered on 30 May 2016
1 answer
315 views

Hey,

 

I'm trying to create RadCartesianChart that on VerticalAxis and HorizontalAxis have DateTimeCategoricalAxis.

In the HorizontalAxis should be the date and in the VerticalAxis should be the Hours and Minutes.

Attached my view, I'm working on it over a week and still can't find the answer to this issue.

<------------------------------------------------>

  <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition />
        </Grid.ColumnDefinitions>
        <telerik:RadLegend x:Name="legend1"
                           HorizontalAlignment="Right"
                           Width="100"
                           Items="{Binding LegendItems, ElementName=Chart1}"
                           Style="{DynamicResource RadLegendStyle1}"
                           Margin="0,239.5,0,215.5">
            <telerik:RadLegend.ItemTemplate>
                        <DataTemplate>
                        <StackPanel Orientation="Horizontal">
                        <Border Width="12"
                        Height="3"
                        BorderBrush="Black"
                        CornerRadius="0"
                        Background="{Binding MarkerFill}" />

                        <TextBlock Margin="2"
                        Text="{Binding Title}" />
                        </StackPanel>
                        </DataTemplate>
            </telerik:RadLegend.ItemTemplate>
        </telerik:RadLegend>
        <telerik:RadCartesianChart x:Name="Chart1"
                                   Grid.Column="1"
                                   Palette="{StaticResource customPalette}"
                                   Style="{DynamicResource StyleRadCartesianChartSeriesPoint}">
            <telerik:RadCartesianChart.HorizontalAxis>
                <telerik:DateTimeCategoricalAxis LabelFormat="dd - MM - yy"
                                                 DateTimeComponent="Month"/>
            </telerik:RadCartesianChart.HorizontalAxis>
            <telerik:RadCartesianChart.VerticalAxis>
                <telerik:DateTimeCategoricalAxis LabelFormat="HH : mm" />
            </telerik:RadCartesianChart.VerticalAxis>
            <telerik:RadCartesianChart.Grid>
                <telerik:CartesianChartGrid MajorLinesVisibility="Y" />
            </telerik:RadCartesianChart.Grid>
            <telerik:PointSeries PointTemplate="{StaticResource PointTemplate2}"
                                 ItemsSource="{Binding valueBarPoints}"
                                 CategoryBinding="Datee"
                                 ValueBinding="Time">
                <!--<telerik:PointSeries.DataPoints>
                    <telerik:CategoricalDataPoint Category="January"
                                                  Value="4" />
                    <telerik:CategoricalDataPoint Category="February"
                                                  Value="7" />
                    <telerik:CategoricalDataPoint Category="March"
                                                  Value="5" />
                    <telerik:CategoricalDataPoint Category="April"
                                                  Value="6" />
                    <telerik:CategoricalDataPoint Category="May"
                                                  Value="12" />
                    <telerik:CategoricalDataPoint Category="June"
                                                  Value="9" />
                    <telerik:CategoricalDataPoint Category="July"
                                                  Value="3" />
                </telerik:PointSeries.DataPoints>-->
                <telerik:PointSeries.LegendSettings>
                    <telerik:SeriesLegendSettings Title="List 2" />
                </telerik:PointSeries.LegendSettings>
            </telerik:PointSeries>

        </telerik:RadCartesianChart>

    </Grid>

<--------------------------------------------------->

 

 

 

Thanks,

Hila.

Petar Marchev
Telerik team
 answered on 30 May 2016
1 answer
180 views
Hi, I want to save a RadDiagram to a file just when it changed. How to know the RadDiagram has changed? like isDirty property
Dinko | Tech Support Engineer
Telerik team
 answered on 27 May 2016
4 answers
191 views

Hi,

I would like to know how we can have a horizontal scroll for the RadTimeline. The error is shown displayed on the line "<telerik:SelectionRange`1 End="1" Start="0"/>" which is part of the RadTimeline template. I have attached the screenshot of how the timeline looks currently.

Regards,

Rajeswari

Rajeswari
Top achievements
Rank 1
 answered on 27 May 2016
1 answer
243 views

Hi,

I use the RadGridView with a VQCV and dynamic typed data in it. This works fine so far. My problem is, that I want to select the first row after the first set of data was loaded. I get the ItemsLoaded event and set the a SelectedItem property in my ViewModel. This property is bound to the RadGridView but it doesn't render the selected item correct (yellow selection). If I selected rows using the mouse everything works fine, only the programatic selection doesn't work.

I have debugged the issue for a while and wonder that I can see, that the RadGridView has the correct object referenced by the SelectedItem property, but visually the row is not selected.

public class MainWindowViewModel : INotifyPropertyChanged
    {
        private DynamicDataRow selectedItem;
 
        public MainWindowViewModel()
        {
            this.Data = new VirtualQueryableCollectionView { LoadSize = 10, VirtualItemCount = 1000 };
            this.Data.ItemsLoading += this.ViewItemsLoading;
            this.Data.ItemsLoaded += this.ViewItemsLoaded;
        }
 
        public event PropertyChangedEventHandler PropertyChanged;
 
        public VirtualQueryableCollectionView Data { get; private set; }
 
        public DynamicDataRow SelectedItem
        {
            get
            {
                return this.selectedItem;
            }
            set
            {
                this.selectedItem = value;
                this.OnPropertyChanged();
            }
        }
 
        protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
        {
            var handler = this.PropertyChanged;
            if (handler != null)
            {
                handler(this, new PropertyChangedEventArgs(propertyName));
            }
        }
 
        private static void GenerateData(List<dynamic> data, int startIndex = 0)
        {
            var random = new Random(1000);
 
            for (int i = startIndex; i < startIndex + 10; i++)
            {
                var row = new DynamicDataRow();
 
                row.Add("Time", DateTime.Now);
                row.Add("NameD", "Klaus" + i);
                row.Add("Age", Convert.ToInt16(random.Next(short.MaxValue)));
                row.Add("Null", (object)null);
                row.Add("Double", Convert.ToDouble(1.3434));
 
                data.Add(row);
            }
        }
 
        private void ViewItemsLoaded(object sender, VirtualQueryableCollectionViewItemsLoadedEventArgs e)
        {
            if (e.StartIndex == 10)
            {
                foreach (DynamicDataRow item in e.Items)
                {
                    this.SelectedItem = item;
                    break;
                }
            }
        }
 
        private void ViewItemsLoading(object sender, VirtualQueryableCollectionViewItemsLoadingEventArgs e)
        {
            var source = sender as VirtualQueryableCollectionView;
 
            if (source == null)
            {
                return;
            }
 
            var data = new List<dynamic>();
            GenerateData(data, e.StartIndex);
            source.Load(e.StartIndex, data);
        }
    }

/// <summary>
    ///     A collection of dynamic data rows can be used to populate a RadGridView
    ///     with content if the number of columns is variable and only known during
    ///     runtime.
    /// </summary>
    /// <seealso cref="System.Dynamic.DynamicObject" />
    public class DynamicDataRow : DynamicObject
    {
        private readonly IDictionary<string, object> data;
 
        /// <summary>
        ///     Initializes a new instance of the <see cref="DynamicDataRow" /> class.
        /// </summary>
        public DynamicDataRow()
        {
            this.data = new Dictionary<string, object>();
        }
 
        /// <summary>
        ///     Adds a value to a specified column in the current row.
        /// </summary>
        /// <param name="columnName">The column name.</param>
        /// <param name="value">The value for the cell.</param>
        public void Add(string columnName, object value)
        {
            this.data[columnName] = value;
        }
 
        /// <summary>
        ///     Call this method to get a list of all column names. The method
        ///     is used by the RadGridView to generate the columns during runtime-
        /// </summary>
        /// <returns>
        ///     A sequence that contains the column names.
        /// </returns>
        public override IEnumerable<string> GetDynamicMemberNames()
        {
            return this.data.Keys;
        }
 
        /// <summary>
        ///     Provides the implementation for operations that get member values. Classes derived from
        ///     the <see cref="T:System.Dynamic.DynamicObject" /> class can override this method to specify
        ///     dynamic behavior for operations such as getting a value for a property.
        /// </summary>
        /// <param name="binder">
        ///     Provides information about the object that called the dynamic operation.
        ///     The binder.Name property provides the name of the member on which the dynamic operation is
        ///     performed. For example, for the Console.WriteLine(sampleObject.SampleProperty) statement,
        ///     where sampleObject is an instance of the class derived from the
        ///     <see cref="T:System.Dynamic.DynamicObject" /> class, binder.Name returns "SampleProperty".
        ///     The binder.IgnoreCase property specifies whether the member name is case-sensitive.
        /// </param>
        /// <param name="result">
        ///     The result of the get operation. For example, if the method is called
        ///     for a property, you can assign the property value to <paramref name="result" />.
        /// </param>
        /// <returns>
        ///     True if the operation is successful; otherwise, false. If this method returns false, the
        ///     run-time binder of the language determines the behavior. (In most cases, a run-time
        ///     exception is thrown.)
        /// </returns>
        public override bool TryGetMember(GetMemberBinder binder, out object result)
        {
            result = this.data[binder.Name];
            return true;
        }
 
        /// <summary>
        ///     Provides the implementation for operations that set member values. Classes derived
        ///     from the <see cref="T:System.Dynamic.DynamicObject" /> class can override this method
        ///     to specify dynamic behavior for operations such as setting a value for a property.
        /// </summary>
        /// <param name="binder">
        ///     Provides information about the object that called the dynamic
        ///     operation. The binder.Name property provides the name of the member to which the value
        ///     is being assigned. For example, for the statement sampleObject.SampleProperty = "Test",
        ///     where sampleObject is an instance of the class derived from the
        ///     <see cref="T:System.Dynamic.DynamicObject" /> class, binder.Name returns "SampleProperty".
        ///     The binder.IgnoreCase property specifies whether the member name is case-sensitive.
        /// </param>
        /// <param name="value">
        ///     The value to set to the member. For example, for
        ///     sampleObject.SampleProperty = "Test", where sampleObject is an instance of the class
        ///     derived from the <see cref="T:System.Dynamic.DynamicObject" /> class, the
        ///     <paramref name="value" /> is "Test".
        /// </param>
        /// <returns>
        ///     True if the operation is successful; otherwise, false. If this method returns false,
        ///     the run-time binder of the language determines the behavior. (In most cases, a
        ///     language-specific run-time exception is thrown.)
        /// </returns>
        public override bool TrySetMember(SetMemberBinder binder, object value)
        {
            this.data[binder.Name] = value;
            return true;
        }
    }
<Window x:Class="WPF.RadGridViewVirtualizing.MainWindow"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"       
        xmlns:controls="http://schemas.telerik.com/2008/xaml/presentation"
        Title="MainWindow" Height="350" Width="525">
    <Grid>
        <controls:RadGridView CanUserReorderColumns="False"
                                 ShowGroupPanel="False"
                                 AutoGenerateColumns="True"                                
                                 Grid.Row="0"
                                 IsFilteringAllowed="False"
                                 IsReadOnly="True"
                                 GridLinesVisibility="Both"
                                 SelectionMode="Extended"
                                 SelectionUnit="FullRow"                                
                                 RowIndicatorVisibility="Collapsed"                                
                                 AlternationCount="2"
                                 AlternateRowBackground="#F2F2F2"
                                 ItemsSource="{Binding Data}"
                                 SelectedItem="{Binding SelectedItem}"
                                 CanUserFreezeColumns="False"/>                   
    </Grid>
</Window>

I tried to attach a small project which reproduces the problem, but zip was not allowed :(

Thanks

Michael

Stefan
Telerik team
 answered on 27 May 2016
5 answers
131 views
Hi,

how can I prevent a childgridview from horizontal scrolling (the first two Columns)? I´d set the FrozenColumnCount-Property to 2 but it don´t worked, the entire childgridview is scrolling.

Bye, Michael
David
Top achievements
Rank 1
 answered on 26 May 2016
4 answers
150 views

Hello,

I have a master GridView and a details GridView in a RowDetailsTemplate. The master GridView is set to use FrozenColumnCount and works when the master GridView is scrolled horizontally as I expected, meaning the specified columns do not scroll.

The detail GridView is also set to use FrozenColumnCount. But when I scroll at the master GridView level, the frozen columns in the detail GridView scroll anyway.

Is there a way to scroll at the master GridView level, and have the detail GridView respect the FrozenColumnCount setting?

Any suggestions?

Thanks in advance!

Scott

Scott
Top achievements
Rank 1
 answered on 26 May 2016
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?