Telerik Forums
UI for WPF Forum
3 answers
105 views

Hi,

 

I've noticed when adding plot points that they're not being placed accurately? The data point in the attached image should be plotted at 0,0 so the lines should intersect the circular data point evenly. However it plots it off centre.

 

Do I have a setting wrong or something?

 

Thanks,

Petar Marchev
Telerik team
 answered on 21 Apr 2015
5 answers
221 views

In my project, I have a timeline that is updated every second or so.

At each second, an Item with a duration representing the elapsed time is updated : its duration is modified.

 

 When only the duration of one item changes, the timeline is redrawn when the VisibleStartDate and/or VisibleEndDate are changed.

If the visible zone is not changed, the only way to make the new duration of the item appear on the timeline is to use the Setter on ItemsSource.  But this results in poor performances, most notably because I have implemented a mechanism that remembers the selected items when the Data is refreshed (it reselects it).

 

So in order to only redraw the timeline without having to update the ItemSource, I resolved to this uglyhack (that works, though).

In the view model.

public void UpdateItemDurationAndRefresh()
{
    itemWithDuration.Duration = GetNewTimeSpan();
    this.VisibleDate = this.VisibleDate.AddMilliseconds(-1);
    this.VisibleDate = this.VisibleDate.AddMilliseconds(1);
}

 I tried the following, but the duration of the item is not visible until some other interactions either changes the visible zone, or the ItemSource is actually updated.

public void UpdateItemDurationAndRefresh() // DOES NOT WORK
{
    itemWithDuration.Duration = GetNewTimeSpan();
    this.PropertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs("Data"));
   // "Data" is the name of the collection containing "itemWithDuration",
   // and is binded to the GUI thanks to the XAML code
}

 

 

Is there anyway to redraw the timeline without having to reset the ItemSource, just like what is done when the visible zone is modified ?

 

Thanks

Albert
Top achievements
Rank 1
 answered on 20 Apr 2015
1 answer
110 views

hello guys,

i'm testing this control for developing a gantt for ms dynamics nav. Everything works fine but now i'm searching for a way to manually update the whole view, because i load data async nothing is shown in my gantt when it's loaded on my page. I want the control to completely update it's view when dataload is finished and i don't know which function to use or how to do this.

 

As u can see in pic1 page is open no data is shown.

As u can see in pic2 i only resize width a little bit, ganttPart is updated.

As u can see in pic3 i resize width an height more, gridPart is also updated.

i need a function to do the update, when my dataset i loaded.

 

Polya
Telerik team
 answered on 20 Apr 2015
4 answers
123 views

I set the theme for my windows 8 desktop app like so.

StyleManager.ApplicationTheme= new Windows8TouchTheme();

I have changed the default fontsize , background , and foreground for my header cells and row like so:

<Style TargetType="{x:Type telerik:GridViewHeaderCell}">
    <Setter Property="FontSize" Value="24"/>
    <Setter Property="Background" Value="#FF407FCB" />
    <Setter Property="Foreground" Value="White" />
</Style>
<Style TargetType="{x:Type telerik:GridViewHeaderRow}">
    <Setter Property="FontSize" Value="24"/>
    <Setter Property="Background" Value="#FF407FCB" />
    <Setter Property="Foreground" Value="White" />
</Style>
 

But unfortunately the "funnel surrounded by circle" filter button is still the default grey.

Is there a simple way to affect this.

Do I really have to extract the whole template just to set the color of the funnel ?

Any help would be appreciated

thanks

dco

 

 

 

 

David Ocasio
Top achievements
Rank 2
Iron
Veteran
Iron
 answered on 20 Apr 2015
5 answers
258 views
I've just started with the chart control, but seem to be hitting a brick wall. I'm trying to get the labels, primarily on the Y-Axis to scale properly. Skip entries is probably a better term than scale possibly.

When the window size is changed the charts scale with the window, but the labels don't and they end up all compressed and scrunched up. I don't know if it's the parent control that's causing this or some other issue.

I've attached a couple of files showing the normal view (uncompressed) and then when I resize the window (compressed). The charts are in a standard WPF grid, which is in a RadPane. I can post the XAML if needs be, but it's doing nothing more than binding to the data at present.


Martin Ivanov
Telerik team
 answered on 20 Apr 2015
10 answers
487 views
I have a toolbox containing two types of shapes: circles and rectangles.
I create these shapes in code. My viewmodel contains a Geometry property.
The circle I create using the statement "ShapeFactory.GetShapeGeometry(FlowChartShapeType.StartShape)" which gives me a geometry.
This is working fine.

The StartShape geometry has a built in size of 74 by 111 pixels.
Now I find these shapes to big and want to make them smaller. 
It seems I'm not able to change the width and height of the generated Geometry.

I tried setting the width and height in the ControlTemplate but it doesn't give me the result I want because the shape is still to big while dragging the item from the toolbox.
I also tried setting my the Geometry to a new EllipseGeometry. But this gives me an error "Unexpected token 'System.Windows.Media.EllipseGeometry' encountered at position '0'."

Could you please tell me what's the easiest way to use these predefined basic geometries but in a different size?
Masha
Telerik team
 answered on 20 Apr 2015
1 answer
140 views

I have a windows service that periodically sends emails with images of ChartView controls. I am having a hard time getting the ChartView to fully render unless I attach it to a window and show the window and then immediately close it. The code is running from a windows service and so this is really not desired.

 If I render the control using the following BuildContentStream method then it simply displays the "No data to display message"

 

private MemoryStream BuildContentStream(FrameworkElement visualItem, int width, int height)
{
    var view = visualItem;
    view.Measure(new Size(width, height));
    view.Arrange(new Rect(0, 0, width, height));
    view.UpdateLayout();
 
    var rtb = new RenderTargetBitmap(width, height, 96, 96, PixelFormats.Default);
    rtb.Render(view);
 
    var png = new PngBitmapEncoder();
    png.Frames.Add(BitmapFrame.Create(rtb));
    var memStream = new MemoryStream();
    png.Save(memStream);
 
    memStream.Position = 0;
    return memStream;
}

If I attach the control to a window and then do the following then it works correctly.

// The window acts as a visualizer. Can't get it working otherwise
var window = new RadWindow();
window.Height = 300;
window.Width = 400;
window.Content = errorItem.View;
window.WindowState = WindowState.Normal;
window.Show();
window.Close();
 
var stream = BuildContentStream(errorItem.View, 400, 300);

 

I have also tried the ExportToImage extension without success?

Is it possible to get this working from a windows service without any UI?

Petar Marchev
Telerik team
 answered on 20 Apr 2015
3 answers
178 views

Hi,

Issue#1

We are using Rad Map control in one of our application where we need to show current position of the device. To achieve the functionality we are using timer to get updated position at regular interval.We are also using VirtualizationSource class to bind data on map (reference  - http://demos.telerik.com/silverlight/#Map/DynamicLayer). But each time when we are binding the data to map control labels showing on the map are blinking. [see img1 & img2 Attached]

So Please suggest some solution for the same.

Issue#2

In above mentioned application, I want to retain the focus area of the Map. How can I achieve the same ?

Please guide.

 

Also, Is it possible to set Width and Height as AUTO of the Labels on the Map.

Petar Mladenov
Telerik team
 answered on 20 Apr 2015
1 answer
155 views

We are using telerik GridViews, and on the startup of the application we get the following exception thrown. We do not get any stack trace related to our application, so we don't know where to start looking for the source of the problem. It seems that when initializing the grid is some issue, but we don't know what could cause this.

[Message]:
Exception has been thrown by the target of an invocation.
[Type]:
System.Reflection.TargetInvocationException
[Target]:
System.Object InvokeMethod(System.Object, System.Object[], System.Signature, Boolean)
[Source]:
mscorlib
[StackTrace]:
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
   at System.Delegate.DynamicInvokeImpl(Object[] args)
   at System.Windows.RoutedEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at Telerik.Windows.Controls.GridView.GridViewHeaderRow.PrepareCell(GridViewCellBase cellBase, GridViewColumn column)
   at Telerik.Windows.Controls.GridView.GridViewCellsPanel.GetVirtualizedCell(GridViewColumn column, Boolean createIfNull)
   at Telerik.Windows.Controls.GridView.GridViewCellsPanel.RealizeAndMeasureCells(Int32 startIndex, Int32 predictedLastIndex, Func`2 calculateNextIndex)
   at Telerik.Windows.Controls.GridView.GridViewCellsPanel.UpdateVirtualizedCells()
   at Telerik.Windows.Controls.GridView.GridViewCellsPanel.MeasureOverride(Size availableSize)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
   at System.Windows.Controls.ItemsPresenter.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Control.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
   at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV, Boolean& hasDesiredSizeUChanged)
   at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)
   at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Control.MeasureOverride(Size constraint)
   at Telerik.Windows.Controls.GridView.GridViewRowItem.MeasureOverride(Size availableSize)
   at Telerik.Windows.Controls.GridView.GridViewHeaderRow.MeasureOverride(Size availableSize)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
   at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV, Boolean& hasDesiredSizeUChanged)
   at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)
   at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.ScrollViewer.MeasureOverride(Size constraint)
   at Telerik.Windows.Controls.GridView.GridViewScrollViewer.MeasureOverride(Size availableSize)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
   at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV, Boolean& hasDesiredSizeUChanged)
   at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)
   at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Control.MeasureOverride(Size constraint)
   at Telerik.Windows.Controls.GridView.GridViewDataControl.MeasureOverride(Size availableSize)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
   at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV, Boolean& hasDesiredSizeUChanged)
   at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)
   at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
   at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV, Boolean& hasDesiredSizeUChanged)
   at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)
   at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Border.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
   at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV, Boolean& hasDesiredSizeUChanged)
   at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)
   at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
   at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Border.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Border.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Control.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.WrapPanel.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
   at System.Windows.Controls.ScrollContentPresenter.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
   at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV, Boolean& hasDesiredSizeUChanged)
   at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)
   at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Border.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.ScrollViewer.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
   at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Border.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Control.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Border.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
   at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Control.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
   at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Border.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Control.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
   at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.ContextLayoutManager.UpdateLayout()
   at System.Windows.ContextLayoutManager.UpdateLayoutCallback(Object arg)
   at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
   at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
   at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)
   at System.Windows.Interop.HwndTarget.OnResize()
   at System.Windows.Interop.HwndTarget.HandleMessage(WindowMessage msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Interop.HwndSource.HwndTargetFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
 
[Message]:
Collection was modified; enumeration operation may not execute.
[Type]:
System.InvalidOperationException
[Target]:
Boolean MoveNextRare()
[Source]:
mscorlib
[StackTrace]:
   at System.Collections.Generic.List`1.Enumerator.MoveNextRare()
   at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source, Func`2 predicate)
   at Telerik.Windows.DragDrop.DragDropManager.OnAllowDragPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
   at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
   at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
   at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
   at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
   at Telerik.Windows.DragDrop.DragDropManager.SetAllowDrag(DependencyObject obj, Boolean value)
   at Telerik.Windows.Controls.GridView.DragDropController.InitializeHeaderCellDragDrop(GridViewHeaderCell cell)
 
 
 
​

Dimitrina
Telerik team
 answered on 17 Apr 2015
2 answers
117 views

I create a VirtualQueryableCollectionView using the following method, the SourceCollection of the view is empty.  Is there any way to force an initial load?

 

public VirtualQueryableCollectionView GetVirtualQueryableCollectionView(int loadsize,
    List<String> includes, Func<T, bool> whereClause,
    Func<T, Object> orderBy, bool orderByIsDesc = false,
    Func<T, Object> thenBy = null, bool thenByIsDesc = false)
{
    ObjectQuery<T> q = Query(CreateContext());
    if (includes != null)
    {
        foreach (var include in includes)
        {
            q = q.Include(include);
        }
    }
    if (whereClause != null)
    {
        if (orderBy != null)
        {
            if (orderByIsDesc)
            {
                if (thenBy != null)
                {
                    if (thenByIsDesc)
                    {
                        q.Where(whereClause).OrderByDescending(orderBy).ThenByDescending(thenBy);
                    }
                    else
                    {
                        q.Where(whereClause).OrderByDescending(orderBy).ThenBy(thenBy);
                    }
                }
                else
                {
                    q.Where(whereClause).OrderByDescending(orderBy);
                }
            }
            else
            {
                if (thenBy != null)
                {
                    if (thenByIsDesc)
                    {
                        q.Where(whereClause).OrderBy(orderBy).ThenByDescending(thenBy);
                    }
                    else
                    {
                        q.Where(whereClause).OrderBy(orderBy).ThenBy(thenBy);
                    }
                }
                else
                {
                    q.Where(whereClause).OrderBy(orderBy);
                }
            }
        }
        else
        {
            q.Where(whereClause);
        }
    }
    else if (orderBy != null)
    {
        if (orderByIsDesc)
        {
            if (thenBy != null)
            {
                if (thenByIsDesc)
                {
                    q.OrderByDescending(orderBy).ThenByDescending(thenBy);
                }
                else
                {
                    q.OrderByDescending(orderBy).ThenBy(thenBy);
                }
            }
            else
            {
                q.OrderByDescending(orderBy);
            }
        }
        else
        {
            if (thenBy != null)
            {
                if (thenByIsDesc)
                {
                    q.OrderBy(orderBy).ThenByDescending(thenBy);
                }
                else
                {
                    q.OrderBy(orderBy).ThenBy(thenBy);
                }
            }
            else
            {
                q.OrderBy(orderBy);
            }
        }
    }
    var view = new VirtualQueryableCollectionView(q)
    {
        LoadSize = loadsize
    };
 
    return view;
}
 

 

​

Steve
Top achievements
Rank 1
 answered on 17 Apr 2015
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
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
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
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?