Telerik Forums
UI for WPF Forum
1 answer
99 views

This was reported by a user, so it could be a Windows issue.

The user says it was not doing this a month ago. We generate a template file for the user to fill. After saving they upload/import and it used to work OK.  Sometime over the last few weeks, users started to get the "File in use" error.

Google is of no use as it only brings back "file in use when trying to delete it" results.

Any ideas?

Is there an option that can be set in code to avoid this?

Nikolay Demirev
Telerik team
 answered on 02 Dec 2022
1 answer
147 views

I have a grid where some rows have a sub grid.  If the user clicks the row's toggle button, it shows the grid.

The problem happens if the user does anything on the page to show a modal. We do this by adding our dialog view to the outer region, then blocking. As soon as the block is called you can see it drops all columns of the grid but the first. The grid remains that way after you close the dialog. This is not limited to this view, I have found other places where we have a GridView in a row and it behaves the same when a modal is shown.

You can see this in the attachments.

Any help would be appreciated.

EDIT: added snippet showing dialog open

Ken
Top achievements
Rank 1
Iron
 answered on 01 Dec 2022
1 answer
283 views

Hi,

I tried to use RadSyntaxEditor with MVVM approach but I did not succeed.

I followed all tips you gave on the forum but it still doesn't respond to all my needs.

I try to create a custom dependency property and bound my textdocument (located in my view model) in it but the dependency property got the radsyntaxeditor object and not TextDocument or content in TextDocument.

With this solution I was able to initialize the value of the document in RadSyntaxEditor but the callback method was not able to capture modification in the content of the document. So when I do modificaton, I wasn't able to applied them in my TextDocument in VM.

Finally I use events DataContextChange to init and DocumentChangeContent to update mine but it's not MVVM approach...

Do you have some advice for me to succeed in the MVVM approach ?

Stenly
Telerik team
 answered on 01 Dec 2022
1 answer
203 views

Hi Telerik support team,

I’m strugling with filtering a special case in the wpf gridview. Let me explain..

 I’ve a mainViewModel with an ObservebleCollection of type SubViewModel. Each subViewModel is a row in the grid. In the subViewModel I’ve a float property which is bound to a column through a valueConverter. The float (a representation of millimeters in the metric system) gets converted to inches in the imperial system. Inches can contain characters which are not supported by float (like /, - etc.) That’s why I use a converter to change it into a string. The converter works correct, also the convert back. I get a correct float value setted in my subViewModel.

The issue I walk into is when I filter the column. The filter mechanism seems to set a value in a fieldFilterControlViewModel and I get an error when I filter.

Can I change this behaviour? I would be nice that the filtervalue gets through the convertBack first and then apply the filter. So a converter on the filter inputvalue. Or, filtering directly on the showed values in the grid would also be ok.

Please help me out of this.

Regards,

Daniel

Error:

System.Windows.Data Error: 8 : Cannot save value from target back to source. BindingExpression:Path=Value; DataItem='FieldFilterControlViewModel' (HashCode=31636323); target element is 'TextBox' (Name=''); target property is 'Text' (type 'String') FormatException:'System.FormatException: Input value was not in a correct format.

   at Telerik.Windows.Controls.GridView.FieldFilterControlViewModel.set_Value(Object value)'
Martin Ivanov
Telerik team
 answered on 01 Dec 2022
1 answer
129 views

Hello Telerik team,

I`ve faced an issue with GridView. Once when I resize the column it throws NullReferenceException with the following stack trace

   at Telerik.Windows.Controls.GridView.GridViewHeaderCell.HeaderToResize(Object gripper)
   at Telerik.Windows.Controls.GridView.GridViewHeaderCell.OnColumnHeaderResize(Object sender, DragDeltaEventArgs e)
   at System.Windows.Controls.Primitives.DragDeltaEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)
   at System.Windows.Controls.Primitives.Thumb.OnMouseMove(MouseEventArgs e)
   at System.Windows.UIElement.OnMouseMoveThunk(Object sender, MouseEventArgs e)
   at System.Windows.Input.MouseEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   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.Input.InputProviderSite.ReportInput(InputReport inputReport)
   at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
   at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at System.Windows.Interop.HwndSource.InputFilterMessage(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.Threading.Dispatcher.Run()
   at System.Windows.Application.RunDispatcher(Object ignore)
   at System.Windows.Application.RunInternal(Window window)
   at System.Windows.Application.Run()
   at WpfApp1.App.Main()

Here is an example project to help you to reproduce this issue.

Steps to reproduce:

  1. Resize the "Phone" column to increase its size, do it far outside of the application window
  2. Resize the "Comments" column to increase its size, do it far outside of the application window
  3. Resize the "Description" column to increase its size, do it far outside of the application window
  4. Resize the "Name" column to increase its size, do it far outside of the application window

And at some moment the application should throw NullReferenceException.

Please look at this one or let me know if I did something wrong.

Martin Ivanov
Telerik team
 answered on 29 Nov 2022
1 answer
357 views

Hello,

I created the ColumnsVisibility attached property to the RadGridView.

When the user clicks the columns' header, I open a context menu that shows all the columns.

Then the user can show/hide the columns by updating the IsVisible property. I am interested to add a button to the left of the first columns header.

The new button will open the Context Menu instead of clicking the Column Header.

I need this functionality because if the users hides all the colums, then there is no header and he will not able to open the menu at all, which means the columns visibilty can't be restored.

I can't attach the property to the RadGridView itself because I have another menu there.

A better solution may be to add this attached property to another style of a control part in the RadGridView template.

I am wondering if there is another control in your template (under the GridViewColumnHeader).

 

At the end I need to open a context menu in the top of the RadGridView but in parallel to open a different ContextMenu when the user clicks and empty space in the rest of the RadGridView (middle/bottom).

Martin Ivanov
Telerik team
 answered on 25 Nov 2022
1 answer
149 views

We are looking to migrate to latest telerik ui for wpf. Could you please suggest on compatibility of framework with .net version.

currently we use .Net framework 4.6.2.

Stenly
Telerik team
 answered on 25 Nov 2022
1 answer
152 views

I would like to create a custom "control" that is a subclass of "RadTabItem" and use it as the default tab class.

I know I can tie into the AddingNewTab event and effect the Item property of the event args, but that would be a UI Element in the ViewModel (VM) of a MVVM and I would like to keep the UI element strictly in the UI code (not in the VM).

Is there some way to specify (perhaps via .Resources) the class for a new tab created by clicking the "+" in the RadTabbedWindow.

e.g.  something like the a "DefaultTab" element.

          <DefaultTab Type="{x:Type MyTabClass}"/>

of the below


<telerik:RadTabbedWindow x:Class="PickCart.Client.Zza.Desktop.Tabs.TabbedView" 
                         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"
                         xmlns:client="clr-namespace:PickCart.Client"
                         xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
                         Width="1024"
                         Height="800">
    <b:Interaction.Triggers>
        <b:EventTrigger EventName="AddingNewTab">
            <b:CallMethodAction TargetObject="{Binding}" MethodName="OnAddingNewTab"/>
        </b:EventTrigger>
    </b:Interaction.Triggers>
    <telerik:RadTabbedWindow.DataContext>
        <client:TabbedViewModel/>
    </telerik:RadTabbedWindow.DataContext>
    <telerik:RadTabbedWindow.Resources>
          <DefaultTab Type="{x:Type MyTabClass}"/>
    </telerik:RadTabbedWindow.Resources>
    <telerik:RadTabItem Header="Main" CloseButtonVisibility="Hidden">
        <TextBlock Text="This is the main tab" />
    </telerik:RadTabItem>
</telerik:RadTabbedWindow>

Dilyan Traykov
Telerik team
 answered on 24 Nov 2022
1 answer
157 views

In our app.xaml.cs we have been using this.MainWindow = new MyMainWindow().

We are trying to switch to a RadTabbedWindow, but RadTabbedWindow is not a Window, it is a UserControl.  What would be a way to use this and keep the this.MainWIndow?

WPF TabbedWindow - Getting Started - Telerik UI for WPF

Dilyan Traykov
Telerik team
 answered on 24 Nov 2022
0 answers
165 views

Hello,

In our application, we need to add header to each pages when exporting the grid(RadGridView) into the workbook using ExportToWorkBook
I tried to use the option mentioned in "https://docs.telerik.com/devtools/document-processing/libraries/radspreadprocessing/features/headers-and-footers#headerfootersection" to fix this, but it is not work as expected.

Please see the attached image of our requirement and provide information on how to achieve this ?

Thanks in advance.



Monica
Top achievements
Rank 1
 asked on 24 Nov 2022
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?