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
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
Hi,
I need a ComboBox where
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;
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
>
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
>
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
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?
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
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