Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all 18858 articles
Browse latest View live

Datagrid datepicker!?

$
0
0

Hi!

I have a grid and i will bring in there a datpicker...

So far so good...

But i become the datepicker not in the grid (can't see)...

Here is my code:

<DataGridTemplateColumn Header="Spalte2" MinWidth="10" CanUserSort="True" x:Name="SP002"><DataGridTemplateColumn.CellEditingTemplate><DataTemplate><DatePicker SelectedDate="{Binding GrSpalte02, Mode=TwoWay}" /></DataTemplate></DataGridTemplateColumn.CellEditingTemplate></DataGridTemplateColumn>

If i fill GrSpalte with any date eg. "01.01.2014" the datepicker will not Show!?

What is wrong?

Best regrads

Bernd


How to apply ShaderEffect to Visual?

$
0
0

Is there a way to apply a ShaderEffect derived effect to a Visual (DrawingVisual to be exact).  I've been assigning a DropShadowBitMapEffect to DrawingVisual's BitMapEffect property, BUT I know it's been depreciated.  I can only find a way to apply a ShaderEffect to UIElement which is unfortunately below Visual in the class hierarchy.

Am I missing something?  Will Visual eventually support ShaderEffects? 

Custom Dashed Lines

$
0
0

What I would like to do is to create a custom dash style to applied to a line, etc... For example, instead of the standard dash, I could have arrows.

I've looked at some of the other threads around here and haven't found them tremendously helpful.

I know some how this is possible, but I don't know what needs to be done in order to do this, so any help is appreciated.

I should also note, I am doing this in code behind (vb.net/C# (vb preferred, but I can translate)) and not XAML.

Thanks in Advance.

H264 codec to compare timestamp of two videos

$
0
0

Hello,

In my WPF application, i want to load two videos (format h264 codec). I want to know how i can compare time stamp of two videos and show them in parallel one below the other. I guess each frame should have a time stamp which we can use here. Can sometime help to get the timestamp and then compare two videos.

Thanks in advance,

IamHuM

how to use Drawingvisual in wpf?

$
0
0

i have a screen that shows thousands of points and refresh rate is 10 ms. first i had problem because rendering was slow and jittery. i searched internet people suggest me to convert shapes to visual because shapes have a lot of events and is heavy to render. i changed the points to visuals like this:

publicclassMyVisualHost:FrameworkElement{// Create a collection of child visual objects. privateVisualCollection _children;publicMyVisualHost(){
    _children =newVisualCollection(this);...}// Provide a required override for the VisualChildrenCount property. protectedoverrideintVisualChildrenCount{get{return _children.Count;}}// Provide a required override for the GetVisualChild method. protectedoverrideVisualGetVisualChild(int index){if(index <0|| index >= _children.Count){thrownewArgumentOutOfRangeException();}return _children[index];}}

the performance still is not acceptable. the question is what is the difference between shapes and FrameworkElement. both have lots of events that make them heavy to render. i want something that doesnt have events. what can i do?!

actually i want to add these visuals to canvas and give them their positions using canvas.setLeft and canvas.setTop. how to do this without inheriting from FrameworkElement?

wpf - unclick dataGrid row

$
0
0
Hi all, aI have a little problem ... I have a dataGrid and few data in .. when I click on some row ... its data show in textBoxes ... BUT ... when I clear this texBoxes and I try to click on same row in dataGrid ... nothing happen .. so I can't click on same row again ... I am not sure if you understand what I want to do ... so if any questions ... thanks

VB Marshal size problem

$
0
0

Hi!

I become back the error that the size of my Array is to big...

How can i fit it?

Here is the Array with the Problem:

<StructLayout(LayoutKind.Sequential)> Public Structure VBSATZFREITEXTSUCHE

        ' *******************************************************************************************************
        ' Such Tabelle (max. 100 Spalten)
        <MarshalAs(UnmanagedType.ByValArray, SizeConst:=100)> Public SuchArray() As WPFStandardSuchTabelle<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=10)> Public SuchAnzahl As String<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=81)> Public SuchHinweis As String<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=10)> Public SuchNummer1 As String<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=257)> Public SuchKopf1 As String<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=257)> Public SuchKopf2 As String<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=257)> Public SuchKopf3 As String<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=257)> Public SuchKopf4 As String<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=257)> Public SuchKopf5 As String<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=257)> Public SuchKopf6 As String<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=257)> Public SuchKopf7 As String<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=257)> Public SuchKopf8 As String<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=257)> Public SuchKopf9 As String<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=257)> Public SuchKopf10 As String<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=257)> Public SuchKopf11 As String<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=257)> Public SuchKopf12 As String<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=257)> Public SuchKopf13 As String<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=257)> Public SuchKopf14 As String<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=257)> Public SuchKopf15 As String<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=257)> Public SuchKopf16 As String<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=257)> Public SuchKopf17 As String<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=257)> Public SuchDatei As String

        ' *******************************************************************************************************

    End Structure


    ' *******************************************************************************************************
    ' Such-Tabelle mit Feldlänge
    <StructLayout(LayoutKind.Sequential)> Public Structure WPFStandardSuchTabelle<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=101)> Public SuchWas As String<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=11)> Public SuchAufDatum As String<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=2)> Public SuchFehlerKZ As String<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=257)> Public SuchBeschreibung As String<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=257)> Public SuchImage As String<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=27)> Public SuchMitarbeiter As String<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=11)> Public SuchErledigenBisDatum As String<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=2)> Public SuchErledigtKZ As String<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=11)> Public SuchErledigtDatum As String<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=257)> Public SuchWasGemacht As String<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=31)> Public SuchText9 As String<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=31)> Public SuchText10 As String<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=31)> Public SuchText11 As String<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=31)> Public SuchText12 As String<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=31)> Public SuchText13 As String<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=31)> Public SuchText14 As String<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=31)> Public SuchText15 As String
    End Structure

Now the Call...

    Declare Function QSLISTECALL Lib "QSLISTE.dll" (ByRef VBSATZ1 As VBSATZ01, ByRef VBSATZ4 As VBSATZFREITEXTSUCHE) As Integer
           CblStatus = QSLISTECALL(VBSATZ001, VBSATZFreitextSuche)

Have anyone an idea without cutting fields?

Best Regards

Bernd

move canvas with animation from left to right problem

$
0
0
Dim AnimationDefinitionLeft As New Animation.DoubleAnimation(-100, 100, New Duration(TimeSpan.FromMilliseconds(Duration)), Animation.FillBehavior.Stop)
    Dim ID3 As String = CreateNewID()
    NewElement.RegisterName(ID3, CurrentElement)
    System.Windows.Media.Animation.Storyboard.SetTargetName(AnimationDefinitionLeft, ID3)
    System.Windows.Media.Animation.Storyboard.SetTargetProperty(AnimationDefinitionLeft, New PropertyPath(Canvas.LeftProperty))
    StoryBoardAnimator.Children.Add(AnimationDefinitionLeft)

When using this code to move a canvas from left to right it does not work.

I get a warning 6,

System.Windows.Media.Animation Warning: 6 : Unable to perform action because the specified Storyboard was never applied to this object for interactive control.; Action='Remove'; Storyboard='System.Windows.Media.Animation.Storyboard'; Storyboard.HashCode='1453241'; Storyboard.Type='System.Windows.Media.Animation.Storyboard'; TargetElement='System.Windows.Controls.Canvas'; TargetElement.HashCode='59582920'; TargetElement.Type='System.Windows.Controls.Canvas'

What am I doing wrong here?


OpenFileDialog return command line argument

$
0
0

I have one application having command line argument.

Want to open it using OpenFileDialog but not getting proper targetpath of application with command line argument.

can anybody tell me how to get it?

Regards,

Cauveri.

Add scrollbar to RibbonComboBox

$
0
0

Hi,

I'm implementing an application in C# in Visual Studio 2010 and I'm desinging a WPF-Ribbon-Application in.

My problem is this: I have a RibbonComboBox that contains a list of more than hundred elements and I would like to have a scrollbar.
What ways are there to solve this?

I hope you can help me

Map two coordinate system points in one

$
0
0

Hi.

Here is situation.

I have canvas on WPF. e.g. (0,0) -> (200,200)

And i have other coordinate system 2 e.g. (50,50) -> (300,300)

How can i map point from coordinate system 2 to canvas?

I mean if system 2 have point 125,125 (middle) on canvas it should appear 100,100 (also in middle)

Probably should have same behavior like CoordinateMapper in Microsoft.Kinect

Can someone give me some tips, how to map that point?

Thanks.

XAML definition order affects line shape visibility on startup

$
0
0

I have the following XAML definition:

<Window x:Class="canvas_line.MainWindow"        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"        xmlns:local="clr-namespace:canvas_line"        Title="MainWindow" Height="284" Width="228">    <Canvas Name="canvas">        <local:show_line />        <Line Name="my_line" Stroke="Blue"

X1="50" Y1="40" X2="50" Y2="80" StrokeThickness="4" />    </Canvas></Window>



When run, the Line shape is not initially shown, but is displayed when the application window is resized:


Now, if the order of the definitions inside the canvas element are changed, the problem is fixed:

        <Line Name="my_line" Stroke="Blue" X1="50" Y1="40" X2="50" Y2="80" StrokeThickness="4" />        <local:show_line />


Why is this, any ideas?

The project can be downloaded from here:

anonfiles.com/file/18c6edce296927b43ed0b0d595574a80

(The project has minimum amount of code to demo the problem.)  I am using Windows 7, VS 2010, .NET 4.0 Client Profile.  Thanks so much.






Strange application crashes when printing WPF elements

$
0
0

Hi all

I have a WPF application that displays some diagramms. These diagramms are build of hundrets of WPF dlements. When the user wants to print out the diagrams they are build again in memory and are converted to XPS. The XPS gets sent to the printer. This works all fine.
But on Windows 7 x64 I get randomly and very often one of the following 4 Errors:

1."SelectClipRgn failed". After this message the application crashes and it is not possible to catch the exception in code or while Debugging.

2."Win32Exception: The handle is invalid". This exception is seldom but can be catched in code. So the application doesn't crash instantly.

3."{Int32 Polygon(Microsoft.Internal.GDIExporter.GdiSafeDCHandle, Microsoft.Internal.GDIExporter.PointI*, Int32)}" or similar. Followed by the following stack trace:

-2147467259

   bei Microsoft.Internal.GDIExporter.CNativeMethods.Polygon(GdiSafeDCHandle hdc, PointI* pPoints, Int32 nCount)
   bei Microsoft.Internal.GDIExporter.CGDIDevice.Polygon(PointI[] pPoints, Int32 offset, Int32 nCount)
   bei Microsoft.Internal.GDIExporter.CGDIPath.Fill(CGDIDevice dc, GdiSafeHandle brush)
   bei Microsoft.Internal.GDIExporter.CGDIRenderTarget.FillPath(GeometryProxy geometry, Brush pFillBrush)
   bei Microsoft.Internal.GDIExporter.CGDIRenderTarget.DrawGeometry(Brush brush, Pen pen, Brush strokeBrush, Geometry geometry)
   bei Microsoft.Internal.AlphaFlattener.BrushProxyDecomposer.Microsoft.Internal.AlphaFlattener.IProxyDrawingContext.DrawGeometry(BrushProxy brush, PenProxy pen, Geometry geometry, Geometry clip, Matrix brushTrans, ProxyDrawingFlags flags)
   bei Microsoft.Internal.AlphaFlattener.PrimitiveRenderer.DrawGeometry(Geometry cur, String desp, GeometryPrimitive gp)
   bei Microsoft.Internal.AlphaFlattener.Flattener.AlphaRender(Primitive primitive, List`1 overlapping, Int32 overlapHasTransparency, Boolean disjoint, String desp)
   bei Microsoft.Internal.AlphaFlattener.Flattener.AlphaFlatten(IProxyDrawingContext dc, Boolean disjoint)
   bei Microsoft.Internal.AlphaFlattener.Flattener.Convert(Primitive tree, ILegacyDevice dc, Double width, Double height, Double dpix, Double dpiy, Nullable`1 quality)
   bei Microsoft.Internal.AlphaFlattener.MetroToGdiConverter.FlushPage()
   bei System.Windows.Xps.Serialization.NgcSerializationManager.EndPage()
   bei System.Windows.Xps.Serialization.NgcDocumentPageSerializer.SerializeObject(Object serializedObject)
   bei System.Windows.Xps.Serialization.NgcDocumentPaginatorSerializer.SerializeObject(Object serializedObject)
   bei System.Windows.Xps.Serialization.NgcSerializationManager.SaveAsXaml(Object serializedObject)
   bei System.Windows.Xps.XpsDocumentWriter.SaveAsXaml(Object serializedObject, Boolean isSync)
   bei System.Windows.Controls.PrintDialog.PrintDocument(DocumentPaginator documentPaginator, String description)
   bei MyCompany.MyApp.Commands.UI.PrintPatientAnalysisViewCommand.Execute(Object parameter) in c:\tfs\MyApp\MyApp_Main\MyApp\Commands\UI\PrintPatientAnalysisViewCommand.cs:Zeile 142.

4. This is the most occuring problem but it is also absolutely random. At first it seems that everything went fine. No app crashes or errors at all. But when you look at the printed page or the generated PDF (PDF Printer) it has not been printed completely. It seems as the Printer only received an incomplete version of the document. Some times only the first few inches get printed, some times the hole document but the footer. An sometimes every thing is ok.

When using Windows 8 everything works just fine.

Has any one already had a similar or even the same Problem or can someone give me a hint how to solve ist?

Thanks and regard
Thomas


Thomas Flückiger Flückiger Informatik http://www.f-in.ch


WPF Complex Validation

$
0
0

Ok, so I have a WPF Application (using MVVM) consisting of a View that has two textboxes: First Name and Last Name.

Both of them must consist of only letters. I've achieved that by using attributes on the corresponding entity (Worker):

[RegularExpression(@"^[a-zA-Z]+$",ErrorMessage="First Name must consist of letters only.")]publicstringFirstName[RegularExpression(@"^[a-zA-Z]+$",ErrorMessage="Last Name must consist of letters only.")]publicstringLastName

And it works great. But...I also need to have the following validation rule: At least one of the fields: FirstName or LastName Must be filled.

Any ideas on how to implement validation involving two fields?

The expected result is: If non of the fields is filled, then a validation msg will appear beside the FirstName textbox: At least first name or last name must be filled. The same message will also appear near the the last name textbox. Once I fill one of those fields, Both messages will disppear.

Another challenge, is that if I enter a digit in first name textbox, I want an error message only on the First name textbox: First Name must consist of letters only. And I want the error of at least one of the fields must be filled (near both of the textboxes) to dissapear.

Thanks!

Problem in Using SolidColorBrush as Attached Dependency Property

$
0
0

Hi

I want to create a custom attached property which is of type Solid brush color.

But while running i am having error as 

{"Object of type 'System.Windows.Media.SolidColorBrush' cannot be converted to type 'System.Windows.DependencyPropertyChangedEventArgs'."}

My code is:

<ComboBox><Helper:ColorHelper.InnerTextColorProp><SolidColorBrush Color="White"/></Helper:ColorHelper.InnerTextColorProp> </ComboBox>

And Class is:

public class ColorHelper
    {
        public static DependencyProperty InnerTextColorProp =
            DependencyProperty.RegisterAttached("InnerTextColor",
            typeof(SolidColorBrush), typeof(ColorHelper), new PropertyMetadata(new SolidColorBrush(Colors.White),
                new PropertyChangedCallback(IsInnerTextColorPropChanged)));


        public static SolidColorBrush GetInnerTextColorProp(DependencyObject obj)
        {
            ComboBox target = obj as ComboBox;
            return (SolidColorBrush)target.GetValue(InnerTextColorProp);
        }

        public static void SetInnerTextColorProp(DependencyObject obj, DependencyPropertyChangedEventArgs e)
        {
            ComboBox target = obj as ComboBox;
            target.SetValue(InnerTextColorProp, (SolidColorBrush)(e.NewValue));
        }

        public static void IsInnerTextColorPropChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e)
        {
            ComboBox target = obj as ComboBox;
            target.SetValue(InnerTextColorProp, (SolidColorBrush)(e.NewValue));
        }

    }


May i know , How to make it work?

Thanks in advance.


NANDAKUMAR.T



How to create dynamic data show on Chart in WPF/C# Application ?

$
0
0

Hi All,

        I want to develop a Chart application in WPF/C# my requirement is i want to dynamic data show(any type of data) CHART in WPf . How it's possible in WPF/C#

Thanks

Aniruddha


A.Acharya Feedback to us Develop and promote your apps in Windows Store Please remember to mark the replies as answers if they help and unmark them if they provide no help.

Using Multiple Dispatchers in WPF

$
0
0

We have an application which has multiple dispatchers running, each running in a different thread. Each dispatcher has its own UI.  It appears to work, but every once in a while the application locks up. When we look at the dump, it appears some of the UI threads are deep in PresentationFramework/PresendationCore /WindowBase calls, with none of our code in the call stack. They seem to be processing UI Resource logic (ex. GeometryDrawing.get_Brush in one dispatcher thread, and GeometryDrawing.BrushPropertyChanged on another). My question is: Is it safe to have multiple dispatchers, each accessing the same WPF resources simultaneously? Is it thread safe, or could this be the cause of our lockups?

Thanks

Dan

WPF + PRISM and Dynamic region

$
0
0

Dear all,

I need to get you though on a customer complex project I have to build.

In traditional WPF project I have done so far , I define the layout interface of the application by predefining grid area where I will insert different content.

Now I have a customer request project, where my customer would like to get a complete flexible application. By complete flexible application, my customer would like to be able to define by him self the area on the screen where Visual component will be place.

For that I have been guide from a previous post to explore "Composite UI" mechanism that PRISM can be provide . By exploring how flexible design need to be implemented, we need to define region area, and then map those region with a component.

That seems to be too simple for my customer. To add more stress on this, my customer would like to be able to define the Region area by himself with a tool, then decide what to insert in the define region.

For that, we have define a Grid layout on paper which looks as below :

Each small square in this grid represent the smallest area which is a 96 by 96 pixels size. Then the whole grid represent a ful HD resolution.

Starting from that grid we can use it as a canvas to place on that grid where we want to place our region.

For instance if my user want to place a button in top left corner of which as a Width of 192 and Height of 96, he will draw the region starting from Top corner of the grid which will occupy 2 cell of 96px in with and 1 cell of 96px in height.

Then once the region area is defined, my customer will select a component from a library button that he would like to attached to that predefined region.

So at the end we should have a kind of configuration file, which could be in XML formt with the following sample mapping :

RegionName ="Button1"; Colomn=0; Row=0; ColSpan=2 MapToView=ButtonView

Then once the customer as define all his region on the screen and map to a component (View), the configuration layout file is store somewhere, available to the client application.

Then the WPF client application, should then read that config file and build out of this the final layout dynamically. And of course all logic is plugged automatically between each component.

The more I think on this, and the more I think my customer would like to build a light version of Blend :-(

I need your though about this approach :

- how do you see the way to build the confutation tool for designing region area ?

- What could be the sample structure of the resulting XML configuration file ?

- Do you see any issue on building the final layout from client application side ?

Thanks for your advise and help on this as I start to be completely lost and need to be sure that all this will work fine or should work fine.

regards

serge

Transfer data Between two Usercontrol inside of Mainwindows

$
0
0

Goal:
The input data that is located inside of the textbox(usercontrol_menu.xaml) shall be transferred and then to be used and displayed in the label inside of usercontrol_number1.xaml. The transportation of the input data will be executed when you have pressed the button "enter" or clicked on the button "Send" inside of usercontrol_menu.xaml.

Problem:
Do you have a concrete example combined on my source code in order to achieve the goal?

Information:
- MainWindows.xaml is located in a separated project.

XAML

-- MainWindow.xaml

<Window
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:usercontrol_menu="clr-namespace:usercontrol_menu;assembly=usercontrol_menu" xmlns:usercontrol_number1="clr-namespace:usercontrol_number1;assembly=usercontrol_number1" x:Class="MainWindows.MainWindow"
        Title="MainWindow" Height="350" Width="525"><Grid><usercontrol_menu:UserControl1 HorizontalAlignment="Left" VerticalAlignment="Top" Height="124" Width="434" Margin="24,28,0,0"/><usercontrol_number1:UserControl1 HorizontalAlignment="Left" Margin="24,176,0,0" VerticalAlignment="Top" Height="115" Width="434"/></Grid></Window>



-- usercontrol_menu         UserControl1.xaml

<UserControl x:Class="usercontrol_menu.UserControl1"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300"><Grid Background="#FFF3CBCB"><Button x:Name="btn_send" Content="Send" HorizontalAlignment="Left" Margin="99,100,0,0" VerticalAlignment="Top" Width="75"/><TextBox x:Name="txt_input" HorizontalAlignment="Left" Height="23" Margin="54,57,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="120"/></Grid></UserControl>



-- usercontrol_number1         UserControl1.xaml

<UserControl x:Class="usercontrol_number1.UserControl1"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300"><Grid Background="#FFFF9D9D"><Label x:Name="lbl_text" Content="Text" HorizontalAlignment="Left" Margin="31,44,0,0" VerticalAlignment="Top"/></Grid></UserControl>

How to catch a Delete event on a datagrid

$
0
0

I have a datagrid that binds to a List<TimeRecord>.

When updating or inserting a record I use the datagrid event called RowEditEnding to update my database by calling a method on my viewmodel. But I cant find any events getting fired when I press the Delete button and the row is removed.

What is the correct approach here? Is it bad to bind to a list?

PS: CollectionViews are so incredible slow that I ruled that out. Besides I dont think that would solve my problem since that one does not have a Delete event either.

Viewing all 18858 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>