Telerik Forums
UI for WPF Forum
4 answers
212 views
Hi telerik,

I am confused how to use RadGridView with VirtualQueryableCollectionView in order for data virtualization, but some issues encountered when I insert a new item, let me clarify.

I use the below code to set datacontext of a window, 
var query = _context.Taxes.OrderBy(o => o.TaxID); //Order_Details.OrderBy(o => o.OrderID);
           var view = new VirtualQueryableCollectionView(query) {LoadSize = 10 };
           DataContext = view;

but there are some specified points, the Tax table only have 7 records, those records can show in grid correctly,but if I use blow code for inserting a new item,
           
private void Button_Click(object sender, RoutedEventArgs e)
    {
        (DataContext as VirtualQueryableCollectionView).AddNew(new Tax() { TaxCode = "45",TaxPercentage2 = 0.34f });
    }

this new item will not display in grid expect adding this statement
         
(DataContext as   VirtualQueryableCollectionView).VirtualItemCount++;

But executing this statement will refresh the collection and grid,  I don't want to do this. so my questions are
1. How can I show all records if called insert statement?
2. How to save a new records to database? 
I did this using below statements currently:
         
(DataContext as  VirtualQueryableCollectionView).Insert(0, newItem);
           context.CreateObjectSet<TValue>().AddObject(newItem);
           context.SaveChanges();

if I can add use VirtualQueryableCollectionView's AddNew/AddNewItem/Insert add a item to VirtualQueryableCollectionView and then call someone method to save it to database directly without needing executing context.CreateObjectSet<TValue>().AddObject(newItem);
? if yes, could you provide a sample project for me? thanks very much.
Dimitrina
Telerik team
 answered on 10 Jul 2013
1 answer
81 views
Hi,

I have a scatterchart with lots of datapoints.
Values from -100 % to 3 000 000 %.

When I apply zoom to one or more points, the zoom are gets totally wrong.
For example the zoom area could be set to -200 % -400 %; even though I zoom on a point that had a positive number.

This issue applies to both axes, every time I zoom.

Any ideas?
Petar Marchev
Telerik team
 answered on 10 Jul 2013
1 answer
192 views
Hi,

I have 8 RadGridViews in my wpf application. I have used some properties of the RadGridView in the below code snippet. Each RadGridView is added inside an Expander.

When I select an item in a tree view, I change the Datacontext of the Expander. But the rendering of the control  takes too much of tne time. How do i improve the rendering performance of my RadGridViews?  Am i missing anything? Can anyone help.

<Telerik:RadGridView CanUserFreezeColumns="False"

                                                                     RowIndicatorVisibility="Collapsed"

                                                                     RowDetailsVisibilityMode="{Binding ElementName=root,Path=CanEdit.IsEnabled,IsAsync=True,Converter={StaticResource rowdetailsvisibilityconverter}}"

                                                                     RowDetailsTemplate="{StaticResource propertyEditTemplate}"

                                                                     ItemsSource="{Binding Properties}"

                                                                     AutoGenerateColumns="False"

                                                                     SelectionUnit="FullRow"

                                                                     SelectionMode="Single"

                                                                     DataContext="{Binding DataContext, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Expander}}}"

                                                                     Grid.Column="0"

                                                                     Name="propertyListView"

                                                                     VirtualizingPanel.IsVirtualizing="True"

                                                                     VirtualizingPanel.IsContainerVirtualizable="True">

                                                    <Telerik:RadGridView.ContextMenu>

                                                        <ContextMenu>

                                                            <MenuItem Header="Edit"  Command="ApplicationCommands.Replace">

                                                                <MenuItem.Icon>

                                                                    <Image Source="..\Images\Edit.png" Height="15" Width="20" Margin="0,0,2,0" />

                                                                </MenuItem.Icon>

                                                            </MenuItem>

                                                        </ContextMenu>

                                                    </Telerik:RadGridView.ContextMenu>

                                                    <Telerik:RadGridView.CommandBindings>

                                                        <CommandBinding Command="Replace" CanExecute="CommandBinding_NewTripAlarms" Executed="CommandBinding_EditProperties" />

                                                    </Telerik:RadGridView.CommandBindings>

                                                    <Telerik:RadGridView.InputBindings>

                                                        <KeyBinding Command="Replace" Key="Enter" />

                                                    </Telerik:RadGridView.InputBindings>

                                                    <Telerik:RadGridView.Columns>

                                                        <Telerik:GridViewDataColumn IsReadOnly="True" IsGroupable="False" IsFilterable="False" Header="{DynamicResource Name}" DataMemberBinding="{Binding Path=ModelProperty.PropertyName}" />

                                                        <Telerik:GridViewDataColumn IsReadOnly="True" Header="{DynamicResource DataType}" DataMemberBinding="{Binding Path=ModelProperty.DataType.Name}" />

                                                        <Telerik:GridViewDataColumn IsReadOnly="True" IsGroupable="False" IsSortable="False" IsFilterable="False" Header="{DynamicResource Value}" DataMemberBinding="{Binding Path=Value}" />

                                                    </Telerik:RadGridView.Columns>

                                                </Telerik:RadGridView>

regards,
Maya
Telerik team
 answered on 10 Jul 2013
1 answer
69 views
I couldn't to change TimeRulerMonthViewItem.


Code snippets   below :

 <Window.Resources>
            <Style x:Key="TimeRulerMonthViewItemStyle" TargetType="telerik:TimeRulerMonthViewItem">
            <Setter Property="telerik:StyleManager.Theme" Value="Windows8"/>
            <Setter Property="ContentTemplate">
                <Setter.Value>
                    <DataTemplate>
                        <TextBlock Text="WhyCantChanged"/>
                    </DataTemplate>
                </Setter.Value>
            </Setter>
     </Style>
        <telerik:OrientedTimeRulerItemStyleSelector x:Key="Origin" 
                                                 MonthViewTickStyle="{StaticResource TimeRulerMonthViewItemStyle}"/>
    </Window.Resources>
<Grid>
        <telerik:RadScheduleView x:Name="ScheduleView"
                                  telerik:StyleManager.Theme="Windows8" TimeRulerItemStyleSelector="{StaticResource Origin}">
            <telerik:RadScheduleView.Resources>
                <Style TargetType="telerik:RadButton">
                    <Setter Property="ContentTemplate">
                        <Setter.Value>
                            <DataTemplate>
                                <TextBlock Text="I am Mark."/>
                            </DataTemplate>
                        </Setter.Value>
                    </Setter>
                </Style>
            </telerik:RadScheduleView.Resources>
            <telerik:RadScheduleView.ViewDefinitions >
                <telerik:MonthViewDefinition/>
            </telerik:RadScheduleView.ViewDefinitions>
        </telerik:RadScheduleView>
    </Grid>

It could not change  Content. Do I just have to setting its ControlTemplate ,Only one way? Why not setting ContentTemplate?


Kalin
Telerik team
 answered on 09 Jul 2013
2 answers
107 views
Hi there,

how do I integrate the documentation into VisualStudio 2012? I would like to be able to view the documentation offline and get quick access via the F1 key to the overview and espially to the API documenation.

E.g. I found the property Items of the RadTreeListView and would like to know more about it, e.g. the type.

Or by hitting F1 on RadTreeListView in the editor I'd like to see all properties, methods, events, ... of this control.

Actually, I even have a hard time finding it in the online help.

Thanks!

Jan
Rosen Vladimirov
Telerik team
 answered on 09 Jul 2013
7 answers
165 views
I setup a hierarchy template on my bound GridView. Inside of the hierarchy I have column footer to sum all the values. I have an event that fires in the background that updates the values inside the hierarchy template. However, the sum in the column footer of the hierarchy template does not update. I tried calling CalculateAggregates() on the GridView, but it doesn't seem to do anything for the hierarchy.
Dimitrina
Telerik team
 answered on 09 Jul 2013
1 answer
195 views
Hi,

I got a wpf application and i set it the Windows8 theme (default color blue).

In some point of the application i need to open a new RadWindow. I want that only this radwindow look like windows 8 not blue but orange, and the main window remain with the same windows8 blue theme.

something like the example image.

How can i achieve this?



best reagards.
Masha
Telerik team
 answered on 09 Jul 2013
3 answers
119 views
Hi,

We need to create a chart with multiple series. I created a RadCartesian chart which has a DateTimeCategoricalAxis as horizontal axis and a LinearAxis as vertical axis. For the series I use scatterpoint series.

<telerik:RadCartesianChart>
            <telerik:RadCartesianChart.HorizontalAxis>
                <telerik:DateTimeCategoricalAxis Title="Inspection Date" />
            </telerik:RadCartesianChart.HorizontalAxis>
            <telerik:RadCartesianChart.VerticalAxis>
                <telerik:LinearAxis LineThickness="1"
                                    Title="Value">
                </telerik:LinearAxis>
            </telerik:RadCartesianChart.VerticalAxis>
            <telerik:RadCartesianChart.Series>
                <telerik:ScatterPointSeries ItemsSource="{Binding Path=InspectionHistory}"
                                            PointTemplate="{StaticResource PointTemplate1}"
                                            XValueBinding="InspectionDate"
                                            YValueBinding="Value" />
                <telerik:ScatterPointSeries ItemsSource="{Binding Path=InspectionHistory}"
                                            PointTemplate="{StaticResource PointTemplate2}"
                                            XValueBinding="InspectionDate"
                                            YValueBinding="MinimalValue">
                </telerik:ScatterPointSeries>
            </telerik:RadCartesianChart.Series>
             
            <telerik:RadCartesianChart.Grid>
                <telerik:CartesianChartGrid MajorLinesVisibility="XY" />
            </telerik:RadCartesianChart.Grid>
        </telerik:RadCartesianChart>

Currently the chart does not show the scatter points. If I change the horizontal axis into a linearaxis and bind the X value to another property, the chart is drawn. Why doesnt it work with the DateTimeCategoricalAxis ?

I am using the 2013 Q1 control.

Kind regards,
Mike
Evgenia
Telerik team
 answered on 08 Jul 2013
1 answer
471 views

Hi,

Currently we are dealing with a Problem of a blocking UI-Thread during the Initial dataload of our RadGridView.
Instead of the blocking UI-Thread we would expect the "running" BusyIndicator!
(During different Grid-Opertions (like Paging, Sorting,...) the BusyIndicator is displayed correctly).

We are using Entity-Framework and since we are having a really complex query-logic we are working with IQueryable Sources.
We have tried to set the data through Dependency-Property-Binding and also tried it manually.
As we found in the web the IQueryable-Source should be the best solution for large amount of data - isn't it?

Here are our attempts:
1) Using an IQueryable Dependency-Property

public static readonly DependencyProperty QueryableSourceProperty =

DependencyProperty.Register("QueryableSource", typeof(IQueryable<Data.TransactionHistory>), typeof(MainWindow), new PropertyMetadata(default(IQueryable<Data.SalesOrderDetail>)));


..
// different conditions... for examp

qeryableSource = queryableSource.OrderBy(o => o.TransactionType);

 

..

ItemsSource="{Binding QueryableSource, ElementName=window}"

2) Setting the ItemsSource-Property of the grid manuelly to our IQueryable

this.radGridElement.ItemsSource = queryableSource;

3) Run all operations asynchronous with Task and Dispatcher

new Task(() => { this.loadData2(); }).Start();


...
Dispatcher.BeginInvoke(
new Action(() => { this.QueryableSource = queryableSource; }));
...

All these samples didn't work as expected.
What's the best solution to bind the Grid on an IQueryable source, so that everything works asynchronously and the BusyIndicator is displayed during the loading-time???

Hopefully you can provide us with a solution...
I can provide you a sample .net application if you send me an upload-link...

Best regards
 Jürgen

Vera
Telerik team
 answered on 08 Jul 2013
2 answers
152 views
Hi everybody,
how can I retrieve the documentposition of a certain Span (not the current where the caret is in). The background is: I need to move the caret to a specific Span when pushing the FastForward / FastRewind button of a microphone to easily dictat in a RadRichTextBox.

Here is what I have yet:

List<NamedPermissionRangeStart> allPermissionRangeStarts = Document.EnumerateChildrenOfType<NamedPermissionRangeStart>().SkipWhile(a => a.Type != "Text").ToList();
            NamedPermissionRangeStart cur = (NamedPermissionRangeStart)Document.CaretPosition.GetCurrentSpanBox().AssociatedSpan.PreviousSibling;
 
            for (int i = 0; i < allPermissionRangeStarts.Count; i++)
            {
                if (allPermissionRangeStarts[i].InternalKey == cur.InternalKey)
                {
                    Document.CaretPosition.MoveToPosition(((Span)allPermissionRangeStarts[i + 1].NextSibling).?????)
                    break;
                }
            }


I hoped to find something that gives me the DocumentPosition where the "???" are.
Is this approach the right one?

Thanks in advance
Jo
JoRoSch
Top achievements
Rank 1
 answered on 08 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
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?