Telerik Forums
UI for WPF Forum
1 answer
239 views

Hi there,

 

I have a Grid which is bound to an ObservableCollection<Record>.  This grid is using a custom GroupHeaderTemplate.  When I open the screen containing the grid whilst running with a VS2013 debugger attached, I see lots of exceptions being reported in the output window.  It also takes a long time (1-2 mins) to display the grid that used to display in a few seconds.  This exception is obviously happening on a background thread or being caught somewhere as it doesn't ever get displayed to the user or cause the application to crash.  I can turn on exception breaks in VS2013 when the exception is thrown and I can see details about it, but nothing that would point to a fix.  It appears to be happening as part of a layout pass.  The exception is...

 

System.InvalidCastException

Unable to cast object of type 'MyNamespace.Record' to type 'Telerik.Windows.Data.IGroup'.

CallStack:

    Telerik.Windows.Data.dll!Telerik.Windows.Data.FuncExtensions.ToUntypedFunc<Telerik.Windows.Data.IGroup,object>.AnonymousMethod__0(object item)    Unknown
     Telerik.Windows.Data.dll!Telerik.Windows.Data.KeyedCollection.GetKeyByItem(object value)    Unknown
     Telerik.Windows.Data.dll!Telerik.Windows.Data.KeyedCollection.AddRange(System.Collections.IEnumerable items)    Unknown
     Telerik.Windows.Data.dll!Telerik.Windows.Data.QueryableCollectionView.PopulateInternalList(System.Linq.IQueryable view)    Unknown
     Telerik.Windows.Data.dll!Telerik.Windows.Data.QueryableCollectionView.CreateInternalList()    Unknown
     Telerik.Windows.Data.dll!Telerik.Windows.Data.QueryableCollectionView.EnsureInternalList()    Unknown
     Telerik.Windows.Data.dll!Telerik.Windows.Data.QueryableCollectionView.InternalList.get()    Unknown
     Telerik.Windows.Data.dll!Telerik.Windows.Data.QueryableCollectionView.EnsureRootGroup()    Unknown
     Telerik.Windows.Data.dll!Telerik.Windows.Data.QueryableCollectionView.RootQCVGGroup.get()    Unknown
     Telerik.Windows.Controls.GridView.dll!Telerik.Windows.Controls.GridView.Rows.CalculateRowCount()    Unknown
     Telerik.Windows.Controls.GridView.dll!Telerik.Windows.Controls.GridView.GridViewVirtualizingPanel.FlatLayoutStrategy.CalculateAllRowsCount()    Unknown
     Telerik.Windows.Controls.GridView.dll!Telerik.Windows.Controls.GridView.GridViewVirtualizingPanel.FlatLayoutStrategy.EnsureIndexStorage()    Unknown
     Telerik.Windows.Controls.GridView.dll!Telerik.Windows.Controls.GridView.GridViewVirtualizingPanel.FlatLayoutStrategy.MeasureOverride(System.Windows.Size availableSize)    Unknown
     Telerik.Windows.Controls.GridView.dll!Telerik.Windows.Controls.GridView.GridViewVirtualizingPanel.MeasureOverride(System.Windows.Size availableSize)    Unknown
     PresentationFramework.dll!System.Windows.FrameworkElement.MeasureCore(System.Windows.Size availableSize)    Unknown
     PresentationCore.dll!System.Windows.UIElement.Measure(System.Windows.Size availableSize)    Unknown
     PresentationCore.dll!System.Windows.ContextLayoutManager.UpdateLayout()    Unknown
     PresentationCore.dll!System.Windows.ContextLayoutManager.UpdateLayoutCallback(object arg)    Unknown
     PresentationCore.dll!System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()    Unknown
     PresentationCore.dll!System.Windows.Media.MediaContext.RenderMessageHandlerCore(object resizedCompositionTarget)    Unknown
     PresentationCore.dll!System.Windows.Media.MediaContext.RenderMessageHandler(object resizedCompositionTarget)    Unknown
     WindowsBase.dll!System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate callback, object args, int numArgs)    Unknown
     WindowsBase.dll!MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(object source, System.Delegate method, object args, int numArgs, System.Delegate catchHandler)    Unknown
     WindowsBase.dll!System.Windows.Threading.DispatcherOperation.InvokeImpl()    Unknown
     mscorlib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx)    Unknown
     mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx)    Unknown
     mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state)    Unknown
     WindowsBase.dll!System.Windows.Threading.DispatcherOperation.Invoke()    Unknown
     WindowsBase.dll!System.Windows.Threading.Dispatcher.ProcessQueue()    Unknown
     WindowsBase.dll!System.Windows.Threading.Dispatcher.WndProcHook(System.IntPtr hwnd, int msg, System.IntPtr wParam, System.IntPtr lParam, ref bool handled)    Unknown
     WindowsBase.dll!MS.Win32.HwndWrapper.WndProc(System.IntPtr hwnd, int msg, System.IntPtr wParam, System.IntPtr lParam, ref bool handled)    Unknown
     WindowsBase.dll!MS.Win32.HwndSubclass.DispatcherCallbackOperation(object o)    Unknown
     WindowsBase.dll!System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate callback, object args, int numArgs)    Unknown
     WindowsBase.dll!MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(object source, System.Delegate method, object args, int numArgs, System.Delegate catchHandler)    Unknown
     WindowsBase.dll!System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority priority, System.TimeSpan timeout, System.Delegate method, object args, int numArgs)    Unknown
     WindowsBase.dll!MS.Win32.HwndSubclass.SubclassWndProc(System.IntPtr hwnd, int msg, System.IntPtr wParam, System.IntPtr lParam)    Unknown
     [Native to Managed Transition]    
     [Managed to Native Transition]    
     WindowsBase.dll!System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame frame)    Unknown
     PresentationFramework.dll!System.Windows.Application.RunInternal(System.Windows.Window window)    Unknown
     PresentationFramework.dll!System.Windows.Application.Run()    Unknown
     MyApplication.dll!MyApplication.MyApplicationView.Start() Line 57    C#
     MyApplication.dll!MyApplication.Modularity.MyBootstrapper.Run() Line 249    C#
     MyHost.exe!MyHost.MyStartup.Main() Line 63    C#

I'm running .Net 4.5 and Telerik 2015.1 noxaml binaries.

Any idea what could be causing this and if there's a simple fix?

Thanks

Russell

Dimitrina
Telerik team
 answered on 29 May 2015
2 answers
142 views

Hi,

I use Expression Dark theme with RadGridView and when the gridview is disabled, cells' border are hidden. I'm trying to display them anyway. I've been able to display vertical lines, but I can't find what to change to prevent hidding horizontal lines.

Thank you,

 Etienne

Etienne
Top achievements
Rank 1
 answered on 29 May 2015
1 answer
291 views

Hi,

 I need a ComboBox where

  1. The user can't select items with the mouse
  2. The user can't select items with the keyboard
  3. The MouseEnter and MouseLeave events still fire

I thought setting IsReadOnly to true would make the control readonly, but that doesnt seem to do anything? 

So far the only thing that gets close is the code below, but that seems to still allow keyboard selection to slip through about 1 in 3 tries despite the flag.

Is there a "real" way to do this? I mean one that is not so hacked and that works all the time?

The way the control looks is not much of an issue (e.g. IsEnabled = false is fine), but I do need the MouseEnter and MouseLeave events and the user should not be able to change the value in any way.

Regards,

Bayram

if (isReadOnly)
{
    c.MainComboBox.MaxDropDownHeight = 0;
    c.MainComboBox.CanKeyboardNavigationSelectItems = false;
}
else
{
    c.MainComboBox.MaxDropDownHeight = 300;
    c.MainComboBox.CanKeyboardNavigationSelectItems = true;
}
c.MainComboBox.IsReadOnly = isReadOnly;

Nasko
Telerik team
 answered on 29 May 2015
3 answers
204 views
We use the RadDatePicker in numerous places.  Sometimes direct and sometimes through a DataTemplate, but the problem is consistent.  We can TAB through the controls (including other telrik controls) but we cannot SHIFT+TAB (reverse tab) through the date controls.  It stops and highlights the date on the control and goes no further.

we are using 2014.2.729.45 for all controls.

below are some code samples:
01.<WrapPanel Grid.Row="3"
02.                     Grid.Column="1"
03.                     >
04.              <telerik:RadDatePicker SelectableDateEnd="{Binding LineItemEndDate}"
05.                                     SelectableDateStart="{Binding LineItemStartDate}"
06.                                     SelectedValue="{Binding GivenStartDate}"
07.                                     Style="{StaticResource TilePropertyDataRadDatePickerStyle}"
08.                                     />
09.              <ContentControl IsEnabled="{Binding IsStartDateInvalid}"
10.                              Style="{StaticResource ErrorAdorner}"
11.                              ToolTip="{Binding StartDateErrorMsg}"
12.                              />
13.          </WrapPanel>

And here is the Style

01.<Style x:Key="TilePropertyDataRadDatePickerStyle"
02.       TargetType="{x:Type telerik:RadDatePicker}"
03.       >
04.    <Setter Property="FontFamily" Value="{telerik:Windows8Resource ResourceKey=FontFamily}" />
05.    <Setter Property="FontSize" Value="{telerik:Windows8Resource ResourceKey=FontSize}" />
06.    <Setter Property="FontWeight" Value="Normal" />
07.    <Setter Property="IsTabStop" Value="True" />
08.    <Setter Property="Height" Value="{StaticResource TilePropertyHeight}" />
09.    <Setter Property="Foreground" Value="{StaticResource TilePropertyDataBrush}" />
10.    <Setter Property="Margin" Value="{StaticResource TilePropertyDataMargin}" />
11.    <Setter Property="VerticalAlignment" Value="Center" />
12.    <Setter Property="Width" Value="100" />
13.    <Setter Property="HorizontalAlignment" Value="Left" />
14.</Style>

I saw this used to be an issue, but was corrected back in 2012. not sure if bug was re0introduced or we have some piece of code "off".

thanks.

​
Nasko
Telerik team
 answered on 29 May 2015
1 answer
170 views
I am able to display row headers in pivots but is there a way to display column headers through Pivots
Polya
Telerik team
 answered on 29 May 2015
1 answer
95 views

Hello,

I am using version 2014.3.1202.40 in my application. I have discovered that if I change the font in the middle of a paragraph, add some text and then hit <Enter> to create a new paragraph, the new paragraph reverts to the font from the beginning of previous paragraph.  However, if I change the font at the beginning of a paragraph, add some text and create a new paragraph the new font is used for the new paragraph.

I have verified this behavior exists in a sample app provided by Telerik in another, unrelated forum post.

If I perform the same actions in MS Word, it preserves the font change going into the next paragraph. This is the behavior I would expect; that if I change the font, it will keep using that font until I change it again, regardless of whether I create a new paragraph.

Is this intended behavior?  Is there a property change I can make or another workaround to avoid this behavior?

 Thanks,

Peter

Peter
Top achievements
Rank 1
 answered on 28 May 2015
1 answer
190 views

Hello,

I am currently working on a behavior that enables bulk editing functionality for the gridview.  I have a working prototype that hooks into the CellEditEnded event.  It seems to be a little bit hacky though, involving getting the binding path (args.Cell.DataColumn.DataMemberBinding.Path.Path), separating that out into one (or more) PropertyInfo element, then walking that dependency chain back and calling the final propertyInfo.SetValue(rowItem, newData) for each edited item.

I looked at other alternatives to this and found that the GridViewCell has a Value property.  Instead of going the reflection route, I tried to iterate down the rows / cells and set the value using the GridViewCell.Value property.  This does not propigate back to the bound object though or update the visual state.

Is there a way to programmatically set cell values without going the reflection route and having to reconstruct the binding?

Stefan
Telerik team
 answered on 28 May 2015
2 answers
213 views

Hello,

 

Can someone tell how to set GridViewDataColumn width to Auto in C#. Below is the sample code.

GridViewDataColumn firstName= new GridViewDataColumn();

firstName.Header = "FirstName";

firstName.Width=  Auto ?  //something like this?

 

 

Thanks,

Nalini

 

 

 

 

 

Nalini
Top achievements
Rank 1
 answered on 28 May 2015
1 answer
137 views

Hello,
I'm working on an app for my internship and I have to make a save / load the content when we open and close the application and we click on the button "save" and "load".
I watch many times your example and I do a lot of research on google and the forum but I don't know and I have no idea how to do the GetPageContent() method.

I know this method is specific but I would like you to send me an example in C # so I can get an idea of method to follow to implement this method.

Thank you very much in advance

Jéhan

Nasko
Telerik team
 answered on 28 May 2015
2 answers
128 views

Hello,

I was wondering, is it possible to add a new document to the document host but don't immediately make that new document active/visible? To clarify, the behavior I'm looking for is like in Chrome, when you middle-click a link, it opens the link in a new tab, but doesn't switch to it, it just opens it in the background.

What I'm trying to do is allow users to quickly open multiple tabs. This is tough to do when you have to keep switching back to the original tab that triggers the new tabs.

Thanks,

Joel

JP
Top achievements
Rank 1
 answered on 28 May 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
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?