Telerik Forums
UI for WPF Forum
10 answers
932 views
Hi,

I'd like to display data from database using an OData endpoint in the GridView. For this I've decided to use the QueryableDataServiceCollectionView, passing the DataServiceContext and DataServiceQuery into constructor.

For OData, I have a standard setup of Web Api OData Service endpoint and WCF Data Services 5 WPF Client. Model (DTO) looks like this:

[DataServiceKey("FactTradeHeaderIdentifier")]
    public class TradeHeaderModel
    {
        [Key]
        [DataMember(IsRequired = true)]               
        public int FactTradeHeaderIdentifier { get; set; }
     
        ...
    }

And the autogenerated client side counterpart like this:

    /// <summary>
    /// There are no comments for Edft.Regulatory.Tracker.Service.Web.ApiModels.TradeHeaderModel in the schema.
    /// </summary>
    /// <KeyProperties>
    /// FactTradeHeaderIdentifier
    /// </KeyProperties>
    [global::System.Data.Services.Common.EntitySetAttribute("TradeHeaders")]
    [global::System.Data.Services.Common.DataServiceKeyAttribute("FactTradeHeaderIdentifier")]
    public partial class TradeHeaderModel : global::System.ComponentModel.INotifyPropertyChanged
    {
        /// <summary>
        /// There are no comments for Property FactTradeHeaderIdentifier in the schema.
        /// </summary>
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Services.Design", "1.0.0")]
        public int FactTradeHeaderIdentifier
        {
            get
            {
                return this._FactTradeHeaderIdentifier;
            }
            set
            {
                this.OnFactTradeHeaderIdentifierChanging(value);
                this._FactTradeHeaderIdentifier = value;
                this.OnFactTradeHeaderIdentifierChanged();
                this.OnPropertyChanged("FactTradeHeaderIdentifier");
            }
        }
 
        ...
}

When loading data into the QueryableDataServiceCollectionView 

var ds = new QueryableDataServiceCollectionView<TradeHeaderModel>(apiService.Container, apiService.Container.TradeHeaders);

I get this error:

System.ArgumentException: The DataServiceCollection to be tracked must contain entity typed elements with at least one key property. The element type 'Edft.Regulatory.Tracker.Presentation.CrossCutting.ServiceClient.ApiODataService.TradeHeaderModel' does not have any key property.
   at System.Data.Services.Client.DataServiceCollection`1.StartTracking(DataServiceContext context, IEnumerable`1 items, String entitySet, Func`2 entityChanged, Func`2 collectionChanged)
   at System.Data.Services.Client.DataServiceCollection`1..ctor(DataServiceContext context)
   at Telerik.Windows.Controls.DataServices.DataServiceCollection`1..ctor(DataServiceContext context)
   at Telerik.Windows.Data.QueryableDataServiceCollectionView`1..ctor(DataServiceContext dataServiceContext, DataServiceQuery`1 dataServiceQuery)
   at Edft.Regulatory.Tracker.Presentation.Modules.Dashboard.ViewModels.TradeHeaderViewModel.<LoadDataAsync>d__1f.MoveNext() in d:\TFS\Regulatory\Tracker\Dev\Codebase\Edft.Regulatory.Tracker.Presentation.Modules.Dashboard\ViewModels\TradeHeaderViewModel.cs:line 272

Note that the DataServiceKeyAttribute is defined on both client and server models.

Any ideas? 


Edit: Using the Telerik.Windows.Controls.DataServices50 version

Thanks,
Stevo

Vladimir Stoyanov
Telerik team
 answered on 06 Jul 2020
2 answers
359 views

I'd like to be able to use a masked input control to allow the user to enter a hexadecimal number representing a color value (ARGB) e.g. #FF445566 or 0x445566. Is there some way I can use one of the mask controls to achieve this?

Thanks
Pete

Vladimir Stoyanov
Telerik team
 answered on 06 Jul 2020
1 answer
479 views

 

I know that it is possible to remove distinct values from the filters, as described in this article: https://docs.telerik.com/devtools/wpf/controls/radgridview/filtering/how-to/howto-display-all-distinct-values

But I want to add distinct values to the column filter. The use case would be when the user is creating a favorite for a specific set of filters. When the user comes back later to the list, it may not contain the values that the favorite filter had specified at that moment. But the user would like to still be able to see what the filters for the favorite looks like.

Is it possible to add distinct values to a column filter, without creating a custom filter editor? 

Vladimir Stoyanov
Telerik team
 answered on 06 Jul 2020
1 answer
123 views

Hello,

I've got a problem with the control.
After a while after applying a filter, I get SQL & Entity Exception.
Now I would like to debug it and see where exactly is the issue.
I can't look into it selecting the event.

How can I do it?

Regards

Dinko | Tech Support Engineer
Telerik team
 answered on 06 Jul 2020
2 answers
170 views

Hi,

 

Is it possible to make a connection with a cap in the middle? I want to obtain an connection without caps at the start and end but with an arrow in the middle only.

Like this:    

------->-------

 

How can that be done? Thank you for your help! 

Dan
Top achievements
Rank 1
 answered on 03 Jul 2020
7 answers
518 views
I am using the 2011.2 version of Telerik.
We are using a rad grid view populated from a list of items about 5k or so long. When we hit the filter button the filter menu pops up, but it only has about half of the items available. Specifically, it sorts by string name (removing redundancies), only items up to those starting with the letter "M" are shown, where as I know that there are items all the way to "Z".

My question is this, is there a maximum number of items displayed in the filter's list? And if so, can we set the value higher?

Thanks,

Eli
Gert
Top achievements
Rank 1
 answered on 03 Jul 2020
1 answer
343 views

Having an issue where I have put a textbox in a toolbar.

The textbox Text is  bound to a property of a Viewmodel but the setter does not get exercised.

it seems as though focus is never lost from the textbox even if the next item does receive focus.

I would have sworn I have used this setup before without issue.

I pulled the code into a simpler project just to verify I was not crazy and it acted the same.

if I pull the textbox out of the toolbar it works fine.

It must be something stupid I am doing. but  i cant see it. What am I doing wrong.

Any help would be appreciated

 

            <telerik:RadToolBarTray Width="400" >
                <telerik:RadToolBar >
                    <TextBox Text="{Binding Main.Cali ,Mode=TwoWay}" Width="100" />
                </telerik:RadToolBar>
            </telerik:RadToolBarTray>

Thanks

Dave.

 

 

 

Dinko | Tech Support Engineer
Telerik team
 answered on 03 Jul 2020
0 answers
128 views

Telerik.Windows.Controls.RadCombobox.SelectedItemText returns null after screen reloads. I am able to read the Selected Item by using Visual UIA Verify. But, was unable to read it through automation code using TestStack.White framework. Below is the RadComboBox details from xaml page

<telerik:RadComboBox x:Name="ComboBox1"
Style="{StaticResource styleRadComboBoxTransparent}"
ItemsSource="{Binding FitAlgorithms}"
SelectedItem="{Binding SelectedBeadPlex.CurveFitData.FitAlgorithm, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
IsEnabled="{Binding EditEnabled}"
Margin="0,5,0,0"
>
telerik:RadComboBox.ItemTemplate



</telerik:RadComboBox.ItemTemplate>

But,
ComboBox1.SelectedItemText returns null in the Automation code. Please share your suggestions.
Thanks.

GREESHMA
Top achievements
Rank 1
 asked on 03 Jul 2020
2 answers
715 views

public PanelAssociation(DateTime Date)
        {
            date = Date;
 
            InitializeComponent();
 
            Day.Text = date.ToShortDateString();
 
            DragDropManager.AddDropHandler(ListExtern, OnDrop);
            DragDropManager.AddDragOverHandler(ListExtern, OnDragOver);
        }
 
        private void OnDrop(object sender, Telerik.Windows.DragDrop.DragEventArgs e)
        {
            var draggedItem = ((DataObject)e.Data).GetData("DragData");
            var droppedItem = (e.OriginalSource as FrameworkElement).ParentOfType<RadTreeViewItem>();
 
            PeopleModel.PeopleDetail people = draggedItem as PeopleModel.PeopleDetail;
            OrderModel.OrderHead head = droppedItem.Item as OrderModel.OrderHead;
 
            //create program
            OrderModel.OrderService.CreateProgramByID(head, date, people.id);
        }
 
        private void OnDragOver(object sender, Telerik.Windows.DragDrop.DragEventArgs e)
        {
            var draggedItem = DragDropPayloadManager.GetDataFromObject(e.Data, "DragData");
            var droppedItem = (e.OriginalSource as FrameworkElement).ParentOfType<RadTreeViewItem>();
 
            //remove all selections
            (sender as RadTreeView).SelectedItem = null;
 
            //select just droppeditem
            if (draggedItem is PeopleModel.PeopleDetail)
            {
                droppedItem.IsSelected = true;
            }
            else
            {
                e.Effects = DragDropEffects.None;
            }
            e.Handled = true;
        }
Hi, i have a simple RadListBox to RadTreeView drag and drop, if i run, the event onDrop is called twice, if i debug, at the end of first ondrop return me an exception:
DragEventArgs.cs not found

i post my code:
Minita
Top achievements
Rank 1
Veteran
 answered on 03 Jul 2020
1 answer
238 views
I'm showing two charts that are stacked vertically and have the same x-axis values. So I set ShowLabels to False for the top chart. However, now the points do not extend beyond the PlotArea on the right side even with ClipToPlotArea set to False. I have tried all sorts of margin and padding settings but I have not been able to add any extra space between the PlotArea and the right edge of the Chart. Suggestions?
Martin Ivanov
Telerik team
 answered on 02 Jul 2020
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
ProgressBar
Sparkline
LayoutControl
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
Rating
SplashScreen
Accessibility
Callout
CollectionNavigator
Localization
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
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?