Telerik Forums
UI for WPF Forum
2 answers
164 views

Hello all,

I recently started a trial for the Telerik WPF control suite and am experimenting with the DataPager. As I understand, it should be able to load server-side paged data. I however cannot even start and try to bind it to my view, as the ctor for the QueryableCollectionView() throws exceptions for what seems to be a correct IQueryable. I'm using the EF Core 1.0 with Sqlite. Perhaps this is not supported? EF 6 seems to work fine.

 

My DbContext and Test entity (doesn't get any simpler than this):

    public class Test
    {
        public int Id { get; set; }
    }

    public sealed class CRMMirrorContext2 : DbContext
    {
        #region Constructors, Destructors

        public CRMMirrorContext2()
        {
            Database.EnsureCreated();
        }

        public DbSet<Test> Tests { get; set; }

        #endregion

        #region Other Methods

        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        {
            try
            {
                var connectionString = @"Filename=C:\Temp\test.db";
                optionsBuilder.UseSqlite(connectionString);
            }
            catch (Exception)
            {
                // TODO: log/handle error
            }
        }

        #endregion
    }

 

I'm instantiating the QueryableCollectionview like this in my VM:

public CalendarViewModel()
        {
            this.InitializeProperties();
            this.InitializeCommands();
            using (var context = new CRMMirrorContext2())
            {
                var c = new QueryableCollectionView(context.Tests);
            }
        }

See attach for the exception message, hope you guys can help out with this. 

Thanks in advance.

Joseph
Top achievements
Rank 1
 answered on 05 Sep 2016
4 answers
145 views

Hi,

When you disable the Gridview (DataGridView.Enabled = false) the scrollbars are still there, everything is still enabled.

Only the user is not able to click on the element.

This is not according to the Microsoft guidelines. I would expect that the element is grayed out, and the scrollbars should be hidden automatically.   (bug)

W
Top achievements
Rank 1
 answered on 05 Sep 2016
1 answer
519 views
Hello. I write WPF MVVM Prism 6 multimodule application. In some View (let us call it PeppyView) I have RadTreeView which bound to ObservableCollection located in PeppyViewModel. This radTreeView is populated with data from this ObservableCollection. In turn, the ObservableCollection is populated with data from binary *.DAT file when user is clicking on the 'Deserialize' RadButton. After populating with the data my RadTreeView is shown as collapsed RadTreeView. But I need that my RadTreeView is shown as expanded after its populating with data. Because ViewModel has to have no knowlage about the View in MVVM I can't call RadTreeView.ExpandAll method from ViewModel code. So how can I expand RadTreeView in my case? Is there a way to map UI control's method to ViewModule and call it there?
Martin Ivanov
Telerik team
 answered on 05 Sep 2016
1 answer
510 views

Hi,

I was wondering how can I create a graphing paper background like the image attached.

http://previews.123rf.com/images/atthameeni/atthameeni1304/atthameeni130400133/18981872-graph-paper-illustrator-background-eps10-Stock-Vector.jpg

The graph will be properly aligned to time in X-Axis. Any way to do it?

 

Thanks,

Gaurav

 

Martin Ivanov
Telerik team
 answered on 05 Sep 2016
5 answers
475 views

Hi,

I'm trying to use NestedProperties feature with CustomTypeDescriptor and custom PropertyDescriptor, but the autogenerated PropertyDefinition does not have NestedProperties and HasNestedProperties is false:

void AutoGeneratingPropertyDefinition(object sender, AutoGeneratingPropertyDefinitionEventArgs e)
    {
       
      var descriptor = e.PropertyDefinition.SourceProperty.Descriptor as PropertyDescriptor;
      if (descriptor != null)
      {
          //e.PropertyDefinition.NestedProperties.Count == 0
          //but descriptor.GetChildProperties().Count > 0
             //why?
       }
    }

in my scenario:

  • I set AutoGenerateProperties = true and NestedPropertiesVisibility = true;
  • I have class MyCustomObject which implements ICustomTypeDescriptor (namespace System.ComponentModel)
  • I have class CustomPropertyDesctriptor that inherits from PropertyDescriptor (namespace System.ComponentModel)
  • ICustomTypeDescriptor.GetProperties implementation on MyCustomObject returns a collection of CustomPropertyDescriptor.
    Sometimes CustomPropertyDescriptor.GetValue(object component) returns new MyCustomObject instance so I have tree hierarchy

What's the condtition I need to satisfy to autogenerate NestedProperties' PropertyDefinitions?

it is not so easy to create sample project to simulate my scenario but I can do that if you can't answer without it

Stefan
Telerik team
 answered on 05 Sep 2016
1 answer
196 views

Hi folks,

i tried to cancel the editation of a ComboBoxColumnCell. But when i set GridViewPreparingCellForEditEventArgs.Cancel to true, the cell gets in edit mode, too.

Is it a bug or do i have to set another property?

Thanks

 

David

Stefan
Telerik team
 answered on 05 Sep 2016
2 answers
205 views

I had a RadCartesianChart control with a LineSeries within, which amtrying to replace with an AreaSeries. And following is the new code I have:

<telerik:RadCartesianChart Name="outputChart" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
            <telerik:RadCartesianChart.Grid>
                <telerik:CartesianChartGrid MajorLinesVisibility="XY">
                    <telerik:CartesianChartGrid.MajorXLineStyle>
                        <Style TargetType="Line">
                            <Setter Property="Shape.Stroke" Value="{StaticResource gridLineColor}" />
                        </Style>
                    </telerik:CartesianChartGrid.MajorXLineStyle>
                    <telerik:CartesianChartGrid.MajorYLineStyle>
                        <Style TargetType="Line">
                            <Setter Property="Shape.Stroke" Value="{StaticResource gridLineColor}" />
                        </Style>
                    </telerik:CartesianChartGrid.MajorYLineStyle>
                </telerik:CartesianChartGrid>
            </telerik:RadCartesianChart.Grid>
 
            <telerik:RadCartesianChart.HorizontalAxis>
                <telerik:DateTimeContinuousAxis
                    Name="horizontalAxis"
                    HorizontalAlignment="Center"
                    HorizontalContentAlignment="Center"
                    ElementBrush="LightGray"
                    PlotMode="OnTicks"
                    LabelInterval="2"
                    LabelStyle="{StaticResource XAxisLabelStyle}"
                    MajorStepUnit="Minute"
                    FontSize="12"
                    Foreground="{StaticResource textForeground}"
                    LabelFormat="h:mm tt"
                    LineThickness="0"
                    Minimum="{Binding StartTime}"
                    Maximum="{Binding EndTime}"
                    MajorStep="{Binding HorizontalMajorStep}" />
            </telerik:RadCartesianChart.HorizontalAxis>
 
            <telerik:RadCartesianChart.VerticalAxis>
                <telerik:LinearAxis
                    Name="verticalAxis"
                    Title="{x:Static resources:Strings.VerticalAxisTitle}"
                    ElementBrush="LightGray"
                    Minimum="0"
                    Maximum="{Binding VerticalMax}"
                    LineThickness="0"
                    MajorStep="{Binding VerticalMajorStep}" />
            </telerik:RadCartesianChart.VerticalAxis>
 
            <telerik:RadCartesianChart.Series>
                <telerik:AreaSeries
                Name="combinedSeries"
                ItemsSource="{Binding ChartPoints}"
                ValueBinding="Combined"
                CategoryBinding="CalculationTime"
                StrokeThickness="2"
                Stroke="{StaticResource StrokeColor}"
                ClipToPlotArea="False"
                Visibility="{Binding ThroughputVisibility}">
                    <telerik:AreaSeries.AreaShapeStyle>
                        <Style TargetType="Path">
                            <Setter Property="Fill" Value="{StaticResource StrokeColor}" />
                            <Setter Property="Opacity" Value="0.2" />
                        </Style>
                    </telerik:AreaSeries.AreaShapeStyle>
                </telerik:AreaSeries>
            </telerik:RadCartesianChart.Series>
 
            <telerik:RadCartesianChart.Annotations>
                <telerik:CartesianGridLineAnnotation
                    Name="combinedWarningLevelAnnotation"
                    Axis="{Binding ElementName=verticalAxis}"
                    Value="{Binding CombinedThroughputWarningLevel}"
                    Label="{Binding CombinedThroughputWarningLevel}"
                    Foreground="{StaticResource textForeground}"
                    FontSize="9"
                    Visibility="{Binding CombinedThroughputVisibility}"
                    StrokeThickness="1"
                    Stroke="{StaticResource combinedThroughputColor}" />
            </telerik:RadCartesianChart.Annotations>
        </telerik:RadCartesianChart>

 The vertical bound for the chart is dynamically bound to VerticalMax which is calculated at each time step after determining if any data value being plotted is above the current vertical limit. This logic was working perfectly well with LineSeries and the moment I replaced it with AreaSeries, the graph lines started going outside the vertical limits (i.e below 0 and above vertical max of the chart). There has been no change in the data being fed in whatsoever. Is there anything else I should be doing while using AreaSeries?

Martin Ivanov
Telerik team
 answered on 05 Sep 2016
3 answers
322 views

I've found the code to override the template selection:DataTemplateSelector

But the collapsed state of the combobox is not working.

Here is the XAML:
<telerik:RadComboBox x:Name="cboPickups"
Command="{Binding PickupChangedCommand}" HorizontalAlignment="Stretch"
CommandParameter="{Binding ElementName=cboPickups,Path=SelectedItem}" IsEnabled="{Binding CanSelectPickup}"
ItemsSource="{Binding Pickups}"
SelectedValuePath="CustomerId" SelectedValue="{Binding Path=SelectedPickup.Id, Mode=OneWay}" Margin="4">
<telerik:RadComboBox.ItemTemplateSelector>
<Helpers:CustomerComboTemplateSelector />
</telerik:RadComboBox.ItemTemplateSelector>
</telerik:RadComboBox>

Here are the templates:
<DataTemplate x:Key="CustomerComboCollapsed">
    <TextBlock Text="{Binding CompanyName}" />
</DataTemplate>
 
<DataTemplate x:Key="CustomerComboExpanded">
    <StackPanel>
        <TextBlock Text="{Binding CompanyName}" />
        <TextBlock Text="{Binding CityState}" />
    </StackPanel>
</DataTemplate>

Here is the template selector class:
public override System.Windows.DataTemplate SelectTemplate(object item, System.Windows.DependencyObject container)
{
    var presenter = (ContentPresenter) container;
 
    if (presenter != null && item != null)
    {
        if (presenter.TemplatedParent is ComboBox)
        {
            return presenter.FindResource("CustomerComboCollapsed") as DataTemplate;
        }
        else
        {
            return presenter.FindResource("CustomerComboExpanded") as DataTemplate;
        }
 
    }
    return null;
}

But when the window initializes and it tries to load the ComboBox, the "container" is null.

So it's trying to assign the collapsed template, but for some reason the container is null. Any ideas?  I've narrowed it down to the RadComboBox.  If I replace it with the base ComboBox control it works fine.

I've attached the screen shots for the collapsed/expanded and the debugger.

Thanks,
-Sid.

Piotr
Top achievements
Rank 1
 answered on 04 Sep 2016
2 answers
129 views

Background:

Our applications have multiple maps. I tried using one map control and moving it around to whichever screen was active but that was impractical.
I also tried creating a shared list of providers amongst the map controls, but that just didn't work.

Problem:
Each map has to create its own Bing provider so each map is creating its own session. If I have 10 maps, then my application is using 10x the amount of billable transactions than it should be every time it's opened. Is it possible to "share" sessions? For example, the first provider to be created could get the session and then I could just set the other providers to use the same session ID manually?

I think I can test this but wanted to know if there any problems with doing this.

Jason D
Top achievements
Rank 1
Veteran
 answered on 02 Sep 2016
2 answers
234 views

I'm currently in a heavy need of the GanttView control, but having some minor & major problems.

Major Problem

See Picture Bug_1 -> Bug_2

In Bug1 you see how the control initializes with the columns packed together very close and behind the GanttView. On Bug2 you see what happens, as soon as i use the horizontal scrollbar beneath the columns. Is there any real workaround for this behavior?

Minor Problem

See Picture Problem_Splitter and Spacing

1) The orange highlighted Splitter. How can I access this and set it to a specific size? (I need to adjust the splitter so, table view and chart view are both exactly 50% regardless of width of window)

2) The green highlighted Space. This is a space the control uses because of HorizontalAlignment="stretch" but not really. I want the GanttView to behave as every other control when on Stretch mode -> use the whole space available. Any solution/workaround for this?

 

tia

Mark

Polya
Telerik team
 answered on 02 Sep 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
Expander
Slider
TileList
PersistenceFramework
DataPager
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
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?