Telerik Forums
UI for WPF Forum
1 answer
276 views

Hi,

I want to achieve a radgrid view with nested collection. The twist is binding should create a new column and not like row details.

E.g. My data looks like

List<class1> lstObj1 = new List<class1>();

public class1

{

public string name;

public string id;

public List<class2> objClass2List = new List<class2>();

}

public class2

{

public string sub1;

public string sub2;

}

 

View should be like as attached:

Stefan
Telerik team
 answered on 08 May 2017
18 answers
619 views

Hi, I've got a situation where I need a chart to create a new line series based on user selection (i.e., user selects 3 Employees from a list of 10 to compare, and then the chart will show 3 Line series, each corresponding to the respective employee's annual revenue to date). 

Most of the examples rely on code-behind to create a new SeriesMapping and then add it to the chart's list of mappings. I'm curious if there would be any declarative way to account for a varying number of Series on a chart, similar to a DataTemplate used for other controls. To bind the number of Series to a collection where each Series binds to a sub-collection.

Here's a grid I have working for just one series:

<telerik:RadChart Name="LapTimes" DataContext="{Binding SelectedEmployees}" ItemsSource="{Binding Employee.SalesList}">
      <telerik:RadChart.SeriesMappings>
          <telerik:SeriesMapping LegendLabel="Employee">
              <telerik:SeriesMapping.SeriesDefinition>
                  <telerik:LineSeriesDefinition ShowItemLabels="False">                                            
                  </telerik:LineSeriesDefinition>                                        
              </telerik:SeriesMapping.SeriesDefinition>
              <telerik:SeriesMapping.ItemMappings>
                  <telerik:ItemMapping FieldName="SalesNum" DataPointMember="XValue"/>
                  <telerik:ItemMapping FieldName="SalesValue" DataPointMember="YValue"/>
              </telerik:SeriesMapping.ItemMappings>
          </telerik:SeriesMapping>
      </telerik:RadChart.SeriesMappings>
  </telerik:RadChart>

SelectedEmployees is an ObservableCollection<Employee> and each Employee type has an ObservableCollection<Sale>.

That actually shows the first Employee in the collection just fine. But, how would I template my RadChart in a way that for each Employee in SelectedEmployees there's a Line Series using that Employee's Sales collection - without using code-behind?
Martin Ivanov
Telerik team
 answered on 08 May 2017
2 answers
191 views

I have some functionality that I would like to have included in every instance of RadGridView in my application. This is on two events, DistinctValuesLoading and FilterOperatorsLoading.

 

I tried adding them via EventSetters in a global Style ResourceDictionary, but I'm getting error saying that they are not Routed Events.

 

Is  there another way to do this, or do I need to just add the functionality manually to every instance?

Mark
Top achievements
Rank 1
 answered on 05 May 2017
1 answer
274 views

I have a setup that each row detail contains a child gridview, and when parent row is expanded, the child gridview should show all its rows, ie. no scrollbar because we don't want "double" scrollbars.

The issue is when the child gridview has many rows (in our case, 100), it takes a while (~6s) from expand the parent row to display all children rows.

Do you have any tips to speed up this scenario?

Stefan Nenchev
Telerik team
 answered on 05 May 2017
1 answer
140 views

I have a RadGridView with ItemsSource bound to a collection of business objects.  The grid has a GridViewDataColumn bound to a property with a TwoWay binding.  The property has a validation attribute.

When the user is editing the cell, and presses <Enter>, the validation attribute's IsValid() method is invoked, and if validation succeeds, the griid navigates to the same column in the next row.  But if validation fails, the failure is visualized and the navigation does not occur.  In fact, any attempt to navigate away from the cell by any means causes validation, and if the validation fails, the navigation does not occur.  This is all good, and exactly as it should be.  Anything less would be wrong -- what's the point of validation if it doesn't force the user to enter valid data?

But here's my problem.  I also want the down and up arrows to navigate up and down while editing.  Seems as if it should be straight forward -- just preview KeyDown, handle up and down keys and execute the grid's MoveUp and MoveDown commands, right?  Wrong.  When the grid's MoveUp or MoveDown command is executed, the validation attribute's IsValid() method is still invoked, but a failed validation does not prevent the navigation.

This seems like such a routine requirement that I feel like I must be missing something.  The reason for the existence of the MoveUp, MoveDown, etc., commands seems to be the recognition that navigation controls might need to be more robust that the default behaviors.  But those command circumventing validation appears to make them useless.  Surely I'm just missing something.

 

Stefan
Telerik team
 answered on 05 May 2017
1 answer
68 views

Hi,

since we don't need the TimeRuler of the WeekView in our project, I've hid it and set the Minor/MajorTickLengthes to "1day", so all appointments of that day appear in one big cell.

Problem is, that - since the appointments happen at the "same time", they appear next to- instead of below each other.

When I activate the AllDayArea, my Appointments show up below each other but I still have the big - formerly TimeRuler - area, which I can't get rid of.

Any Ideas?

Thanks

ITC
Top achievements
Rank 1
 answered on 05 May 2017
1 answer
184 views
Hello i want replace the 3 default buttons of the radform with  simple radbutton (add, edit, delete). I want to preserve the current functionaloties of the 3 buttons ( for example the enabled of the add button property when i click on edit) whay is the simpliest way to achieve that?
Stefan
Telerik team
 answered on 05 May 2017
3 answers
245 views
The default rotation behavior for all shapes on the diagram works around the center of the shape. I need to change this behavior to rotate around the top left corner of the shape/shapes. I need any sample code for this.
Tanya
Telerik team
 answered on 05 May 2017
1 answer
228 views

I have an issue using the RadialMenu with the GridView.

If I use the following code : 

<telerik:RadGridView x:Name="GridView"
                     adhoc:ColumnStackPanel.Column="2"
                     AutoGenerateColumns="False"
                     MaxHeight="300">
    <telerik:RadGridView.Resources>
        <Style TargetType="telerik:GridViewRow" BasedOn="{StaticResource {x:Type telerik:GridViewRow}}">
            <Setter Property="telerik:RadRadialMenu.RadialContextMenu">
                <Setter.Value>
                    <telerik:RadRadialMenu ShowEventName="GotFocus" HideEventName="LostFocus"
   
                                                                           StaysOpenOnShow="True"
                                   PopupPlacement="MousePoint">
                        <telerik:RadRadialMenuItem Header="Hello" />
                        <telerik:RadRadialMenuItem Header="World" />
                    </telerik:RadRadialMenu>
                </Setter.Value>
            </Setter>
        </Style>
    </telerik:RadGridView.Resources>
    <telerik:RadGridView.Columns>
        <telerik:GridViewDataColumn DataMemberBinding="{Binding Data1}" IsReadOnly="True" Header="Data1" />
    </telerik:RadGridView.Columns>
</telerik:RadGridView>

I will have a NullReferenceException with the following stacktrace if I scroll down and backward two time :

   at Telerik.Windows.Controls.RadRadialMenu.OnRadialContextMenuChanged(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.InvalidateProperty(DependencyProperty dp, Boolean preserveCurrentValue)
   at System.Windows.StyleHelper.InvalidateContainerDependents(DependencyObject container, FrugalStructList`1& exclusionContainerDependents, FrugalStructList`1& oldContainerDependents, FrugalStructList`1& newContainerDependents)
   at System.Windows.StyleHelper.DoStyleInvalidations(FrameworkElement fe, FrameworkContentElement fce, Style oldStyle, Style newStyle)
   at System.Windows.StyleHelper.UpdateStyleCache(FrameworkElement fe, FrameworkContentElement fce, Style oldStyle, Style newStyle, Style& styleCache)
   at System.Windows.FrameworkElement.OnStyleChanged(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.InvalidateProperty(DependencyProperty dp, Boolean preserveCurrentValue)
   at System.Windows.FrameworkElement.UpdateStyleProperty()
   at System.Windows.TreeWalkHelper.InvalidateOnTreeChange(FrameworkElement fe, FrameworkContentElement fce, DependencyObject parent, Boolean isAddOperation)
   at System.Windows.FrameworkElement.OnVisualParentChanged(DependencyObject oldParent)
   at System.Windows.Media.Visual.FireOnVisualParentChanged(DependencyObject oldParent)
   at System.Windows.Media.Visual.RemoveVisualChild(Visual child)
   at System.Windows.Media.VisualCollection.DisconnectChild(Int32 index)
   at System.Windows.Media.VisualCollection.InternalRemove(Visual visual)
   at System.Windows.Controls.UIElementCollection.RemoveInternal(UIElement element)
   at System.Windows.Controls.UIElementCollection.Remove(UIElement element)
   at Telerik.Windows.Controls.GridView.GridViewVirtualizingPanel.NestedLayoutStrategy.DisconnectRecycledContainers()
   at Telerik.Windows.Controls.GridView.GridViewVirtualizingPanel.NestedLayoutStrategy.MeasureOverride(Size constraint)
   at Telerik.Windows.Controls.GridView.GridViewVirtualizingPanel.MeasureOverride(Size availableSize)
   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.InvokeOnRenderCallback.DoWork()
   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.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.DispatcherOperation.InvokeImpl()
   at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
   at MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(Object obj)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at MS.Internal.CulturePreservingExecutionContext.Run(CulturePreservingExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Windows.Threading.DispatcherOperation.Invoke()
   at System.Windows.Threading.Dispatcher.ProcessQueue()
   at System.Windows.Threading.Dispatcher.WndProcHook(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 System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
   at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
   at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
   at System.Windows.Application.RunDispatcher(Object ignore)
   at System.Windows.Application.RunInternal(Window window)
   at System.Windows.Application.Run(Window window)
   at System.Windows.Application.Run()
   at Adhoc.ToolsWPF.Sample.App.Main()
   at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
   at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
   at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()

 

This is obviously caused by virtualisation.

I tried to set the RadialMenu as ContextMenu directly in the RadGridView managing the ItemsSource of the RadialMenu with the selecteditem of the RadGridView but I have another issue where the RadialMenu will show and hide if the show event occure while the selected row change.

Nasko
Telerik team
 answered on 05 May 2017
2 answers
104 views

Hi,

the scrollbar doesn't appear in the filtercontrol whan I have a lot of distinct items in a gridview.

I use the Windows8Touch theme without customization.

Any idea ?

Thanks

Julien
Top achievements
Rank 1
 answered on 05 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?