Telerik Forums
UI for WPF Forum
1 answer
117 views
I have a requirement to generate columns once define column count on top of the grid, how can I achieve this, 
attached image file I depict the way I'm expecting this.
Kelum
Top achievements
Rank 2
 answered on 04 May 2017
2 answers
310 views

Hello,

I have a very simple piece of code to bind my RadMenu control to an ObservableList of Menus.

My xaml looks like this:

<telerik:RadMenu Name:"MainMenu" ItemsSource="{Binding Menus}"/>

This works fine. In order to display something more interesting, I can add:

<telerik:RadMenu Name:"MainMenu" ItemsSource="{Binding Menus}" DisplayMemberPath="Name" />

And I get the Name property of my Menus displayed.

Now I would like to get a step further as my Menu class has a SubMenus property so I try to play with RadMenuItem styling and this is where I get lost.

If I write simple code like this, that according to me should do the same as the DisplayMemberPath :

<telerik:RadMenu Name:"MainMenu" ItemsSource="{Binding Menus}" >

      <telerik:RadMenu.Resources>

            <Style TargetType="telerik:RadMenuItem">

                    <Setter Property="Header" Value="{Binding Name}"/>

            </Style>

       </telerik:RadMenu.Resources>

</telerik:RadMenu>

Nothing is displayed on my window when running the code. 

I have checked everything, I can see in my view that the Menu is created and the items inside, etc... but the RadMenus don't display.

As soon as I comment out the Style, menus are displayed. As everything else is straightforward in my code, I think I am missing something obvious but I can't find it. There is no error in debug for binding issues or else.

I use Telerik 2017.1.22.45.

Thanks for your feedback.

Alexandre
Top achievements
Rank 1
 answered on 04 May 2017
5 answers
308 views

Hello,

I'm using telerik control tools for WPF UI ver: 2015.1.0401.45

I have noticed that radlistbox has a huge memory leak. On replacing radlistbox with Microsoft listbox, memory leak does not occur.

I'm attaching the demo project (replace extension of file from  .jpg to .zip).

This project demonstrates the problem of memory leak. Actually the memory leak occurs on data binding

I've remarked the Microsoft listbox in xaml, so to prove my claim, just use Microsoft listbox instead  of radlistbox and see the difference in memory usage of the processes.

Do you have a patch to fix this issue ?

Thank you,

Alex

 

Kalin
Telerik team
 answered on 03 May 2017
1 answer
88 views
I have a Radar with Markers Graph and have the graph axis for the angular axis set from 0 to 360  (like a polar graph). However, I would like to rotate it where instead of a '0' on the top, it say 180, then 270 instead of 90, etc. Basically ad 180 degrees and flip it upside down. 
Stef
Telerik team
 answered on 03 May 2017
5 answers
767 views
I'm seeing an odd error with the grouping in the RadGridView. It's worth pointing out that the data is being displayed and grouped properly despite the error. However, I still want it resolved.

System.Windows.Data Error: 2 : Cannot find governing FrameworkElement or FrameworkContentElement for target element. BindingExpression:Path=Columns[ContactType]; DataItem=null; target element is 'ColumnGroupDescriptor' (HashCode=34214014); target property is 'Column' (type 'GridViewColumn')

Below is the relevant portion of my XAML. The extra columns have been elided as is the rest of the visual tree. I get the same problem if it's in different parts of the visual tree and even with just the one column.

​<telerik:RadGridView x:Name="ContactsGridView"
                        ItemsSource="{Binding Employee.Contacts}">
    <telerik:RadGridView.Columns>
        <telerik:GridViewComboBoxColumn Header="Type" UniqueName="TypeColumn"
                                        ItemsSource="{Binding ContactTypesView}"
                                        DataMemberBinding="{Binding ContactTypeId}"
                                        SelectedValueMemberPath="Id" DisplayMemberPath="TypeName"
                                        EditTriggers="CellClick" ShowColumnWhenGrouped="False" />
    </telerik:RadGridView.Columns>
    <telerik:RadGridView.GroupDescriptors>
        <telerik:ColumnGroupDescriptor Column="{Binding Columns[\TypeColumn\], ElementName=ContactsGridView}"
                                        SortDirection="Ascending" />
    </telerik:RadGridView.GroupDescriptors>
</telerik:RadGridView>

I have a style that governs the several grids in my window. Here is that XAML:

<Style TargetType="{x:Type telerik:RadGridView}">
    <Setter Property="BorderThickness" Value="0" />
    <Setter Property="GridLinesVisibility" Value="None" />
    <Setter Property="ShowGroupPanel" Value="False" />
    <Setter Property="RowIndicatorVisibility" Value="Collapsed" />
    <Setter Property="RowDetailsVisibilityMode" Value="Collapsed" />
    <Setter Property="AutoGenerateColumns" Value="False" />
    <Setter Property="CanUserFreezeColumns" Value="False" />
    <Setter Property="SelectionUnit" Value="FullRow" />
    <Setter Property="AutoExpandGroups" Value="True" />
    <Setter Property="GroupRenderMode" Value="Flat" />
</Style>

Any ideas of what might be causing this error? I created a stripped down solution and couldn't duplicate the error message.
Aliaster
Top achievements
Rank 1
 answered on 03 May 2017
11 answers
579 views
Hey, Guys
This tough to describe. In Brief, I want the RadDiagram has the circuit diagram feature like the attached picture. The certain connector can connect to line (or named as RadDiagram connection).  Is any approaching to this feature?

Thanks a lot, By William
Robert
Top achievements
Rank 1
 answered on 03 May 2017
4 answers
137 views

Dear Telerik,

I encountered pretty weird behavior  while using VirtualQueryableCollectionView+grid.

I have  a grid and a simple combobox for filtering. When I select a value in the combobox everything works as expected:

-- selected combobox value changed

-- handle property change event in the model

-- set collection total and reload required page

However if i click any cell I can see that virtual collection reloads ALL the pages. I attached a small repro u can play with.

Scenario 1: start the app - select a unit from the combobox - click any cell (e.g. top left cell) - check the output

Scenario 2: start the app - click the button - click any cell (e.g. top left cell) - check the output

-- 

Here is the xaml

 

<Window x:Class="WpfApplication1.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
        Title="MainWindow" Height="350" Width="525" WindowStartupLocation="CenterScreen">

<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />

</Grid.RowDefinitions>

<telerik:RadButton Content="reload" HorizontalAlignment="Left" Margin="2" Command="{Binding ReloadCommand}" />

<telerik:RadComboBox  ItemsSource="{Binding Units}" HorizontalAlignment="Right" Margin="2"
EmptyText="select unit" SelectedItem="{Binding Unit, Mode=TwoWay}"/>

<telerik:RadGridView  AutoGenerateColumns="False" ShowGroupPanel="False" 
ItemsSource="{Binding Data}" Grid.Row="1" IsReadOnly="True"  >
<telerik:RadGridView.Columns>

<telerik:GridViewDataColumn DataMemberBinding="{Binding RowNo}" Header="row no" />

</telerik:RadGridView.Columns>
</telerik:RadGridView>
</Grid>
</Window>

Here is the model

 

#region Usings
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Windows.Input;
using Telerik.Windows.Data;
#endregion

namespace WpfApplication1
{
public class Model
{
#region Class constants
private const int PAGE_SIZE = 100;
#endregion

#region Class members
private UnitType _unit;
protected VirtualQueryableCollectionView _data;
#endregion

#region Class properties
public IEnumerable<UnitType> Units
{
get
{
return Enum
.GetValues( typeof( UnitType ) )
.Cast<UnitType>()
.ToList();
}
}
public UnitType Unit 
{
get 
{
return _unit;
}
set 
{
_unit = value;

LoadHistory();
}
}
public VirtualQueryableCollectionView Data
{
get
{
return _data;
}
}
public CommandHandler ReloadCommand { get; set; }
#endregion

#region Class initialization
public Model() 
{
_data = new VirtualQueryableCollectionView()
{
LoadSize = 100
};

_data.ItemsLoading += ( o, ea ) => OnNeedDataPage( ea.StartIndex / _data.LoadSize );

ReloadCommand = new CommandHandler( x => LoadHistory(), true );
}
#endregion

#region Class event handlers
private void LoadHistory()
{
_data.ResetItems();
LoadHistory( 0 );
}
protected void OnNeedDataPage( int iPageIndex )
{

LoadHistory( iPageIndex );
}
private void LoadHistory( int iPageIndex )
{
var iTotalCount = 1000;
Debug.WriteLine( "load glass history page: " + iPageIndex );

if( iTotalCount != _data.VirtualItemCount )
{
_data.VirtualItemCount = iTotalCount;
}

int iStartIndex = iPageIndex * PAGE_SIZE;
var list = new List<TestData>();

for( int i = iPageIndex * PAGE_SIZE; i < iPageIndex * PAGE_SIZE + PAGE_SIZE; ++i )
{
list.Add( new TestData() { RowNo = i } );
}

_data.Load( iStartIndex, list );
}
#endregion

#region Class internal structs
public enum UnitType 
{
none,
a,
b
}
public class TestData
{
public int RowNo { get; set; }
}
#endregion
}

public class CommandHandler:ICommand
{
#region Class members
protected Action<object> _action;
protected bool _canExecute;
#endregion

#region Class events
public event EventHandler CanExecuteChanged;
public void FireCanExecuteChanged( bool b )
{
_canExecute = b;

if( null != CanExecuteChanged )
{
CanExecuteChanged( this, EventArgs.Empty );
}
}
#endregion

#region Class initialization
public CommandHandler( Action<object> action, bool canExecute )
{
_action = action;
_canExecute = canExecute;
}
#endregion

#region Class public methods
public bool CanExecute( object parameter )
{
return _canExecute;
}
public void Execute( object parameter )
{
_action( parameter );
}
#endregion
}
}

 

Stefan
Telerik team
 answered on 02 May 2017
6 answers
262 views
I'm getting null ref error when i move from one cell to another in a rad grid view. This started happening once i move from version from 2011.1.419.35 to 2011.2.920.40.

Steps to reproduce

Create a grid so that columns so that all columns are not visible.
Bind the a column to an int/decimal value (<telerik:GridViewDataColumn DataMemberBinding="{Binding Path=OrderUnits, Mode=TwoWay}" UniqueName="QuantityColumn" Header="Quantity" />)
enter edit mode in this column
scroll to the end of the grid view so that this column is out of view
scroll back to original location
tab out of edit.

Version - 2011.2.920.40
WPF4



Stack trace below.

   at Telerik.Windows.Controls.GridView.GridViewDataControl.RaiseDataErrorEvent(DataErrorEventArgs args)
   at Telerik.Windows.Controls.GridView.GridViewDataControl.CommitCurrentEdit(GridViewRow gridViewRow)
   at Telerik.Windows.Controls.GridView.GridViewDataControl.PerformRowEditEnded(GridViewCell currentCell)
   at Telerik.Windows.Controls.GridView.GridViewDataControl.CommitCellEdit(GridViewCell currentCell, Boolean isLeavingRow)
   at Telerik.Windows.Controls.GridView.GridViewDataControl.CommitEdit()
   at Telerik.Windows.Controls.GridView.GridViewDataControl.OnCommitEditCommand(Object sender, ExecutedRoutedEventArgs e)
   at System.Windows.Input.CommandBinding.OnExecuted(Object sender, ExecutedRoutedEventArgs e)
   at System.Windows.Input.CommandManager.ExecuteCommandBinding(Object sender, ExecutedRoutedEventArgs e, CommandBinding commandBinding)
   at System.Windows.Input.CommandManager.FindCommandBinding(CommandBindingCollection commandBindings, Object sender, RoutedEventArgs e, ICommand command, Boolean execute)
   at System.Windows.Input.CommandManager.FindCommandBinding(Object sender, RoutedEventArgs e, ICommand command, Boolean execute)
   at System.Windows.Input.CommandManager.OnExecuted(Object sender, ExecutedRoutedEventArgs e)
   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 System.Windows.Input.RoutedCommand.ExecuteImpl(Object parameter, IInputElement target, Boolean userInitiated)
   at Telerik.Windows.Controls.GridView.GridViewDataControl.ExecutePendingCommand()
   at Telerik.Windows.Controls.GridView.GridViewDataControl.PendAndExecuteCommands(KeyEventArgs e)
   at Telerik.Windows.Controls.GridView.GridViewDataControl.OnKeyDown(KeyEventArgs e)
   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 System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
   at System.Windows.Input.InputManager.ProcessStagingArea()
   at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
   at System.Windows.Interop.HwndKeyboardInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawKeyboardActions actions, Int32 scanCode, Boolean isExtendedKey, Boolean isSystemKey, Int32 virtualKey)
   at System.Windows.Interop.HwndKeyboardInputProvider.ProcessKeyAction(MSG& msg, Boolean& handled)
   at System.Windows.Interop.HwndSource.CriticalTranslateAccelerator(MSG& msg, ModifierKeys modifiers)
   at System.Windows.Interop.HwndSource.OnPreprocessMessage(Object param)
   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)
Robert
Top achievements
Rank 1
 answered on 02 May 2017
3 answers
199 views

Hello everyone,

I'm currently stucked with the following situation.

I'm generating via a ViewModel the shapes for my toolbox. This is done via a property binding.

01.Public ReadOnly Property CostCenterToolbox As ObservableCollection(Of DiagramGallery)
02.    Get
03.        Dim galleryCollection = New ObservableCollection(Of DiagramGallery)()
04.        Dim gallery As New DiagramGallery With {.Header = "Cost centers"}
05. 
06.        costCenterDataTable = ParameterProduction.Instance.Open_ParCostCenter
07.        For Each row As DataRow In costCenterDataTable
08.            Dim node = New WorkflowCostCenterNode With
09.                {
10.                    .Content = row.Item("costCenter") & vbCrLf & row.Item("Description"),
11.                    .TreeId= 0,
12.                    .ProcessId = 0,
13.                    .CostCenter = row.Item("costCenter"),
14.                    .Description = row.Item("Description")
15.                }
16.            gallery.Shapes.Add(node)
17.        Next
18.        galleryCollection.Add(gallery)
19. 
20.        Return galleryCollection
21.    End Get
22.End Property

On the right side of the toolbox there is my diagram, which initially loads an existing workflow.

Now the problem is, that when dragging a shape from the toolbox to the diagram the dropped shape doesn't have any information about the node properties I gave it (in this case TreeId, ProcessId, CostCenter, Description are all Nothing).
As the documentation says, I need to serialize my custom properties, so that the diagram recognizes them.
The initially loaded workflow to the diagram is done via a GraphSource, which works perfectly (with the same node properties from above). In the GraphSource class I have those SerializeNode and DeserializeNode methods overriden.
But for the toolbox the nodes aren't in a graph source but added directly to the gallery and then to the gallerycollection (see code snippet above).

This might be the problem.
Is it possible to create the nodes, add them to a graph source object and then add them to the toolbox gallery?

Otherwise, how can I achieve, that when dragging the shape (initially created with the node and custom properties) from the toolbox to my diagram, that the node behind the shape has the custom property values I've initially set. Maybe the node properties are already lost, when the shapes are loaded into the toolbox?

I've read the following documentations without success :-(
- http://docs.telerik.com/devtools/wpf/controls/raddiagram/howto/drag-custom-toolboxitem

- http://docs.telerik.com/devtools/wpf/controls/raddiagram/features/raddiagrams-serialization#manual-serializationdeserialization

- http://docs.telerik.com/devtools/wpf/controls/raddiagram/extensions/toolbox#how-to-populate-raddiagramtoolbox-with-custom-data-items

Any hints and maybe short examples are very welcome

Timon
Top achievements
Rank 1
 answered on 02 May 2017
1 answer
156 views
Hello guys,

I'm trying to get the points inside a polygon with an spatial query, the thing is that the points and the polygon are in the same SQL Table, I'm attaching a picture with the result of a Select Query (image attached) where you can see that the last 3 records are the polygons that contains points.

I've tried this with one point but it won't work because I need a list with the names of the polygons and the points inside of it in a spatial query.

        DECLARE @POI geography;  
        DECLARE @POLYGON geography;  
        SET @POI = (SELECT TOP 1 GEO FROM POI WHERE LAYERID <> 1026);
        SET @POLYGON = (SELECT TOP 1 GEO FROM POI WHERE LAYERID = 1026);
        SELECT @POLYGON.STContains(@POI);
Petar Mladenov
Telerik team
 answered on 02 May 2017
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
DataPager
PersistenceFramework
Styling
TimeBar
OutlookBar
TransitionControl
FileDialogs
Book
ToolBar
ColorPicker
TimePicker
MultiColumnComboBox
SyntaxEditor
VirtualGrid
NavigationView (Hamburger Menu)
Wizard
ExpressionEditor
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
Callout
PasswordBox
SplashScreen
Localization
Rating
Accessibility
CollectionNavigator
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?