Telerik Forums
UI for WPF Forum
2 answers
183 views
I'm trying to bring an app that was written against 2012.3.1017.40 forward, and I've run up against the dropping of RadDragAndDropManager.  So I'm trying to write our stuff to use the new DragDropManager. And I'm having a problem.

We have a grid on which we want drag-and-drop reordering only sometimes.  So I've bound RowReorderBehavior.IsEnabled to a property on my viewmodel.  And here's the odd thing - it only works to turn RowReorderBehavior on, not off.

I can trace, in the debugger, the property as its value is set, and I can see it raising INotifyPropertyChanged. And if I'm setting it to true, I then trace through RowReorderBehavior.OnIsEnabledPropertyChanged(). But if I set it to false, I'm still raising INotifyPropertyChanged, but RowReorderBehavior.OnIsEnabledPropertyChanged() is never called.

I can replicate this in the Q3 2012 Row Reorder demo.

To RowReorderBehavior.cs, I add the following class:
public class SortingAllowed : INotifyPropertyChanged
{
    public SortingAllowed()
    {
        this.allowSorting = false;
    }
 
    private bool allowSorting_;
    public bool allowSorting
    {
        get { return this.allowSorting_; }
        set
        {
            this.allowSorting_ = value;
            OnPropertyChanged("allowSorting");
        }
    }
 
    public event PropertyChangedEventHandler PropertyChanged;
    private void OnPropertyChanged(string propertyName)
    {
        if (PropertyChanged != null)
            PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
    }
}

Then in Example.xaml, I add a static instance to Grid.Resources, create a couple of row definitions, set a checkbox in row 0, move the RadGridView to row 1, then bind Checkbox.IsChecked and RadGridView's RowReorderBehavior.IsEnabled to the static resource:
<Grid>
    <Grid.RowDefinitions>
        <RowDefinition Height="auto" />
        <RowDefinition Height="*" />
    </Grid.RowDefinitions>
    <Grid.Resources>
        <local:SortingAllowed x:Key="sortingAllowed" />
 
        <Style TargetType="telerik:GridViewRow"
               x:Key="DraggedRowStyle"
               BasedOn="{StaticResource GridViewRowStyle}">
            <Setter Property="telerik:DragDropManager.AllowDrag"
                    Value="True" />
        </Style>
    </Grid.Resources>
    <StackPanel Grid.Row="0" Orientation="Horizontal">
        <CheckBox IsChecked="{Binding Source={StaticResource sortingAllowed}, Path=allowSorting}">Allow sorting</CheckBox>
    </StackPanel>
    <telerik:RadGridView
                         Grid.Row="1"
                         x:Name="RadGridView1" GroupRenderMode="Flat"
                         ShowGroupPanel="False" CanUserResizeRows="True"
                         ItemsSource="{Binding Customers}"
                         RowStyle="{StaticResource DraggedRowStyle}"
                         AllowDrop="True"
                         CanUserSortColumns="False"
                         local:RowReorderBehavior.IsEnabled="{Binding Source={StaticResource sortingAllowed}, Path=allowSorting}"
                         telerik:ScrollingSettingsBehavior.IsEnabled="True"
                         telerik:ScrollingSettingsBehavior.ScrollAreaPadding="30"
                         telerik:ScrollingSettingsBehavior.ScrollStep="24"
                         telerik:ScrollingSettingsBehavior.ScrollStepTime="00:00:00.05">

Jeff
Top achievements
Rank 1
 answered on 11 Jul 2013
1 answer
53 views
I am adding a new slot every second to give the schedule view a timeline appearance. I have requirement to allow the user to edit any appointment which is not completely within a special slot is there a way to accomplish this task. Currently the moment any part of the appointment enters into a special slot it becomes read only.
Kalin
Telerik team
 answered on 11 Jul 2013
3 answers
255 views
I'm new to using the RadCartesianChart and to WPF in general and I'm having a problem figuring out how to get a value out of the chart. I don't care if it's via command, event handler, binding, or whatever as long as I can get the data. I have a DateTimeContinuousAxis as my HorizontalAxis and 2 LineSeries both binding to list of objects that all have a DateTime on them and 2 other values. Each LineSeries binds to a different one of the values. This seems to work for getting the values on the chart.

Then I added a ChartPanAndZoomBehavior to the chart and I can now zoom into a portion of the whole, which is great and very slick. However, I want to make other things on the page show information based on the date range that the user is now examining data for. The closest I got was using the LayoutUpdated on part of it and getting the HorizontalAxis's ActualRange, but that didn't reflect the fact that you it had been zoomed.

So my question in a nutshell is: Using a DateTimeContinuousAxis as my HorizontalAxis and a ChartPanAndZoomBehavior, how can I get the date range that the user is looking to use for other controls?

My chart:
<chart:RadCartesianChart Margin="0"
                            HorizontalAlignment="Stretch"
                            VerticalAlignment="Stretch"
                            x:Name="LineGraph">
    <chart:RadCartesianChart.HorizontalAxis>
        <telerik:DateTimeContinuousAxis MajorStep="4"
                                        MajorStepUnit="Week">
            <telerik:DateTimeContinuousAxis.LabelTemplate>
                <DataTemplate>
                    <StackPanel Orientation="Vertical">
                        <TextBlock HorizontalAlignment="Center" Text="{Binding StringFormat='MMMM dd'}" />
                        <TextBlock HorizontalAlignment="Center" Text="{Binding StringFormat=yyyy}" />
                    </StackPanel>
                </DataTemplate>
            </telerik:DateTimeContinuousAxis.LabelTemplate>
        </telerik:DateTimeContinuousAxis>
    </chart:RadCartesianChart.HorizontalAxis>
 
    <chart:RadCartesianChart.VerticalAxis>
        <telerik:LinearAxis Title="Count"
                            LabelInterval="1"
                            Minimum="0" />
    </chart:RadCartesianChart.VerticalAxis>
 
    <chart:RadCartesianChart.Grid>
        <telerik:CartesianChartGrid MajorLinesVisibility="Y" StripLinesVisibility="Y">
            <telerik:CartesianChartGrid.YStripeBrushes>
                <SolidColorBrush Color="Transparent" />
                <SolidColorBrush Opacity="0.15" Color="Gray" />
            </telerik:CartesianChartGrid.YStripeBrushes>
        </telerik:CartesianChartGrid>
    </chart:RadCartesianChart.Grid>
 
    <telerik:RadCartesianChart.Behaviors>
        <telerik:ChartTrackBallBehavior ShowIntersectionPoints="True" />
        <telerik:ChartPanAndZoomBehavior PanMode="Horizontal"
                                            ZoomMode="Horizontal" />
    </telerik:RadCartesianChart.Behaviors>
 
    <telerik:LineSeries CategoryBinding="Day"
                        ClipToPlotArea="False"
                        CombineMode="Stack"
                        ItemsSource="{Binding TasksByDay}"
                        Stroke="{StaticResource OnTrackFillAccentBrush}"
                        StrokeThickness="0"
                        Tag="Area"
                        TrackBallInfoTemplate="{StaticResource trackBallInfoTemplate}"
                        TrackBallTemplate="{StaticResource trackBallOnTrackTemplate}"
                        ValueBinding="OnTrack" />
 
    <telerik:LineSeries CategoryBinding="Day"
                        ClipToPlotArea="False"
                        CombineMode="Stack"
                        ItemsSource="{Binding TasksByDay}"
                        Stroke="{StaticResource OverDueFillAccentBrush}"
                        StrokeThickness="0"
                        Tag="Area"
                        TrackBallInfoTemplate="{StaticResource trackBallEmptyInfoTemplate}"
                        TrackBallTemplate="{StaticResource trackBallOverDueTemplate}"
                        ValueBinding="OverDue" />
</chart:RadCartesianChart>

The ItemsSource is a List<TasksDueOnDay>:
public class TasksDueOnDay
{
    public DateTime Day { get; set; }
    public int OnTrack { get; set; }
    public int OverDue { get; set; }
 
    public override string ToString()
    {
        return "TasksDueOnDay.ToString()";
    }
}
Ves
Telerik team
 answered on 11 Jul 2013
5 answers
104 views

Hello

We generate GridViewDataColumn columns in run time

We give cell template and cell edit template

When the cell goes out from edit mode it throws

Null reference exception in TryConvertValueFromEditor at GriveViewCell Class
 
Dll version 2013.2.611.45 
 
If I don’t give cell edit template this not happened. 
 
Any ideas why this happens?

 

Best Regards

Ehud

 

Ehud
Top achievements
Rank 1
 answered on 11 Jul 2013
3 answers
188 views
Hi,

Is possible to set manually the columns width?
Look this example, all columns is overlappeds!

<telerik:RadCartesianChart>
            <telerik:RadCartesianChart.HorizontalAxis>
                <telerik:DateTimeContinuousAxis MaximumTicks="5" PlotMode="OnTicksPadded"/>
            </telerik:RadCartesianChart.HorizontalAxis>
            <telerik:RadCartesianChart.VerticalAxis>
                <telerik:LinearAxis/>
            </telerik:RadCartesianChart.VerticalAxis>
            <telerik:BarSeries Name="mS">
 
            </telerik:BarSeries>
            <telerik:RadCartesianChart.Behaviors>
                
                <telerik:ChartPanAndZoomBehavior/>
            </telerik:RadCartesianChart.Behaviors>
        </telerik:RadCartesianChart>
public MainWindow()
        {
            InitializeComponent();
 
            for (int i = 0; i < 100;i++ )
                mS.DataPoints.Add(new Telerik.Charting.CategoricalDataPoint() { Category = System.DateTime.Today.AddDays(i), Value = 5 });
             
        }
Petar Kirov
Telerik team
 answered on 11 Jul 2013
1 answer
416 views
I've placed a masked numeric input control onto a user control we're working on. When I run the app I get the following error:

System.Windows.Markup.XamlParseException occurred
  HResult=-2146233087
  Message='Set property 'Telerik.Windows.Controls.RadMaskedInputBase.FormatString' threw an exception.' Line number '291' and line position '48'.
  Source=PresentationFramework
  LineNumber=291
  LinePosition=48
  StackTrace:
       at System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri)
  InnerException: System.FormatException
       HResult=-2146233033
       Message=Format specifier was invalid.

I'm sure I've done something wrong, but am not sure what. Here's what the XAML looks like right now:

<telerik:RadMaskedNumericInput x:Name="txtClientNumber" FormatString="D6" MinWidth="80" Margin="3,0"
                               VerticalContentAlignment="Center" FontSize="15"
                               Value="{Binding ClientNumber, UpdateSourceTrigger=PropertyChanged}" Mask="#6" />

What we're trying to do is have the user enter a 6 digit integer value. The data type is an int (in C#), and SQL Server data type is also an int. So, what's the error of my ways?
Petar Mladenov
Telerik team
 answered on 11 Jul 2013
3 answers
129 views
Hi,

Is it possible to have child tasks display in the grid on the GanttView with different columns/headers than the parent task, whilst still displaying normally on the time line portion of the control?

thanks
Ventzi
Telerik team
 answered on 11 Jul 2013
3 answers
453 views
Hi, 

I have binded a collection of my custom objects which can be grouped according to one of its properties to the itemssource, i want to display the suggestion dropdown list as group in DropDownItemTemplate (as attached image can show) 

1) Display a group title followed by the members belong to that group
2) Group title is not selectable 
3) highlight a text that typed in the search box 

Any help or direction is much appreciated!

thanks 
wsw
fitz
Top achievements
Rank 1
 answered on 11 Jul 2013
1 answer
127 views
Hi,

I ask if is possible to obtain this scenario:

1) A ChartPanAndZoomBehavior with zoom bar enabled and zoom mouse drag rectangle disabled
2) Allow mouse drag rectangle for points selection

Thank's
marc.
Rosko
Telerik team
 answered on 11 Jul 2013
1 answer
283 views
Hi. Trying to figure out the best way to have a RadListBox which supports internal reordering, and dragging in from an external source (files from Explorer). I'm a bit confused by the available parts: ListBoxDragDropBehavior, DragDropManager, DataConverter and the various events directly on RadListBox.

What SHOULD I do?
George
Telerik team
 answered on 10 Jul 2013
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
Expander
Slider
TileList
DataPager
PersistenceFramework
Styling
TimeBar
OutlookBar
TransitionControl
FileDialogs
Book
ToolBar
ColorPicker
TimePicker
MultiColumnComboBox
SyntaxEditor
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
WatermarkTextBox
DesktopAlert
BarCode
SpellChecker
DataServiceDataSource
EntityFrameworkDataSource
RadialMenu
ChartView3D
Data Virtualization
BreadCrumb
LayoutControl
ProgressBar
Sparkline
TabbedWindow
ToolTip
CloudUpload
ColorEditor
TreeMap and PivotMap
EntityFrameworkCoreDataSource (.Net Core)
HeatMap
Chat (Conversational UI)
VirtualizingWrapPanel
Calculator
NotifyIcon
TaskBoard
TimeSpanPicker
BulletGraph
Licensing
WebCam
CardView
DataBar
FilePathPicker
PasswordBox
SplashScreen
Callout
Rating
Accessibility
CollectionNavigator
Localization
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?