Telerik Forums
UI for WPF Forum
2 answers
355 views

Hello,
I want to bind the DataObject.Pasting event of a TextBox with the EventToCommandBehavior to a command of the viewmodel:

<TextBox Grid.Column="3"
         HorizontalContentAlignment="Left" 
         Text="{Binding Offset, UpdateSourceTrigger=PropertyChanged}"
         VerticalContentAlignment="Center">
    <telerik:EventToCommandBehavior.EventBindings>
        <telerik:EventBinding Command="{Binding OffsetPastingCommand}" EventName="DataObject.Pasting" PassEventArgsToCommand="True"/>
    </telerik:EventToCommandBehavior.EventBindings>
</TextBox>

However, in the example above, the message "DataObject.Pasting event cannot be found" appears. What is the right way to bind the pasting event?
Thanks a lot
Christoph

Christoph
Top achievements
Rank 1
 answered on 20 Aug 2020
15 answers
1.1K+ views

Hi,

 

When I drop a GridView on a new window, I get an exception, and the designer shows the following error. How do I avoid this?

 System.MissingMethodException
Method not found: 'Telerik.Windows.Controls.ActionOnLostFocus Telerik.Windows.Controls.GridView.GridViewDataControl.get_ActionOnLostFocus()'.
   at Telerik.Windows.Controls.GridView.Design.GridViewDataControlMetadata.AddCommonCategoryAttributes(AttributeCallbackBuilder builder)
   at Telerik.Windows.Controls.GridView.Design.GridViewDataControlMetadata.<.ctor>b__0(AttributeCallbackBuilder b)
   at MS.Internal.Metadata.MutableAttributeTable.ExpandAttributes(Type type, AttributeList attributes)
   at MS.Internal.Metadata.MutableAttributeTable.GetExpandedAttributes(Type type, Object callbackParam, GetAttributesCallback callback)
   at MS.Internal.Metadata.MutableAttributeTable.GetCustomAttributes(Type type)
   at Microsoft.Windows.Design.Metadata.AttributeTable.GetCustomAttributes(Type type)
   at Microsoft.VisualStudio.DesignTools.Platform.Metadata.MetadataStore.<GetAttributes>d__25.MoveNext()
   at Microsoft.VisualStudio.DesignTools.Platform.Metadata.TypeUtilities.<MergeAttributesIterator>d__9.MoveNext()
   at Microsoft.VisualStudio.DesignTools.Platform.Metadata.TypeUtilities.GetAttributes(MemberInfo memberInfo, Type attributeType, Boolean checkBaseTypes, IPlatformMetadata platformMetadata, Func`3 canContinueCheckingBaseTypes)
   at Microsoft.VisualStudio.DesignTools.Platform.Metadata.TypeUtilities.GetAttributes(Type type, IPlatformMetadata platformMetadata)
   at Microsoft.VisualStudio.DesignTools.Platform.Metadata.ProjectContextType.get_Attributes()
   at Microsoft.VisualStudio.DesignTools.Platform.Metadata.TypeUtilities.IsTypeSupported(ITypeResolver typeResolver, ITypeId typeId)
   at Microsoft.VisualStudio.DesignTools.Designer.Tools.GenericControlTool.get_IsVisible()
   at Microsoft.VisualStudio.DesignTools.Designer.Tools.GenericControlTool.GetExtensibleEquivalent()
   at Microsoft.VisualStudio.DesignTools.Designer.ViewModel.Extensibility.ExtensibilityManager.ToolManager_ActiveToolChanged(Object sender, ToolEventArgs e)
   at Microsoft.VisualStudio.DesignTools.Designer.Tools.ToolEventHandler.Invoke(Object sender, ToolEventArgs e)
   at Microsoft.VisualStudio.DesignTools.Designer.Tools.ToolManager.OnActiveToolChanged(ToolEventArgs e)
   at Microsoft.VisualStudio.DesignTools.Designer.Tools.ToolManager.set_ActiveTool(Tool value)
   at Microsoft.VisualStudio.DesignTools.Designer.Tools.ToolManager.UpdateHostTool()
   at Microsoft.VisualStudio.DesignTools.Designer.Tools.ToolManager.HostToolService_ActiveToolChanged(Object sender, EventArgs e)
   at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.Remoting.LocalEvent`2.<>c__DisplayClass11_0.<Invoke>b__0()
   at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.Remoting.STAMarshaler.Call.InvokeWorker()
   at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.Remoting.STAMarshaler.Call.Invoke(Boolean waitingInExternalCall)
   at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.Remoting.STAMarshaler.InvokeCall(Call call)
   at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.Remoting.STAMarshaler.ProcessQueue(CallQueue queue)
   at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.Remoting.STAMarshaler.ProcessInboundQueue(Int32 identity)
   at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.Remoting.STAMarshaler.ProcessMessage(Int32 msg, IntPtr wParam, IntPtr lParam, Boolean elevatedQuery, Boolean& handled)
   at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.Remoting.STAMarshaler.OnWindowMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.Remoting.MessageOnlyHwndWrapper.WndProc(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 Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.DesignerProcess.RunApplication()
   at Microsoft.VisualStudio.DesignTools.DesignerContract.Isolation.DesignerProcess.<>c__DisplayClass5_0.<Main>b__0()
   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()

 

My project is a C# WPF application targeting .NET 4.5.2

My system configuration is:

Windows 10 Enterprise
Telerik UI for WPF 2015.3.1104.45

Microsoft Visual Studio Enterprise 2015
Version 14.0.24720.00 Update 1
Microsoft .NET Framework
Version 4.6.01038

Installed Version: Enterprise

Architecture and Modeling Tools   00322-80000-00000-AA045
Microsoft Architecture and Modeling Tools
    
UML® and Unified Modeling Language™ are trademarks or registered trademarks of the Object Management Group, Inc. in the United States and other countries.

Visual Basic 2015   00322-80000-00000-AA045
Microsoft Visual Basic 2015

Visual C# 2015   00322-80000-00000-AA045
Microsoft Visual C# 2015

Visual C++ 2015   00322-80000-00000-AA045
Microsoft Visual C++ 2015

Visual F# 2015   00322-80000-00000-AA045
Microsoft Visual F# 2015

.NET Reflector Visual Studio Extension   9.0.1.318
Integrates .NET Reflector into Visual Studio to allow you to seamlessly debug into third-party code and assemblies, even if you don't have the source code for them.

Visit www.reflector.net for more information.

Copyright (c) 2009-2012 Red Gate Software Inc.

ASP.NET and Web Tools 2015 (RC1 Update 1)   14.1.11120.0
ASP.NET and Web Tools 2015 (RC1 Update 1)

ASP.NET Web Frameworks and Tools 2012.2   4.1.41102.0
For additional information, visit http://go.microsoft.com/fwlink/?LinkID=309563

ASP.NET Web Frameworks and Tools 2013   5.2.30624.0
For additional information, visit http://www.asp.net/

Azure App Service Tools v2.8.1   14.0.11123.0
Azure App Service Tools v2.8.1

Common Azure Tools   1.7
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

DataFactoryProject   1.0
Microsoft Data Factory Package

GhostDoc   5.0.15325.0
GhostDoc automatically generates XML documentation comments.

GitHub.VisualStudio   1.0
A Visual Studio Extension that brings the GitHub Flow into Visual Studio.

JetBrains ReSharper Ultimate 10.0.2   Build 104.0.20151218.120627
JetBrains ReSharper Ultimate package for Microsoft Visual Studio. For more information about ReSharper Ultimate, visit http://www.jetbrains.com/resharper. Copyright © 2016 JetBrains, Inc.

Microsoft Azure Data Factory Node Node   1.0
Azure Data Factory extension for Visual Studio Server Explorer.

Microsoft Azure HDInsight HQL Service   2.0.2900.0
Language service for Hive query

Microsoft Azure HDInsight Tools for Visual Studio   2.0.2900.0
An integrated development environment for HDInsight application development.

Microsoft Azure Mobile Services Tools   1.4
Microsoft Azure Mobile Services Tools

Microsoft Azure Tools   2.8
Microsoft Azure Tools for Microsoft Visual Studio 2015 - v2.8.31121.1

NuGet Package Manager   3.3.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

Office Developer Tools for Visual Studio 2015 ENU   14.0.23025
Microsoft Office Developer Tools for Visual Studio 2015 ENU

PreEmptive Analytics Visualizer   1.2
Microsoft Visual Studio extension to visualize aggregated summaries from the PreEmptive Analytics product.

SQL Server Data Tools   14.0.50730.0
Microsoft SQL Server Data Tools

Telerik ASP.NET MVC VSExtensions   2016.1.111.0
Telerik UI for ASP.NET MVC VSExtensions

Telerik DataAccess VSExtensions   2015.5.1030.0
Telerik DataAccess VSExtensions

Telerik Reporting   
For more information please visit http://www.telerik.com/reporting. Copyright © 2005–2016 Telerik AD

Telerik WinForms VSExtensions   2016.1.111.0
Telerik UI for WinForms VSExtensions

Telerik WPF VSExtensions   2016.1.111.0
Telerik UI for WPF VSExtensions

TypeScript   1.7.4.0
TypeScript for Microsoft Visual Studio

Visual Studio Tools for Universal Windows Apps   14.0.24720.00
The Visual Studio Tools for Universal Windows apps allow you to build a single universal app experience that can reach every device running Windows 10: phone, tablet, PC, and more. It includes the Microsoft Windows 10 Software Development Kit.

Web Essentials 2015   1.0.203
Adds many useful features to Visual Studio for web developers.

Workflow Manager Tools 1.0   1.0
This package contains the necessary Visual Studio integration components for Workflow Manager.

Flemming
Top achievements
Rank 1
Veteran
 answered on 19 Aug 2020
2 answers
1.3K+ views
I can't seem to find how to get the parent grid of a cell or row.  Is this possible? How?

Why?
I found a decent way to be able to deselect rows while maintaining the ability to shift select a range of rows (can't do that with any of the default modes).

I don't want to hard code the grid name below (myGrid in this case):

EventManager.RegisterClassHandler(typeof(GridViewCell), MouseDownEvent, new MouseButtonEventHandler(GridViewRowOnMouseRightButtonDown));
 
void GridViewRowOnMouseRightButtonDown(object sender, MouseButtonEventArgs e)
        {
            if (myGrid.SelectedItems.Count == 1)
            {
                GridViewCell cell = sender as GridViewCell;
                GridViewRow cellRow = cell.ParentRow as GridViewRow;
                if (cellRow.IsSelected && cellRow.IsValid)
                {
                    cellRow.IsSelected = false;
                    e.Handled = true;
                }
                else
                {
                    return;
                }
            }
        }
Binshidha
Top achievements
Rank 1
 answered on 19 Aug 2020
20 answers
956 views
I just upgraded from Q1 SP2 to Q2 SP1 and I noticed that when I select a cell I get an annoying border around it (Just the selected cell). After looking through some other complaints about it here I found a xaml which removes the border but when I press TAB or ALT it's still there. I tried to set all colors to alpha but it's still there. How to remove all additional cell selection/focus borders completely, I don't want it to appear ever. Please note that I don't want to remove the outer borders of the cells but the additional inner border for a cell select.

On another note, how can I set the GridView to go to the next row on TAB instead of the next cell, I'm not interested in any cell, just the rows (Hence I also don't want the selected cell border).

Thanks!
Dinko | Tech Support Engineer
Telerik team
 answered on 19 Aug 2020
1 answer
176 views

Hello , I'm trying package"Telerik.UI.for.Wpf.NetCore.Xaml.Trial" v2020.2.617, when I start to learn chartview,The VisualStudio can't build the project.

Here's the message:

"D:\Work\CSharp\PersonalProject\TelerikDemo\TelerikWpfApp1\TelerikWpfApp1\MainWindow.xaml(79,22): error MC3074: XML 命名空间“http://schemas.telerik.com/2008/xaml/presentation”中不存在标记“AreaSeries.DataPoints”。 行 79 位置 22."

Please give me a hand.

 

 

Chen
Top achievements
Rank 1
 answered on 19 Aug 2020
4 answers
1.0K+ views
Currently i am having some UI styling question with regards with RadGridView.
Whenever i click on any cells in RadGridView. Seem like there is a focus border around the cell. Is that possible to get rid of it?

Dilyan Traykov
Telerik team
 answered on 18 Aug 2020
1 answer
115 views

Hello,

 

I have some kind of selection problem.

 

Drag selection didn't work at items outside the viewport.

 

Attach an image that can help you understand the content.

 

When there are 5 items and they are long enough to be out of viewport, drag them from the top to the bottom to select only the items in viewport and not the items outside.

 

However, a full selection is made through a full selection command, such as ctrl+a.

 

How do I select items outside of viewport? Is there any other way but to be selected on the behind code?

Dinko | Tech Support Engineer
Telerik team
 answered on 18 Aug 2020
3 answers
132 views

I have a GridView and I am using a CellStyleSelector to set the background color of different cells depending on some conditions and it is working fine.

Now I would like to be able to select a row and change the background color of the whole row, right now it is only working on the cells that are not using the CellStyleSelector.

I have seen that I can change the color of the selected row, like this:

<Style TargetType="telerik:GridViewRow">
            <Setter Property="SelectedBackground" Value="LightGray"/>
            <Setter Property="MouseOverBackground" Value="DarkGray" />
</Style>

 

But how can also be changed on cells with CellStyleSelector?

Dilyan Traykov
Telerik team
 answered on 18 Aug 2020
9 answers
1.1K+ views

Hello,

I have a RadWindow with 5 buttons, with only one or two of them visible at a given time. I would like, for example, that the Escape keyboard key has the Close action when in view mode and the Cancel Changes action when in edit mode.

To do this I use the tk:RadWindow.ResponseButton="Cancel" attribute for both buttons.

The problem is that the RadWindow logic is to look for the first button with this attribute and simulate a Click event on this button. I suggest that you make a small change to this behavior, to look for the first visible and enabled button with this attribute. By Visible, I mean with the Visibillty property set to Visible.

I know that I can process the Escape key myself, but why reinvent the wheel?

Best regards

Martin Ivanov
Telerik team
 answered on 18 Aug 2020
1 answer
481 views

Goo day.

How can I trigger the Add New Row on the DataGrid using a separate button. Are there any sample program available for this?

I also need to have a Button to trigger Edit and Delete of a selected row.

Thank you.

Vladimir Stoyanov
Telerik team
 answered on 18 Aug 2020
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?