Telerik Forums
UI for WPF Forum
3 answers
272 views

Hello,
I'm creating a new WPF application and would like to use implicit styles. The application currently uses the VisualStudio2013 theme.

In Designer everything is fine but when I run my application, the position or size of some controls are changed.

How can I have the Visual Studio designer or my app display the controls correctly?

 

 Example:

 

Masha
Telerik team
 answered on 26 Jan 2016
5 answers
264 views

Hi,

I want to print all mail merge letters (around 500 to 800) in background thread so that my application remains active and I should continue
doing tasks when the printing is in progress.
 
I also want to perform database task on all letters with the printing process in my application
but when I print all generated mail merge letters, my application is freezing until the printing is completed.

I also created support ticket no 999572.

Is it also possible to cancel printing process in the middle after printing is started?

Thanks

Tanya
Telerik team
 answered on 26 Jan 2016
2 answers
246 views

Hi all,

 

I'm trying creating row drag drop within a radgridview.

 Register events:

DragDropManager.AddDragOverHandler(AssociatedObject, OnDragOver);
DragDropManager.AddDropHandler(AssociatedObject, OnDrop);
DragDropManager.AddDragInitializeHandler(AssociatedObject, OnDragInitialize);
DragDropManager.AddDragDropCompletedHandler(AssociatedObject, OnDragCompleted);

 

I already tried with the belows, but unlucky.

DragDropManager.AddDragOverHandler(AssociatedObject, OnDragOver, true);
DragDropManager.AddDropHandler(AssociatedObject, OnDrop, true);
DragDropManager.AddDragInitializeHandler(AssociatedObject, OnDragInitialize, true);
DragDropManager.AddDragDropCompletedHandler(AssociatedObject, OnDragCompleted, true);

But OnDragOver, OnDragCompleted are not fire, the others are fire OK.

How can i get it works?

Quang Khải
Top achievements
Rank 1
 answered on 26 Jan 2016
1 answer
597 views

I'm using the RadCartesianChart to display a dynamic number of series in a lineseries and am trying to get it to refresh automatically when the collection that drives the ChartSeriesProvider is changed. I am using the MVVM pattern.

This is the XAML defining my charts. 

<chart:RadCartesianChart Grid.Column="0" Grid.Row="0" x:Name="ColumnChart">
            <chart:RadCartesianChart.HorizontalAxis >
                <chartView:CategoricalAxis Title="Date" />
            </chart:RadCartesianChart.HorizontalAxis>
            <chart:RadCartesianChart.VerticalAxis>
                <chartView:LinearAxis Title="Value" />
            </chart:RadCartesianChart.VerticalAxis>
            <chart:RadCartesianChart.Behaviors>
                <chartView:ChartTooltipBehavior Placement="Top" VerticalOffset="20" />
                <chartView:ChartPanAndZoomBehavior ZoomMode="Both"/>
            </chart:RadCartesianChart.Behaviors>
            <chart:RadCartesianChart.SeriesProvider>
                <chartView:ChartSeriesProvider IsDynamicSeries="True" Source="{Binding FilteredSeries}">
                    <chartView:ChartSeriesProvider.SeriesDescriptors>
                        <chartView:CategoricalSeriesDescriptor ItemsSourcePath="Values" CategoryPath="Date" ValuePath="Value">
                            <chartView:CategoricalSeriesDescriptor.Style>
                                <Style TargetType="chartView:LineSeries">
                                    <Setter Property="StrokeThickness" Value="2"/>
                                    <Setter Property="PointTemplate" Value="{StaticResource PointTemplate}" />
                                </Style>
                            </chartView:CategoricalSeriesDescriptor.Style>
                        </chartView:CategoricalSeriesDescriptor>
                    </chartView:ChartSeriesProvider.SeriesDescriptors>
                </chartView:ChartSeriesProvider>
            </chart:RadCartesianChart.SeriesProvider>
        </chart:RadCartesianChart>

This is the View model driving the chart.

public class PostProcessingColumnChartViewModel : INotifyPropertyChanged
    {
        private ObservableCollection<ChartSeries> _series;
        private ObservableCollection<long> _availableLineNumbers;
        private long _selectedLineNumber = -1;
 
        public PostProcessingColumnChartViewModel(PostProcessingEntry entry)
        {
            Name = entry.Name;
            AvailableLineNumbers.Add(-1);
            foreach (var postProcessingRecord in entry.Records)
            {
                if (!postProcessingRecord.Value.LineNumber.HasValue)
                    continue;
 
                var series = new ChartSeries()
                {
                    SerialNumber = postProcessingRecord.Value.SerialNumber,
                    LineNumber = postProcessingRecord.Value.LineNumber,
                    PointNumber = postProcessingRecord.Value.StationNumber
                };
                foreach (var value in postProcessingRecord.Value.Values)
                {
                    series.Values.Add(new ChartRecord() {Date = value.Key, Value = value.Value});
                }
                 
                Series.Add(series);
            }
            var lineNumbers = Series.Where(s => s.LineNumber.HasValue).Select(s => s.LineNumber.Value).Distinct().OrderBy(ln => ln).ToList();
            foreach (var lineNumber in lineNumbers)
            {
                AvailableLineNumbers.Add(lineNumber);
            }
        }
 
        public string Name { get; set; }
 
        public ObservableCollection<ChartSeries> Series => _series ?? (_series = new ObservableCollection<ChartSeries>());
 
        public ObservableCollection<long> AvailableLineNumbers => _availableLineNumbers ?? (_availableLineNumbers = new ObservableCollection<long>());
 
        public ObservableCollection<ChartSeries> FilteredSeries => new ObservableCollection<ChartSeries>(Series);
 
        public long SelectedLineNumber
        {
            get { return _selectedLineNumber; }
            set
            {
                if (_selectedLineNumber == value)
                    return;
 
                _selectedLineNumber = value;
                OnPropertyChanged();
            }
        }
 
        public event PropertyChangedEventHandler PropertyChanged;
 
        [NotifyPropertyChangedInvocator]
        protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
        {
            if (propertyName != null && propertyName.Equals("SelectedLineNumber"))
            {
                FilteredSeries.Clear();
                if (SelectedLineNumber > -1)
                    foreach (var series in Series.Where(s => s.LineNumber == SelectedLineNumber))
                    {
                        FilteredSeries.Add(series);
                    }
                else
                    foreach (var series in Series)
                    {
                        FilteredSeries.Add(series);
                    }
            }
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
        }
    }

I have these charts in a tab control and if I try and filter one it doesn't change until I view a different graph and then come back to the one I filtered. I know this is because chart goes through the rebinding process and updates but I would like that to happen while the user is currently viewing that chart. Everything seems to beworking except for the chart not updating until a rebinding occurs.

Aaron
Top achievements
Rank 1
 answered on 25 Jan 2016
1 answer
140 views

GridViewSelectColumn seems to be very slow when selecting a very large list of items. From the looks of it, it appears to be issuing a property changed notification for each item individually.

Is there a way to speed it up?

Petya
Telerik team
 answered on 25 Jan 2016
7 answers
164 views

I read examples from docs.telerik.com, downloaded demos but they're often so long and i can not know what i need in them. 

I only need make an item of a list to parent items in code behind. Do i need HierarchicalDataTemplate or RadTreeViewItem ?

 

_______ my code _______

public static HttpClient client = new HttpClient() ;
private void _ProductList()
{
      var url = "api/Products/";
      HttpResponseMessage response = client.GetAsync(url).Result;

      if (response.IsSuccessStatusCode)
      {
         var x = response.Content.ReadAsAsync<List<Product>>().Result;
         Product allprod = new Product();
         allprod.ProdID = 0;
         allprod.Name = " All Products";

        x.Add(allprod);
        myTreeView.ItemsSource = x;
        myTreeView.DisplayMemberPath = "Name";
        myTreeView.SelectedValuePath = "ProdID";
        // ....
     }
     else
     {
        MessageBox.Show("Error Code " + response.StatusCode +
                    " : Message - " + response.ReasonPhrase);
     }
}

__________

I tried RadTreeViewItem, but it doesn't have SelectedValuePath property.

- Items show Name and selected value is its ProdID 
And it seems difficult to use HierarchicalDataTemplate in code behind (with me).

- With my code, i have "prod.png" and i need "need.png" 

It's the best if you can edit code to me, please. Thank you.

__________

At last, i think demos (not only treeview) need a version classic-demo which is the most simple (except styles) with small data.
Example "First look" is really a big demo.

Son
Top achievements
Rank 1
 answered on 25 Jan 2016
2 answers
66 views
I want to have a list image as blocks with border.
I tried using stackpanel or not but i can not set item in ListBoxItem to center.
---
My listbox.ItemsSource is list of bitmapimage converted from base64string in data from web api. So they don't have urls.
My xaml is in 1.png
Debug to actual-img.png. I want to have list such as wanted-img.png or wanted-img2.png.
Can you help me, please?
---
I need click to image, it will show an actual-size image (i can do this) but do you think i should try RadTileList? 
---
Thank you. 
Son
Top achievements
Rank 1
 answered on 25 Jan 2016
3 answers
279 views

Hello,

I just ported my solution from .NET 3.5 to .NET 4.6.1 and updated Telerik from version 2012.2.912.35 to 2015.3.1104.5.

This code used to work fine, the setter of the property was called when the control lost focus:

 <telerik:RadNumericUpDown Value="{Binding UIExceeding, Mode=TwoWay}" SmallChange="0" LargeChange="0">

 

After the framework and Telerik was updated, the setter was never called anymore. To go back to how it used to work, I had to add UpdateSourceTrigger=LostFocus and UpdateValueEvent="PropertyChanged":

  <telerik:RadNumericUpDown Value="{Binding UIExceeding, Mode=TwoWay, UpdateSourceTrigger=LostFocus}" SmallChange="0" LargeChange="0" UpdateValueEvent="PropertyChanged">

 

Could you tell me what changed in between versions?

Thanks in advance

 

 

Nasko
Telerik team
 answered on 25 Jan 2016
9 answers
366 views
WPF 4.0 v2012.2.607.35
I have a grid of charges that are on invoices.  I want to show the charges by most recent invoice but sorting on the invoice number sorts incorrectly because it is a text field.  What I need to do is group by and show the InvoiceNumber but sort by the InvoiceId descending and not have the InvoiceId shown anywhere. 
Dilyan Traykov
Telerik team
 answered on 25 Jan 2016
6 answers
116 views

Hi,

I have problems when drag dropping inherited appointments from RadListBox to RadScheduleView. When the inherited class ProtocolChildAppointment (as below) is dropped from radListBox to scheduleview its a ProtocolAppointment class not the intented inherited class. I have tried to override Drop-function without success. Everything looks like its dropping a ProtocolChildAppointment  in the ConvertTo, ConvertDraggedData and Drop -functions.

public class ProtocolAppointment : Appointment
{
    public ProtocolAppointment()
        : base()
    {
    }
    // code...
    public override IAppointment Copy()
    {
        var newAppointment = new ProtocolAppointment();
        newAppointment.CopyFrom(this);
        return newAppointment;
    }
}

public class ProtocolChildAppointment : ProtocolAppointment
{
    public ProtocolChildAppointment()
        : base()
    {
    }
    //code...
    public override IAppointment Copy()
    {
        var newAppointment = new ProtocolChildAppointment();
        newAppointment.CopyFrom(this);
        return newAppointment;
    }
}

class ProtocolScheduleViewDragDropBehavior : Telerik.Windows.Controls.ScheduleViewDragDropBehavior
{
    public override IEnumerable<IOccurrence> ConvertDraggedData(object data)
    {
        if (DataObjectHelper.GetDataPresent(data, typeof(ProtocolAppointment), true))
        {
            return ((IEnumerable)DataObjectHelper.GetData(data, typeof(ProtocolAppointment), true)).OfType<IOccurrence>();
        }
        return base.ConvertDraggedData(data);
    }

    public override void Drop(Telerik.Windows.Controls.DragDropState state)
    {
        // here all stil looks like its dropping ProtocolChildAppointment
        base.Drop(state);
    }

}

class ProtocolAppointmentConverter : DataConverter
{
    public override string[] GetConvertToFormats()
    {
        return new string[] { typeof(PetErpUIClient.ProtocolAppointment).AssemblyQualifiedName };
    }

    public override object ConvertTo(object data, string format)
    {
        if (DataObjectHelper.GetDataPresent(data, typeof(ProtocolAppointment), false))
        {
            var payload = (IEnumerable)DataObjectHelper.GetData(data, typeof(ProtocolAppointment), false);
            if (payload != null)
            {
                List<PetErpUIClient.ProtocolAppointment> apps = new List<PetErpUIClient.ProtocolAppointment>();
                apps.AddRange(payload.OfType<PetErpUIClient.ProtocolAppointment>());
                return apps;
            }
        }
        return null;
    }
}

Kalin
Telerik team
 answered on 25 Jan 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?