Problém s DataGridem v WPF aplikaci   zodpovězená otázka

VB.NET, WPF

Zdravím,

zasekl jsem se na celkem zajímavém programu a nevím kudy kam.

Z hlavního okna zavolám druhé okno jako dialog

        Dim dlgKlient As New dlgKlient
        With dlgKlient
            .NovyKlienti = True
            Try
                If .ShowDialog = True Then
                    ' Seřadí tabulku
                End If

            Catch ex As Exception
                Chyba(ex, TraceEventType.Error, "Při přidávání klientů došlo k chybě:")

            End Try
        End With

V tom novém okně mám Datagrid a tlačítko Uložit.

Když se datagridu ani nedotknu a zmáčknu rovnou tlačítko Uložit je vše OK.

Pokud ale do datagridu do libovolné buňky vložím hodnotu a zmáčknu tlačítko Uložit okamžitě aplikace vyvolá chybu:

An unhandled exception of type 'System.ArgumentNullException' occurred in PresentationFramework.dll

Additional information: Key cannot be null.

Výpis StackTrace:

 	PresentationFramework.dll!System.Windows.Window.ShowDialog() + 0x2ed bytes	
>	eKlient.exe!eKlient.MainWindow.btnPridatKlienta_Click(Object sender, System.Windows.RoutedEventArgs e) Line 248 + 0x1a bytes	Basic
 	PresentationCore.dll!System.Windows.RoutedEventHandlerInfo.InvokeHandler(object target, System.Windows.RoutedEventArgs routedEventArgs) + 0x7a bytes	
 	PresentationCore.dll!System.Windows.EventRoute.InvokeHandlersImpl(object source, System.Windows.RoutedEventArgs args, bool reRaised) + 0x1a8 bytes	
 	PresentationCore.dll!System.Windows.UIElement.RaiseEventImpl(System.Windows.DependencyObject sender, System.Windows.RoutedEventArgs args) + 0x73 bytes	
 	PresentationCore.dll!System.Windows.UIElement.RaiseEvent(System.Windows.RoutedEventArgs e) + 0x29 bytes	
 	PresentationFramework.dll!System.Windows.Controls.Primitives.ButtonBase.OnClick() + 0x3b bytes	
 	PresentationFramework.dll!System.Windows.Controls.Button.OnClick() + 0x45 bytes	
 	PresentationFramework.dll!System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(System.Windows.Input.MouseButtonEventArgs e) + 0x84 bytes	
 	PresentationCore.dll!System.Windows.UIElement.OnMouseLeftButtonUpThunk(object sender, System.Windows.Input.MouseButtonEventArgs e) + 0x59 bytes	
 	PresentationCore.dll!System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(System.Delegate genericHandler, object genericTarget) + 0x2c bytes	
 	PresentationCore.dll!System.Windows.RoutedEventArgs.InvokeHandler(System.Delegate handler, object target) + 0x33 bytes	
 	PresentationCore.dll!System.Windows.RoutedEventHandlerInfo.InvokeHandler(object target, System.Windows.RoutedEventArgs routedEventArgs) + 0x44 bytes	
 	PresentationCore.dll!System.Windows.EventRoute.InvokeHandlersImpl(object source, System.Windows.RoutedEventArgs args, bool reRaised) + 0x1a8 bytes	
 	PresentationCore.dll!System.Windows.UIElement.ReRaiseEventAs(System.Windows.DependencyObject sender, System.Windows.RoutedEventArgs args, System.Windows.RoutedEvent newEvent) + 0x108 bytes	
 	PresentationCore.dll!System.Windows.UIElement.OnMouseUpThunk(object sender, System.Windows.Input.MouseButtonEventArgs e) + 0xc7 bytes	
 	PresentationCore.dll!System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(System.Delegate genericHandler, object genericTarget) + 0x2c bytes	
 	PresentationCore.dll!System.Windows.RoutedEventArgs.InvokeHandler(System.Delegate handler, object target) + 0x33 bytes	
 	PresentationCore.dll!System.Windows.RoutedEventHandlerInfo.InvokeHandler(object target, System.Windows.RoutedEventArgs routedEventArgs) + 0x44 bytes	
 	PresentationCore.dll!System.Windows.EventRoute.InvokeHandlersImpl(object source, System.Windows.RoutedEventArgs args, bool reRaised) + 0x1a8 bytes	
 	PresentationCore.dll!System.Windows.UIElement.RaiseEventImpl(System.Windows.DependencyObject sender, System.Windows.RoutedEventArgs args) + 0x73 bytes	
 	PresentationCore.dll!System.Windows.UIElement.RaiseTrustedEvent(System.Windows.RoutedEventArgs args) + 0x3d bytes	
 	PresentationCore.dll!System.Windows.UIElement.RaiseEvent(System.Windows.RoutedEventArgs args, bool trusted) + 0x40 bytes	
 	PresentationCore.dll!System.Windows.Input.InputManager.ProcessStagingArea() + 0x1f8 bytes	
 	PresentationCore.dll!System.Windows.Input.InputManager.ProcessInput(System.Windows.Input.InputEventArgs input) + 0x45 bytes	
 	PresentationCore.dll!System.Windows.Input.InputProviderSite.ReportInput(System.Windows.Input.InputReport inputReport) + 0x62 bytes	
 	PresentationCore.dll!System.Windows.Interop.HwndMouseInputProvider.ReportInput(System.IntPtr hwnd, System.Windows.Input.InputMode mode, int timestamp, System.Windows.Input.RawMouseActions actions, int x, int y, int wheel) + 0x272 bytes	
 	PresentationCore.dll!System.Windows.Interop.HwndMouseInputProvider.FilterMessage(System.IntPtr hwnd, MS.Internal.Interop.WindowMessage msg, System.IntPtr wParam, System.IntPtr lParam, ref bool handled) + 0x3f4 bytes	
 	PresentationCore.dll!System.Windows.Interop.HwndSource.InputFilterMessage(System.IntPtr hwnd, int msg, System.IntPtr wParam, System.IntPtr lParam, ref bool handled) + 0x6c bytes	
 	WindowsBase.dll!MS.Win32.HwndWrapper.WndProc(System.IntPtr hwnd, int msg, System.IntPtr wParam, System.IntPtr lParam, ref bool handled) + 0x9b bytes	
 	WindowsBase.dll!MS.Win32.HwndSubclass.DispatcherCallbackOperation(object o) + 0x6b bytes	
 	WindowsBase.dll!System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate callback, object args, int numArgs) + 0x56 bytes	
 	WindowsBase.dll!MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(object source, System.Delegate method, object args, int numArgs, System.Delegate catchHandler) + 0x3a bytes	
 	WindowsBase.dll!System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority priority, System.TimeSpan timeout, System.Delegate method, object args, int numArgs) + 0x10e bytes	
 	WindowsBase.dll!MS.Win32.HwndSubclass.SubclassWndProc(System.IntPtr hwnd, int msg, System.IntPtr wParam, System.IntPtr lParam) + 0xf1 bytes	
 	[Native to Managed Transition]	
 	[Managed to Native Transition]	
 	WindowsBase.dll!System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame frame) + 0xae bytes	
 	WindowsBase.dll!System.Windows.Threading.Dispatcher.PushFrame(System.Windows.Threading.DispatcherFrame frame) + 0x49 bytes	
 	WindowsBase.dll!System.Windows.Threading.Dispatcher.Run() + 0x4b bytes	
 	PresentationFramework.dll!System.Windows.Application.RunDispatcher(object ignore) + 0x17 bytes	
 	PresentationFramework.dll!System.Windows.Application.RunInternal(System.Windows.Window window) + 0x6f bytes	
 	PresentationFramework.dll!System.Windows.Application.Run(System.Windows.Window window) + 0x26 bytes	
 	PresentationFramework.dll!System.Windows.Application.Run() + 0x1b bytes	
 	eKlient.exe!eKlient.Application.Main() Line 77 + 0xa bytes	Basic
 	[Native to Managed Transition]	
 	[Managed to Native Transition]	
 	mscorlib.dll!System.AppDomain.nExecuteAssembly(System.Reflection.RuntimeAssembly assembly, string[] args) + 0x9 bytes	
 	mscorlib.dll!System.Runtime.Hosting.ManifestRunner.Run(bool checkAptModel) + 0x6f bytes	
 	mscorlib.dll!System.Runtime.Hosting.ManifestRunner.ExecuteAsAssembly() + 0x90 bytes	
 	mscorlib.dll!System.Runtime.Hosting.ApplicationActivator.CreateInstance(System.ActivationContext activationContext, string[] activationCustomData) + 0x65 bytes	
 	mscorlib.dll!System.Runtime.Hosting.ApplicationActivator.CreateInstance(System.ActivationContext activationContext) + 0xd bytes	
 	mscorlib.dll!System.Activator.CreateInstance(System.ActivationContext activationContext) + 0x44 bytes	
 	Microsoft.VisualStudio.HostingProcess.Utilities.dll!Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssemblyDebugInZone() + 0x20 bytes	
 	mscorlib.dll!System.Threading.ThreadHelper.ThreadStart_Context(object state) + 0x6f bytes	
 	mscorlib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) + 0xa7 bytes	
 	mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) + 0x16 bytes	
 	mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state) + 0x41 bytes	
 	mscorlib.dll!System.Threading.ThreadHelper.ThreadStart() + 0x44 bytes	
 	[Native to Managed Transition]	

Podle té chyby to spadne na řádku If .ShowDialog = True Then, ale nedokážu pochopit proč. Když tam nechám TRY jak je v kódu nahoře hlášení zní: Key cannot be null. Parameter name: key

Dokáže mě někdo nakopnout kde mám chybu?

Stejně tak k této chybě dojde i když místo tlačítko Uložit kliknu na zavřít okno kde pouze posílam me.DialogResult = false

Jakmile prostě změním cokoliv v tom datagridu spadne to?

Hledám už dlouho na Google a nemůžu nic najít.

Díky moc za pomoc Martin

nahlásit spamnahlásit spam 0 odpovědětodpovědět

hoď sem xaml toho data gridu a napiš způsob jakým do něj dostáváš data.

nahlásit spamnahlásit spam 0 odpovědětodpovědět

Přesně tak, kód volání dialogu není vůbec důležitý, potřebujeme vidět kód toho vlastního dialogu a hlavně toho tlačítka.

nahlásit spamnahlásit spam 0 odpovědětodpovědět
<Window x:Class="dlgKlient"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Editace klientů" Height="200" Width="700" MinHeight="150" MinWidth="700" WindowStartupLocation="CenterScreen">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="40"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <Grid Background="#FF004A7D" Grid.Row="0">
            <StackPanel Orientation="Horizontal" HorizontalAlignment="left" VerticalAlignment="Top" Margin="10, 8, 10, 0">
                <Button Name="btnUlozit" VerticalAlignment="Top" Margin="0,0,5,0">
                    <Button.Effect>
                        <DropShadowEffect ShadowDepth="4" Color="#FF004A7D" Direction="300"/>
                    </Button.Effect>
                    <Button.Template>
                        <ControlTemplate TargetType="Button">
                            <Grid>
                                <Canvas Name="cara" Background="#FF4996CB" Height="2" VerticalAlignment="Bottom" Margin="0,0,0,4">
                                </Canvas>
                                <Label Content="Uložit klienty" Name="lbl" Foreground="White" HorizontalAlignment="Left" VerticalContentAlignment="Center" Margin="0,0,0,0">
                                </Label>
                            </Grid>
                            <ControlTemplate.Triggers>
                                <Trigger Property="IsMouseOver" Value="True">
                                    <Setter TargetName="lbl" Property="Foreground" Value="Yellow"/>
                                    <Setter TargetName="cara" Property="Background" Value="#FFBAD3E4"/>
                                </Trigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Button.Template>
                </Button>
                <Button Name="btnOpravit" VerticalAlignment="Top" Margin="0,0,5,0">
                    <Button.Effect>
                        <DropShadowEffect ShadowDepth="4" Color="#FF004A7D" Direction="300"/>
                    </Button.Effect>
                    <Button.Template>
                        <ControlTemplate TargetType="Button">
                            <Grid>
                                <Canvas Name="cara" Background="#FF4996CB" Height="2" VerticalAlignment="Bottom" Margin="0,0,0,4">
                                </Canvas>
                                <Label Content="Opravit klienty" Name="lbl" Foreground="White" HorizontalAlignment="Left" VerticalContentAlignment="Center" Margin="0,0,0,0">
                                </Label>
                            </Grid>
                            <ControlTemplate.Triggers>
                                <Trigger Property="IsMouseOver" Value="True">
                                    <Setter TargetName="lbl" Property="Foreground" Value="Yellow"/>
                                    <Setter TargetName="cara" Property="Background" Value="#FFBAD3E4"/>
                                </Trigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Button.Template>
                </Button>
            </StackPanel>
            <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="10, 8, 10, 0">
                    <Button Name="btnZrusit" Margin="0" VerticalAlignment="Top">
                    <Button.Effect>
                        <DropShadowEffect ShadowDepth="4" Color="#FF004A7D" Direction="300"/>
                    </Button.Effect>
                    <Button.Template>
                        <ControlTemplate TargetType="Button">
                            <Grid>
                                <Canvas Name="cara" Background="#FF4996CB" Height="2" VerticalAlignment="Bottom" Margin="0,0,0,4">
                                </Canvas>
                                <Label Content="Neukládat" Name="lbl" Foreground="White" HorizontalAlignment="Left" VerticalContentAlignment="Center" Margin="0,0,0,0">
                                </Label>
                            </Grid>
                            <ControlTemplate.Triggers>
                                <Trigger Property="IsMouseOver" Value="True">
                                    <Setter TargetName="lbl" Property="Foreground" Value="Yellow"/>
                                    <Setter TargetName="cara" Property="Background" Value="#FFBAD3E4"/>
                                </Trigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Button.Template>
                </Button>
            </StackPanel>
        </Grid>
        <Grid Grid.Row="1">
            <DataGrid Name="nGrid" AutoGenerateColumns="False" CanUserReorderColumns="False" MinColumnWidth="50" GridLinesVisibility="Horizontal" HorizontalGridLinesBrush="#FFCBCBCB" CanUserResizeRows="False" ItemsSource="{Binding}" CellStyle="{DynamicResource DataGridCellStyleVerticalCenter}" EnableColumnVirtualization="True" EnableRowVirtualization="True">
                <DataGrid.Resources>
                    <Style x:Key="cmbSkupina" TargetType="{x:Type ComboBox}" />
                    <Style x:Key="cmbOsloveni" TargetType="{x:Type ComboBox}" />
                </DataGrid.Resources>           
                <DataGrid.Columns>
                    <DataGridTemplateColumn Header="Skupina">
                        <DataGridTemplateColumn.CellTemplate >
                            <DataTemplate>
                                <ComboBox Style="{StaticResource cmbSkupina}" SelectedValue="{Binding skupina, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Height="24" BorderBrush="{x:Null}" SelectedValuePath="id" DisplayMemberPath="nazev"/>
                            </DataTemplate>
                        </DataGridTemplateColumn.CellTemplate>
                    </DataGridTemplateColumn>
                    <DataGridTemplateColumn Header="Oslovení">
                        <DataGridTemplateColumn.CellTemplate >
                            <DataTemplate>
                                <ComboBox Style="{StaticResource cmbOsloveni}" SelectedValue="{Binding osloveni, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Height="24" BorderBrush="{x:Null}" SelectedValuePath="id" DisplayMemberPath="nazev"/>
                            </DataTemplate>
                        </DataGridTemplateColumn.CellTemplate>
                    </DataGridTemplateColumn>
                    <DataGridTextColumn Header="Titul" Binding="{Binding titul}"/>
                    <DataGridTextColumn Header="Jméno" Binding="{Binding jmeno}"/>
                    <DataGridTextColumn Header="Příjmení" Binding="{Binding prijmeni}"/>
                    <DataGridTextColumn Header="Příjmení pro oslovení" Binding="{Binding prijmeni2}"/>
                    <DataGridTextColumn Header="RČ" Binding="{Binding rc}"/>
                    <DataGridTemplateColumn Header="Narozeniny">
                        <DataGridTemplateColumn.CellTemplate >
                            <DataTemplate>
                                <DatePicker SelectedDate="{Binding narozeni, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" BorderBrush="{x:Null}"/>
                            </DataTemplate>
                        </DataGridTemplateColumn.CellTemplate>
                    </DataGridTemplateColumn>
                    <DataGridTextColumn Header="Telefon" Binding="{Binding telefon}"/>
                    <DataGridTextColumn Header="Email" Binding="{Binding email}"/>
                    <DataGridTextColumn Header="Ulice" Binding="{Binding ulice}"/>
                    <DataGridTextColumn Header="Město" Binding="{Binding mesto}"/>
                    <DataGridTextColumn Header="PSČ" Binding="{Binding psc}"/>
                    <DataGridTextColumn Header="Poznámka" Binding="{Binding poznamka}"/>
                </DataGrid.Columns>
            </DataGrid>
        </Grid>
    </Grid>
</Window>

Public Class dlgKlient
    Dim lNovyKlienti As Boolean
    Public ds As New DataSet

    Public WriteOnly Property NovyKlienti As Boolean
        Set(value As Boolean)
            lNovyKlienti = value
        End Set
    End Property

    Private Sub btnZrusit_Click(sender As Object, e As RoutedEventArgs) Handles btnZrusit.Click
        Me.DialogResult = False
        'Me.Close()
    End Sub

    Private Sub dlgKlient_Closing(sender As Object, e As CancelEventArgs) Handles Me.Closing
        'If (Not Me.DialogResult OrElse IsNothing(Me.DialogResult)) AndAlso MsgBox("Opravdu chcete zavřít okno bez uložení?", MsgBoxStyle.YesNo + MsgBoxStyle.Question) = MsgBoxResult.No Then e.Cancel = True
    End Sub

    Private Sub dlgKlient_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
        ' Načte číselníky
        Try
            Dim daSkupiny As New SqlCeDataAdapter("SELECT * FROM Ciselniky WHERE typ = 'Skupiny' ORDER BY nazev", conn)
            Dim daOsloveni As New SqlCeDataAdapter("SELECT * FROM Ciselniky WHERE typ = 'Oslovení' ORDER BY nazev", conn)

            daSkupiny.Fill(ds, "Skupiny")
            daOsloveni.Fill(ds, "Osloveni")
            If ds.Tables("Skupiny").Rows.Count = 0 Then MsgBox("Než začnete přidávat klienty musíme vytvořit alespoň jednu skupinu v číselníkách", MsgBoxStyle.Exclamation) : Me.DialogResult = False : Me.Close() : Exit Sub
            If ds.Tables("Osloveni").Rows.Count = 0 Then MsgBox("Než začnete přidávat klienty musíme přidat alespoň jedno oslovení klienta v číselníkách", MsgBoxStyle.Exclamation) : Me.DialogResult = False : Me.Close() : Exit Sub
        Catch ex As Exception
            Chyba(ex, TraceEventType.Error, "Při načítání číselníků pro přidání nových klientů došlo k chybě:")
            Me.DialogResult = False
            Me.Close()
            Exit Sub
        End Try

        ' Když se jedná o nového klienta
        If lNovyKlienti Then
            Me.Title = "Přidat nové klienty"
            btnUlozit.Visibility = Windows.Visibility.Visible
            btnOpravit.Visibility = Windows.Visibility.Collapsed
        Else
            btnUlozit.Visibility = Windows.Visibility.Collapsed
        End If

        nGrid.ItemsSource = ds.Tables("Klienti").DefaultView

        ' Vyplní combo se skupinama
        Dim style As Style = TryCast(nGrid.FindResource("cmbSkupina"), Style)
        style.Setters.Add(New Setter(ComboBox.ItemsSourceProperty, ds.Tables("Skupiny").DefaultView))

        ' Vyplní combo s oslovením
        style = TryCast(nGrid.FindResource("cmbOsloveni"), Style)
        style.Setters.Add(New Setter(ComboBox.ItemsSourceProperty, ds.Tables("Osloveni").DefaultView))
    End Sub

    Private Sub btnUlozit_Click(sender As Object, e As RoutedEventArgs) Handles btnUlozit.Click
        Dim X As Integer = ds.Tables("Klienti").Rows.Count
        Dim Xok As Integer = 0
        For Each Row As DataRow In ds.Tables("Klienti").Rows
            Try
                If Not IsDBNull(Row("pridano")) AndAlso Row("pridano") Then X = X - 1 : Continue For

                ' Ověří povinné pole
                If IsDBNull(Row("skupina")) Then MsgBox("Musíte vybrat skupinu klienta", MsgBoxStyle.Exclamation) : Continue For
                If IsDBNull(Row("osloveni")) Then MsgBox("Musíte vybrat oslovení klienta", MsgBoxStyle.Exclamation) : Continue For
                If IsDBNull(Row("prijmeni")) Then MsgBox("Musíte napsat příjmení klienta nebo název firmy (do pole příjmení)", MsgBoxStyle.Exclamation) : Continue For

                ' Pomocné data
                Dim vek As Integer = 0
                If Not IsDBNull(Row("narozeni")) Then
                    vek = ZjistiVek(Row("narozeni"), Now)
                End If

                ' Přidá do DB
                Dim cmd As New SqlCeCommand("INSERT INTO Klienti (iddb, skupina, osloveni, titul, jmeno, prijmeni, narozeni, vek, telefon, email, ulice, mesto, psc, poznamka, prijmeni2, rc, provize) VALUES (@iddb, @skupina, @osloveni, @titul, @jmeno, @prijmeni, @narozeni, @vek, @telefon, @email, @ulice, @mesto, @psc, @poznamka, @prijmeni2, @rc, @provize)", conn)
                cmd.Parameters.AddWithValue("iddb", IDDB)
                cmd.Parameters.AddWithValue("skupina", Row("skupina"))
                cmd.Parameters.AddWithValue("osloveni", Row("osloveni"))
                cmd.Parameters.AddWithValue("titul", Row("titul"))
                cmd.Parameters.AddWithValue("jmeno", Row("jmeno"))
                cmd.Parameters.AddWithValue("prijmeni", Row("prijmeni"))
                cmd.Parameters.AddWithValue("prijmeni2", Row("prijmeni2"))
                cmd.Parameters.AddWithValue("rc", Row("rc"))
                cmd.Parameters.AddWithValue("narozeni", Row("narozeni"))
                cmd.Parameters.AddWithValue("vek", vek)
                cmd.Parameters.AddWithValue("telefon", Row("telefon"))
                cmd.Parameters.AddWithValue("email", Row("email"))
                cmd.Parameters.AddWithValue("ulice", Row("ulice"))
                cmd.Parameters.AddWithValue("mesto", Row("mesto"))
                cmd.Parameters.AddWithValue("psc", Row("psc"))
                cmd.Parameters.AddWithValue("poznamka", Row("poznamka"))
                cmd.Parameters.AddWithValue("provize", 0)
                cmd.ExecuteNonQuery()
                cmd = New SqlCeCommand("SELECT id AS LastID FROM Klienti WHERE id = @@Identity", conn)
                Dim lID As Integer = cmd.ExecuteScalar

                ' Přidá do dsMain
                Dim nRow As DataRow = dsMain.Tables("Klienti").Rows.Add
                nRow("id") = lID
                nRow("iddb") = IDDB
                nRow("skupina") = Row("skupina")
                nRow("osloveni") = Row("osloveni")
                nRow("titul") = Row("titul")
                nRow("jmeno") = Row("jmeno")
                nRow("prijmeni") = Row("prijmeni")
                nRow("prijmeni2") = Row("prijmeni2")
                nRow("rc") = Row("rc")
                nRow("narozeni") = Row("narozeni")
                nRow("vek") = vek
                nRow("telefon") = Row("telefon")
                nRow("email") = Row("email")
                nRow("ulice") = Row("ulice")
                nRow("mesto") = Row("mesto")
                nRow("psc") = Row("psc")
                nRow("poznamka") = Row("poznamka")
                nRow("provize") = 0
                nRow("nazevskupiny") = NactiNazevCiselniku(Row("skupina"))
                Row("pridano") = True
                Xok = Xok + 1
            Catch ex As Exception
                Chyba(ex, TraceEventType.Error, String.Format("Při ukládání klienta {0}{1}{2} došlo k chybě:", IIf(Not IsDBNull(Row("titul")), Row("titul") & " ", ""), IIf(Not IsDBNull(Row("jmeno")), Row("jmeno") & " ", ""), IIf(Not IsDBNull(Row("prijmeni")), Row("prijmeni"), "")))
            End Try
        Next

        If X = 0 Then
            Me.DialogResult = False
        ElseIf X > 0 AndAlso X - Xok > 0 Then
            MsgBox(String.Format("Celkem bylo přidáno {0} klientů, ale z toho bylo kvůli chybám preskočeno: {1}", Xok, X - Xok), MsgBoxStyle.Exclamation)
        ElseIf X > 0 AndAlso X - Xok = 0 Then
            MsgBox(String.Format("Celkem bylo přidáno {0} klientů", Xok), MsgBoxStyle.Information)
            Me.DialogResult = True
        End If

        ds.Tables("Klienti").AcceptChanges()
        dsMain.Tables("Klienti").AcceptChanges()

    End Sub

    Public Sub New()

        ' This call is required by the designer.
        InitializeComponent()

        ' Add any initialization after the InitializeComponent() call.
        Me.Width = My.Settings.dlgKlient_Size.Width
        Me.Height = My.Settings.dlgKlient_Size.Height

        ' Připraví tabulku
        ds = New DataSet
        ds.Tables.Add("Klienti")
        With ds.Tables("Klienti").Columns
            .Add("id", GetType(Integer))
            .Add("skupina", GetType(Integer))
            .Add("osloveni", GetType(Integer))
            .Add("titul", GetType(String))
            .Add("jmeno", GetType(String))
            .Add("prijmeni", GetType(String))
            .Add("prijmeni2", GetType(String))
            .Add("rc", GetType(String))
            .Add("narozeni", GetType(Date))
            .Add("telefon", GetType(String))
            .Add("email", GetType(String))
            .Add("ulice", GetType(String))
            .Add("mesto", GetType(String))
            .Add("psc", GetType(Integer))
            .Add("poznamka", GetType(String))
            .Add("pridano", GetType(Boolean))
        End With

    End Sub

    Private Sub dlgKlient_SizeChanged(sender As Object, e As SizeChangedEventArgs) Handles Me.SizeChanged
        My.Settings.dlgKlient_Size = New Size(Me.Width, Me.Height)
    End Sub

    Private Sub btnOpravit_Click(sender As Object, e As RoutedEventArgs) Handles btnOpravit.Click
        Dim X As Integer = ds.Tables("Klienti").Rows.Count
        Dim Xok As Integer = 0
        For Each Row As DataRow In ds.Tables("Klienti").Rows
            Try
                If Not IsDBNull(Row("pridano")) AndAlso Row("pridano") Then X = X - 1 : Continue For

                ' Ověří povinné pole
                If IsDBNull(Row("skupina")) Then MsgBox("Musíte vybrat skupinu klienta", MsgBoxStyle.Exclamation) : Continue For
                If IsDBNull(Row("osloveni")) Then MsgBox("Musíte vybrat oslovení klienta", MsgBoxStyle.Exclamation) : Continue For
                If IsDBNull(Row("prijmeni")) Then MsgBox("Musíte napsat příjmení klienta nebo název firmy (do pole příjmení)", MsgBoxStyle.Exclamation) : Continue For

                ' Pomocné data
                Dim vek As Integer = 0
                If Not IsDBNull(Row("narozeni")) Then
                    vek = ZjistiVek(Row("narozeni"), Now)
                End If

                ' Opraví v DB
                Dim cmd As New SqlCeCommand("UPDATE Klienti SET skupina = @skupina, osloveni = @osloveni, titul = @titul, jmeno = @jmeno, prijmeni = @prijmeni, prijmeni2 = @prijmeni2, rc = @rc, narozeni = @narozeni, vek = @vek, telefon = @telefon, email = @email, ulice = @ulice, mesto = @mesto, psc = @psc, poznamka = @poznamka WHERE id = " & Row("id"), conn)
                cmd.Parameters.AddWithValue("skupina", Row("skupina"))
                cmd.Parameters.AddWithValue("osloveni", Row("osloveni"))
                cmd.Parameters.AddWithValue("titul", Row("titul"))
                cmd.Parameters.AddWithValue("jmeno", Row("jmeno"))
                cmd.Parameters.AddWithValue("prijmeni", Row("prijmeni"))
                cmd.Parameters.AddWithValue("prijmeni2", Row("prijmeni2"))
                cmd.Parameters.AddWithValue("rc", Row("rc"))
                cmd.Parameters.AddWithValue("narozeni", Row("narozeni"))
                cmd.Parameters.AddWithValue("vek", vek)
                cmd.Parameters.AddWithValue("telefon", Row("telefon"))
                cmd.Parameters.AddWithValue("email", Row("email"))
                cmd.Parameters.AddWithValue("ulice", Row("ulice"))
                cmd.Parameters.AddWithValue("mesto", Row("mesto"))
                cmd.Parameters.AddWithValue("psc", Row("psc"))
                cmd.Parameters.AddWithValue("poznamka", Row("poznamka"))
                cmd.ExecuteNonQuery()

                ' Opraví v dsMain
                For Each mRow As DataRow In dsMain.Tables("Klienti").Select("id = " & Row("id"))
                    mRow("skupina") = Row("skupina")
                    mRow("osloveni") = Row("osloveni")
                    mRow("titul") = Row("titul")
                    mRow("jmeno") = Row("jmeno")
                    mRow("prijmeni") = Row("prijmeni")
                    mRow("prijmeni2") = Row("prijmeni2")
                    mRow("rc") = Row("rc")
                    mRow("narozeni") = Row("narozeni")
                    mRow("vek") = vek
                    mRow("telefon") = Row("telefon")
                    mRow("email") = Row("email")
                    mRow("ulice") = Row("ulice")
                    mRow("mesto") = Row("mesto")
                    mRow("psc") = Row("psc")
                    mRow("poznamka") = Row("poznamka")
                    mRow("nazevskupiny") = NactiNazevCiselniku(Row("skupina"))
                Next

                Row("pridano") = True
                Xok = Xok + 1
            Catch ex As Exception
                Chyba(ex, TraceEventType.Error, String.Format("Při ukládání opraveného klienta {0}{1}{2} došlo k chybě:", IIf(Not IsDBNull(Row("titul")), Row("titul") & " ", ""), IIf(Not IsDBNull(Row("jmeno")), Row("jmeno") & " ", ""), IIf(Not IsDBNull(Row("prijmeni")), Row("prijmeni"), "")))
            End Try
        Next

        If X = 0 Then
            Me.DialogResult = False
        ElseIf X > 0 AndAlso X - Xok > 0 Then
            MsgBox(String.Format("Celkem bylo opraveno {0} klientů, ale z toho bylo kvůli chybám preskočeno: {1}", Xok, X - Xok), MsgBoxStyle.Exclamation)
        ElseIf X > 0 AndAlso X - Xok = 0 Then
            MsgBox(String.Format("Celkem bylo opraveno {0} klientů", Xok), MsgBoxStyle.Information)
            Me.DialogResult = True
        End If

        ds.Tables("Klienti").AcceptChanges()
        dsMain.Tables("Klienti").AcceptChanges()

    End Sub
End Class
nahlásit spamnahlásit spam 0 odpovědětodpovědět

Takhle tam chybu nevidím, ale zkuste následující postup:

Spustit

Menu Debug/Exceptions...Find a zadat 'ArgumentNullException'

Zaškrtnout checkbox sloupce Thrown

Vyvolat v debug modu v aplikaci tuto chybu tlačítkem Uložit

VS by vám mělo ukázat přesný řádek na kterém exception vzniká.

nahlásit spamnahlásit spam 0 odpovědětodpovědět

Bez výsledku, stejné.

Když zadám cokoliv do datagrigu a dám uložit rovnou to spadne do této obrazovky.

https://dl.dropboxusercontent.com/u/4892...

Teď se akorát změnila chyba z PresentationFramework.dll na mscorlib.dll

Zde je STACK:

 	mscorlib.dll!System.Collections.Hashtable.ContainsKey(object key) + 0x142 bytes	
 	mscorlib.dll!System.Collections.Hashtable.Contains(object key) + 0xa bytes	
 	PresentationFramework.dll!System.Windows.ResourceDictionary.Contains(object key) + 0x18 bytes	
 	PresentationFramework.dll!System.Windows.FrameworkElement.FindResourceInTree(System.Windows.FrameworkElement feStart, System.Windows.FrameworkContentElement fceStart, System.Windows.DependencyProperty dp, object resourceKey, object unlinkedParent, bool allowDeferredResourceReference, bool mustReturnDeferredResourceReference, System.Windows.DependencyObject boundaryElement, out System.Windows.InheritanceBehavior inheritanceBehavior, out object source) + 0xe2 bytes	
 	PresentationFramework.dll!System.Windows.FrameworkElement.FindResourceInternal(System.Windows.FrameworkElement fe, System.Windows.FrameworkContentElement fce, System.Windows.DependencyProperty dp, object resourceKey, object unlinkedParent, bool allowDeferredResourceReference, bool mustReturnDeferredResourceReference, System.Windows.DependencyObject boundaryElement, bool isImplicitStyleLookup, out object source) + 0x7a bytes	
 	PresentationFramework.dll!System.Windows.StyleHelper.GetChildValueHelper(System.Windows.UncommonField<System.Collections.Specialized.HybridDictionary[]> dataField, ref MS.Utility.ItemStructList<System.Windows.ChildValueLookup> valueLookupList, System.Windows.DependencyProperty dp, System.Windows.DependencyObject container, MS.Internal.FrameworkObject child, int childIndex, bool styleLookup, ref System.Windows.EffectiveValueEntry entry, out System.Windows.ValueLookupType sourceType, System.Windows.FrameworkElementFactory templateRoot) + 0x2da bytes	
 	PresentationFramework.dll!System.Windows.StyleHelper.GetChildValue(System.Windows.UncommonField<System.Collections.Specialized.HybridDictionary[]> dataField, System.Windows.DependencyObject container, int childIndex, MS.Internal.FrameworkObject child, System.Windows.DependencyProperty dp, ref MS.Utility.FrugalStructList<System.Windows.ChildRecord> childRecordFromChildIndex, ref System.Windows.EffectiveValueEntry entry, out System.Windows.ValueLookupType sourceType, System.Windows.FrameworkElementFactory templateRoot) + 0xbc bytes	
 	PresentationFramework.dll!System.Windows.StyleHelper.GetValueFromStyleOrTemplate(MS.Internal.FrameworkObject fo, System.Windows.DependencyProperty dp, ref System.Windows.EffectiveValueEntry entry) + 0xbd bytes	
 	PresentationFramework.dll!System.Windows.FrameworkElement.GetRawValue(System.Windows.DependencyProperty dp, System.Windows.PropertyMetadata metadata, ref System.Windows.EffectiveValueEntry entry) + 0x70 bytes	
 	PresentationFramework.dll!System.Windows.FrameworkElement.EvaluateBaseValueCore(System.Windows.DependencyProperty dp, System.Windows.PropertyMetadata metadata, ref System.Windows.EffectiveValueEntry newEntry) + 0x32 bytes	
 	WindowsBase.dll!System.Windows.DependencyObject.EvaluateEffectiveValue(System.Windows.EntryIndex entryIndex, System.Windows.DependencyProperty dp, System.Windows.PropertyMetadata metadata, System.Windows.EffectiveValueEntry oldEntry, System.Windows.EffectiveValueEntry newEntry, System.Windows.OperationType operationType) + 0x102 bytes	
 	WindowsBase.dll!System.Windows.DependencyObject.UpdateEffectiveValue(System.Windows.EntryIndex entryIndex, System.Windows.DependencyProperty dp, System.Windows.PropertyMetadata metadata, System.Windows.EffectiveValueEntry oldEntry, ref System.Windows.EffectiveValueEntry newEntry, bool coerceWithDeferredReference, bool coerceWithCurrentValue, System.Windows.OperationType operationType) + 0x379 bytes	
 	WindowsBase.dll!System.Windows.DependencyObject.InvalidateProperty(System.Windows.DependencyProperty dp, bool preserveCurrentValue) + 0xd1 bytes	
 	PresentationFramework.dll!System.Windows.StyleHelper.InvalidateDependents(System.Windows.Style ownerStyle, System.Windows.FrameworkTemplate frameworkTemplate, System.Windows.DependencyObject container, System.Windows.DependencyProperty dp, ref MS.Utility.FrugalStructList<System.Windows.ChildPropertyDependent> dependents, bool invalidateOnlyContainer) + 0x79 bytes	
 	PresentationFramework.dll!System.Windows.StyleHelper.OnTriggerSourcePropertyInvalidated(System.Windows.Style ownerStyle, System.Windows.FrameworkTemplate frameworkTemplate, System.Windows.DependencyObject container, System.Windows.DependencyProperty dp, System.Windows.DependencyPropertyChangedEventArgs changedArgs, bool invalidateOnlyContainer, ref MS.Utility.FrugalStructList<MS.Utility.ItemStructMap<System.Windows.TriggerSourceRecord>> triggerSourceRecordFromChildIndex, ref MS.Utility.FrugalMap propertyTriggersWithActions, int sourceChildIndex) + 0xc7 bytes	
 	PresentationFramework.dll!System.Windows.FrameworkElement.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs e) + 0x546 bytes	
 	WindowsBase.dll!System.Windows.DependencyObject.NotifyPropertyChange(System.Windows.DependencyPropertyChangedEventArgs args) + 0x3b bytes	
 	WindowsBase.dll!System.Windows.DependencyObject.UpdateEffectiveValue(System.Windows.EntryIndex entryIndex, System.Windows.DependencyProperty dp, System.Windows.PropertyMetadata metadata, System.Windows.EffectiveValueEntry oldEntry, ref System.Windows.EffectiveValueEntry newEntry, bool coerceWithDeferredReference, bool coerceWithCurrentValue, System.Windows.OperationType operationType) + 0x757 bytes	
 	PresentationFramework.dll!System.Windows.TreeWalkHelper.OnInheritablePropertyChanged(System.Windows.DependencyObject d, System.Windows.InheritablePropertyChangeInfo info, bool visitedViaVisualTree) + 0x1c4 bytes	
 	PresentationFramework.dll!System.Windows.DescendentsWalker<System.Windows.InheritablePropertyChangeInfo>._VisitNode(System.Windows.DependencyObject d, bool visitedViaVisualTree) + 0x2f bytes	
 	PresentationFramework.dll!System.Windows.DescendentsWalker<System.Windows.InheritablePropertyChangeInfo>.VisitNode(System.Windows.FrameworkElement fe, bool visitedViaVisualTree) + 0x6f bytes	
 	PresentationFramework.dll!System.Windows.DescendentsWalker<System.Windows.InheritablePropertyChangeInfo>.VisitNode(System.Windows.DependencyObject d, bool visitedViaVisualTree) + 0x66 bytes	
 	PresentationFramework.dll!System.Windows.DescendentsWalker<System.Windows.InheritablePropertyChangeInfo>.WalkFrameworkElementLogicalThenVisualChildren(System.Windows.FrameworkElement feParent, bool hasLogicalChildren) + 0xfd bytes	
 	PresentationFramework.dll!System.Windows.DescendentsWalker<System.Windows.InheritablePropertyChangeInfo>.IterateChildren(System.Windows.DependencyObject d) + 0x73 bytes	
 	PresentationFramework.dll!System.Windows.DescendentsWalker<System.Windows.InheritablePropertyChangeInfo>._VisitNode(System.Windows.DependencyObject d, bool visitedViaVisualTree) + 0x3c bytes	
 	PresentationFramework.dll!System.Windows.DescendentsWalker<System.Windows.InheritablePropertyChangeInfo>.VisitNode(System.Windows.FrameworkElement fe, bool visitedViaVisualTree) + 0x6f bytes	
 	PresentationFramework.dll!System.Windows.DescendentsWalker<System.Windows.InheritablePropertyChangeInfo>.VisitNode(System.Windows.DependencyObject d, bool visitedViaVisualTree) + 0x66 bytes	
 	PresentationFramework.dll!System.Windows.DescendentsWalker<System.Windows.InheritablePropertyChangeInfo>.WalkFrameworkElementLogicalThenVisualChildren(System.Windows.FrameworkElement feParent, bool hasLogicalChildren) + 0xfd bytes	
 	PresentationFramework.dll!System.Windows.DescendentsWalker<System.Windows.InheritablePropertyChangeInfo>.IterateChildren(System.Windows.DependencyObject d) + 0x73 bytes	
 	PresentationFramework.dll!System.Windows.DescendentsWalker<System.Windows.InheritablePropertyChangeInfo>._VisitNode(System.Windows.DependencyObject d, bool visitedViaVisualTree) + 0x3c bytes	
 	PresentationFramework.dll!System.Windows.DescendentsWalker<System.Windows.InheritablePropertyChangeInfo>.VisitNode(System.Windows.FrameworkElement fe, bool visitedViaVisualTree) + 0x6f bytes	
 	PresentationFramework.dll!System.Windows.DescendentsWalker<System.Windows.InheritablePropertyChangeInfo>.VisitNode(System.Windows.DependencyObject d, bool visitedViaVisualTree) + 0x66 bytes	
 	PresentationFramework.dll!System.Windows.DescendentsWalker<System.Windows.InheritablePropertyChangeInfo>.WalkFrameworkElementLogicalThenVisualChildren(System.Windows.FrameworkElement feParent, bool hasLogicalChildren) + 0xfd bytes	
 	PresentationFramework.dll!System.Windows.DescendentsWalker<System.Windows.InheritablePropertyChangeInfo>.IterateChildren(System.Windows.DependencyObject d) + 0x73 bytes	
 	PresentationFramework.dll!System.Windows.DescendentsWalker<System.Windows.InheritablePropertyChangeInfo>._VisitNode(System.Windows.DependencyObject d, bool visitedViaVisualTree) + 0x3c bytes	
 	PresentationFramework.dll!System.Windows.DescendentsWalker<System.Windows.InheritablePropertyChangeInfo>.VisitNode(System.Windows.FrameworkElement fe, bool visitedViaVisualTree) + 0x6f bytes	
 	PresentationFramework.dll!System.Windows.DescendentsWalker<System.Windows.InheritablePropertyChangeInfo>.VisitNode(System.Windows.DependencyObject d, bool visitedViaVisualTree) + 0x66 bytes	
 	PresentationFramework.dll!System.Windows.DescendentsWalker<System.Windows.InheritablePropertyChangeInfo>.WalkLogicalChildren(System.Windows.FrameworkElement feParent, System.Windows.FrameworkContentElement fceParent, System.Collections.IEnumerator logicalChildren) + 0x69 bytes	
 	PresentationFramework.dll!System.Windows.DescendentsWalker<System.Windows.InheritablePropertyChangeInfo>.WalkFrameworkElementLogicalThenVisualChildren(System.Windows.FrameworkElement feParent, bool hasLogicalChildren) + 0x43 bytes	
 	PresentationFramework.dll!System.Windows.DescendentsWalker<System.Windows.InheritablePropertyChangeInfo>.IterateChildren(System.Windows.DependencyObject d) + 0x73 bytes	
 	PresentationFramework.dll!System.Windows.DescendentsWalker<System.Windows.InheritablePropertyChangeInfo>._VisitNode(System.Windows.DependencyObject d, bool visitedViaVisualTree) + 0x3c bytes	
 	PresentationFramework.dll!System.Windows.DescendentsWalker<System.Windows.InheritablePropertyChangeInfo>.VisitNode(System.Windows.FrameworkElement fe, bool visitedViaVisualTree) + 0x6f bytes	
 	PresentationFramework.dll!System.Windows.DescendentsWalker<System.Windows.InheritablePropertyChangeInfo>.VisitNode(System.Windows.DependencyObject d, bool visitedViaVisualTree) + 0x66 bytes	
 	PresentationFramework.dll!System.Windows.DescendentsWalker<System.Windows.InheritablePropertyChangeInfo>.WalkLogicalChildren(System.Windows.FrameworkElement feParent, System.Windows.FrameworkContentElement fceParent, System.Collections.IEnumerator logicalChildren) + 0x69 bytes	
 	PresentationFramework.dll!System.Windows.DescendentsWalker<System.Windows.InheritablePropertyChangeInfo>.WalkFrameworkElementLogicalThenVisualChildren(System.Windows.FrameworkElement feParent, bool hasLogicalChildren) + 0x43 bytes	
 	PresentationFramework.dll!System.Windows.DescendentsWalker<System.Windows.InheritablePropertyChangeInfo>.IterateChildren(System.Windows.DependencyObject d) + 0x73 bytes	
 	PresentationFramework.dll!System.Windows.DescendentsWalker<System.Windows.InheritablePropertyChangeInfo>._VisitNode(System.Windows.DependencyObject d, bool visitedViaVisualTree) + 0x3c bytes	
 	PresentationFramework.dll!System.Windows.DescendentsWalker<System.Windows.InheritablePropertyChangeInfo>.VisitNode(System.Windows.FrameworkElement fe, bool visitedViaVisualTree) + 0x6f bytes	
 	PresentationFramework.dll!System.Windows.DescendentsWalker<System.Windows.InheritablePropertyChangeInfo>.VisitNode(System.Windows.DependencyObject d, bool visitedViaVisualTree) + 0x66 bytes	
 	PresentationFramework.dll!System.Windows.DescendentsWalker<System.Windows.InheritablePropertyChangeInfo>.WalkFrameworkElementLogicalThenVisualChildren(System.Windows.FrameworkElement feParent, bool hasLogicalChildren) + 0xfd bytes	
 	PresentationFramework.dll!System.Windows.DescendentsWalker<System.Windows.InheritablePropertyChangeInfo>.IterateChildren(System.Windows.DependencyObject d) + 0x73 bytes	
 	PresentationFramework.dll!System.Windows.DescendentsWalker<System.Windows.InheritablePropertyChangeInfo>._VisitNode(System.Windows.DependencyObject d, bool visitedViaVisualTree) + 0x3c bytes	
 	PresentationFramework.dll!System.Windows.DescendentsWalker<System.Windows.InheritablePropertyChangeInfo>.VisitNode(System.Windows.FrameworkElement fe, bool visitedViaVisualTree) + 0x6f bytes	
 	PresentationFramework.dll!System.Windows.DescendentsWalker<System.Windows.InheritablePropertyChangeInfo>.VisitNode(System.Windows.DependencyObject d, bool visitedViaVisualTree) + 0x66 bytes	
 	PresentationFramework.dll!System.Windows.DescendentsWalker<System.Windows.InheritablePropertyChangeInfo>.WalkFrameworkElementLogicalThenVisualChildren(System.Windows.FrameworkElement feParent, bool hasLogicalChildren) + 0xfd bytes	
 	PresentationFramework.dll!System.Windows.DescendentsWalker<System.Windows.InheritablePropertyChangeInfo>.IterateChildren(System.Windows.DependencyObject d) + 0x73 bytes	
 	PresentationFramework.dll!System.Windows.DescendentsWalker<System.Windows.InheritablePropertyChangeInfo>._VisitNode(System.Windows.DependencyObject d, bool visitedViaVisualTree) + 0x3c bytes	
 	PresentationFramework.dll!System.Windows.DescendentsWalker<System.Windows.InheritablePropertyChangeInfo>.VisitNode(System.Windows.FrameworkElement fe, bool visitedViaVisualTree) + 0x6f bytes	
 	PresentationFramework.dll!System.Windows.DescendentsWalker<System.Windows.InheritablePropertyChangeInfo>.VisitNode(System.Windows.DependencyObject d, bool visitedViaVisualTree) + 0x66 bytes	
 	PresentationFramework.dll!System.Windows.DescendentsWalker<System.Windows.InheritablePropertyChangeInfo>.WalkFrameworkElementLogicalThenVisualChildren(System.Windows.FrameworkElement feParent, bool hasLogicalChildren) + 0xfd bytes	
 	PresentationFramework.dll!System.Windows.DescendentsWalker<System.Windows.InheritablePropertyChangeInfo>.IterateChildren(System.Windows.DependencyObject d) + 0x73 bytes	
 	PresentationFramework.dll!System.Windows.DescendentsWalker<System.Windows.InheritablePropertyChangeInfo>._VisitNode(System.Windows.DependencyObject d, bool visitedViaVisualTree) + 0x3c bytes	
 	PresentationFramework.dll!System.Windows.DescendentsWalker<System.Windows.InheritablePropertyChangeInfo>.VisitNode(System.Windows.FrameworkElement fe, bool visitedViaVisualTree) + 0x6f bytes	
 	PresentationFramework.dll!System.Windows.DescendentsWalker<System.Windows.InheritablePropertyChangeInfo>.VisitNode(System.Windows.DependencyObject d, bool visitedViaVisualTree) + 0x66 bytes	
 	PresentationFramework.dll!System.Windows.DescendentsWalker<System.Windows.InheritablePropertyChangeInfo>.WalkLogicalChildren(System.Windows.FrameworkElement feParent, System.Windows.FrameworkContentElement fceParent, System.Collections.IEnumerator logicalChildren) + 0x69 bytes	
 	PresentationFramework.dll!System.Windows.DescendentsWalker<System.Windows.InheritablePropertyChangeInfo>.WalkFrameworkElementLogicalThenVisualChildren(System.Windows.FrameworkElement feParent, bool hasLogicalChildren) + 0x43 bytes	
 	PresentationFramework.dll!System.Windows.DescendentsWalker<System.Windows.InheritablePropertyChangeInfo>.IterateChildren(System.Windows.DependencyObject d) + 0x73 bytes	
 	PresentationFramework.dll!System.Windows.DescendentsWalker<System.Windows.InheritablePropertyChangeInfo>._VisitNode(System.Windows.DependencyObject d, bool visitedViaVisualTree) + 0x3c bytes	
 	PresentationFramework.dll!System.Windows.DescendentsWalker<System.Windows.InheritablePropertyChangeInfo>.VisitNode(System.Windows.FrameworkElement fe, bool visitedViaVisualTree) + 0x6f bytes	
 	PresentationFramework.dll!System.Windows.DescendentsWalker<System.Windows.InheritablePropertyChangeInfo>.VisitNode(System.Windows.DependencyObject d, bool visitedViaVisualTree) + 0x66 bytes	
 	PresentationFramework.dll!System.Windows.DescendentsWalker<System.Windows.InheritablePropertyChangeInfo>.WalkLogicalChildren(System.Windows.FrameworkElement feParent, System.Windows.FrameworkContentElement fceParent, System.Collections.IEnumerator logicalChildren) + 0x69 bytes	
 	PresentationFramework.dll!System.Windows.DescendentsWalker<System.Windows.InheritablePropertyChangeInfo>.WalkFrameworkElementLogicalThenVisualChildren(System.Windows.FrameworkElement feParent, bool hasLogicalChildren) + 0x43 bytes	
 	PresentationFramework.dll!System.Windows.DescendentsWalker<System.Windows.InheritablePropertyChangeInfo>.IterateChildren(System.Windows.DependencyObject d) + 0x73 bytes	
 	PresentationFramework.dll!System.Windows.DescendentsWalker<System.Windows.InheritablePropertyChangeInfo>._VisitNode(System.Windows.DependencyObject d, bool visitedViaVisualTree) + 0x3c bytes	
 	PresentationFramework.dll!System.Windows.DescendentsWalker<System.Windows.InheritablePropertyChangeInfo>.VisitNode(System.Windows.FrameworkElement fe, bool visitedViaVisualTree) + 0x6f bytes	
 	PresentationFramework.dll!System.Windows.DescendentsWalker<System.Windows.InheritablePropertyChangeInfo>.VisitNode(System.Windows.DependencyObject d, bool visitedViaVisualTree) + 0x66 bytes	
 	PresentationFramework.dll!System.Windows.DescendentsWalker<System.Windows.InheritablePropertyChangeInfo>.WalkFrameworkElementLogicalThenVisualChildren(System.Windows.FrameworkElement feParent, bool hasLogicalChildren) + 0xfd bytes	
 	PresentationFramework.dll!System.Windows.DescendentsWalker<System.Windows.InheritablePropertyChangeInfo>.IterateChildren(System.Windows.DependencyObject d) + 0x73 bytes	
 	PresentationFramework.dll!System.Windows.DescendentsWalker<System.Windows.InheritablePropertyChangeInfo>.StartWalk(System.Windows.DependencyObject startNode, bool skipStartNode) + 0x2c bytes	
 	PresentationFramework.dll!System.Windows.FrameworkElement.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs e) + 0x731 bytes	
 	WindowsBase.dll!System.Windows.DependencyObject.NotifyPropertyChange(System.Windows.DependencyPropertyChangedEventArgs args) + 0x3b bytes	
 	WindowsBase.dll!System.Windows.DependencyObject.UpdateEffectiveValue(System.Windows.EntryIndex entryIndex, System.Windows.DependencyProperty dp, System.Windows.PropertyMetadata metadata, System.Windows.EffectiveValueEntry oldEntry, ref System.Windows.EffectiveValueEntry newEntry, bool coerceWithDeferredReference, bool coerceWithCurrentValue, System.Windows.OperationType operationType) + 0x757 bytes	
 	WindowsBase.dll!System.Windows.DependencyObject.SetValueCommon(System.Windows.DependencyProperty dp, object value, System.Windows.PropertyMetadata metadata, bool coerceWithDeferredReference, bool coerceWithCurrentValue, System.Windows.OperationType operationType, bool isInternal) + 0x2ea bytes	
 	WindowsBase.dll!System.Windows.DependencyObject.SetValue(System.Windows.DependencyPropertyKey key, object value) + 0x40 bytes	
 	PresentationFramework.dll!System.Windows.Controls.Primitives.Selector.OnIsKeyboardFocusWithinChanged(System.Windows.DependencyPropertyChangedEventArgs e) + 0xd4 bytes	
 	PresentationCore.dll!System.Windows.FocusWithinProperty.FireNotifications(System.Windows.UIElement uie, System.Windows.ContentElement ce, System.Windows.UIElement3D uie3D, bool oldValue) + 0x9a bytes	
 	PresentationCore.dll!System.Windows.ReverseInheritProperty.FirePropertyChangeInAncestry(System.Windows.DependencyObject element, bool oldValue, MS.Internal.DeferredElementTreeState treeState, System.Action<System.Windows.DependencyObject,bool> originChangedAction) + 0xb7 bytes	
 	PresentationCore.dll!System.Windows.ReverseInheritProperty.FirePropertyChangeInAncestry(System.Windows.DependencyObject element, bool oldValue, MS.Internal.DeferredElementTreeState treeState, System.Action<System.Windows.DependencyObject,bool> originChangedAction) + 0x119 bytes	
 	PresentationCore.dll!System.Windows.ReverseInheritProperty.FirePropertyChangeInAncestry(System.Windows.DependencyObject element, bool oldValue, MS.Internal.DeferredElementTreeState treeState, System.Action<System.Windows.DependencyObject,bool> originChangedAction) + 0x119 bytes	
 	PresentationCore.dll!System.Windows.ReverseInheritProperty.FirePropertyChangeInAncestry(System.Windows.DependencyObject element, bool oldValue, MS.Internal.DeferredElementTreeState treeState, System.Action<System.Windows.DependencyObject,bool> originChangedAction) + 0x119 bytes	
 	PresentationCore.dll!System.Windows.ReverseInheritProperty.FirePropertyChangeInAncestry(System.Windows.DependencyObject element, bool oldValue, MS.Internal.DeferredElementTreeState treeState, System.Action<System.Windows.DependencyObject,bool> originChangedAction) + 0x119 bytes	
 	PresentationCore.dll!System.Windows.ReverseInheritProperty.FirePropertyChangeInAncestry(System.Windows.DependencyObject element, bool oldValue, MS.Internal.DeferredElementTreeState treeState, System.Action<System.Windows.DependencyObject,bool> originChangedAction) + 0x119 bytes	
 	PresentationCore.dll!System.Windows.ReverseInheritProperty.FirePropertyChangeInAncestry(System.Windows.DependencyObject element, bool oldValue, MS.Internal.DeferredElementTreeState treeState, System.Action<System.Windows.DependencyObject,bool> originChangedAction) + 0x119 bytes	
 	PresentationCore.dll!System.Windows.ReverseInheritProperty.FirePropertyChangeInAncestry(System.Windows.DependencyObject element, bool oldValue, MS.Internal.DeferredElementTreeState treeState, System.Action<System.Windows.DependencyObject,bool> originChangedAction) + 0x119 bytes	
 	PresentationCore.dll!System.Windows.ReverseInheritProperty.FirePropertyChangeInAncestry(System.Windows.DependencyObject element, bool oldValue, MS.Internal.DeferredElementTreeState treeState, System.Action<System.Windows.DependencyObject,bool> originChangedAction) + 0x119 bytes	
 	PresentationCore.dll!System.Windows.ReverseInheritProperty.FirePropertyChangeInAncestry(System.Windows.DependencyObject element, bool oldValue, MS.Internal.DeferredElementTreeState treeState, System.Action<System.Windows.DependencyObject,bool> originChangedAction) + 0x119 bytes	
 	PresentationCore.dll!System.Windows.ReverseInheritProperty.FirePropertyChangeInAncestry(System.Windows.DependencyObject element, bool oldValue, MS.Internal.DeferredElementTreeState treeState, System.Action<System.Windows.DependencyObject,bool> originChangedAction) + 0x119 bytes	
 	PresentationCore.dll!System.Windows.ReverseInheritProperty.FirePropertyChangeInAncestry(System.Windows.DependencyObject element, bool oldValue, MS.Internal.DeferredElementTreeState treeState, System.Action<System.Windows.DependencyObject,bool> originChangedAction) + 0x119 bytes	
 	PresentationCore.dll!System.Windows.ReverseInheritProperty.FirePropertyChangeInAncestry(System.Windows.DependencyObject element, bool oldValue, MS.Internal.DeferredElementTreeState treeState, System.Action<System.Windows.DependencyObject,bool> originChangedAction) + 0x119 bytes	
 	PresentationCore.dll!System.Windows.ReverseInheritProperty.FirePropertyChangeInAncestry(System.Windows.DependencyObject element, bool oldValue, MS.Internal.DeferredElementTreeState treeState, System.Action<System.Windows.DependencyObject,bool> originChangedAction) + 0x119 bytes	
 	PresentationCore.dll!System.Windows.ReverseInheritProperty.FirePropertyChangeInAncestry(System.Windows.DependencyObject element, bool oldValue, MS.Internal.DeferredElementTreeState treeState, System.Action<System.Windows.DependencyObject,bool> originChangedAction) + 0x119 bytes	
 	PresentationCore.dll!System.Windows.ReverseInheritProperty.FirePropertyChangeInAncestry(System.Windows.DependencyObject element, bool oldValue, MS.Internal.DeferredElementTreeState treeState, System.Action<System.Windows.DependencyObject,bool> originChangedAction) + 0x119 bytes	
 	PresentationCore.dll!System.Windows.ReverseInheritProperty.FirePropertyChangeInAncestry(System.Windows.DependencyObject element, bool oldValue, MS.Internal.DeferredElementTreeState treeState, System.Action<System.Windows.DependencyObject,bool> originChangedAction) + 0x119 bytes	
 	PresentationCore.dll!System.Windows.ReverseInheritProperty.OnOriginValueChanged(System.Windows.DependencyObject oldOrigin, System.Windows.DependencyObject newOrigin, System.Collections.Generic.IList<System.Windows.DependencyObject> otherOrigins, ref MS.Internal.DeferredElementTreeState oldTreeState, System.Action<System.Windows.DependencyObject,bool> originChangedAction) + 0xb6 bytes	
 	PresentationCore.dll!System.Windows.Input.KeyboardDevice.ChangeFocus(System.Windows.DependencyObject focus, int timestamp) + 0x521 bytes	
 	PresentationCore.dll!System.Windows.Input.KeyboardDevice.TryChangeFocus(System.Windows.DependencyObject newFocus, System.Windows.Input.IKeyboardInputProvider keyboardInputProvider, bool askOld, bool askNew, bool forceToNullIfFailed) + 0x1f9 bytes	
 	PresentationCore.dll!System.Windows.Input.KeyboardDevice.Focus(System.Windows.DependencyObject focus, bool askOld, bool askNew, bool forceToNullIfFailed) + 0x9d bytes	
 	PresentationCore.dll!System.Windows.Input.KeyboardDevice.Focus(System.Windows.IInputElement element) + 0x3b bytes	
 	PresentationCore.dll!System.Windows.UIElement.Focus() + 0x18 bytes	
 	PresentationFramework.dll!System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonDown(System.Windows.Input.MouseButtonEventArgs e) + 0x43 bytes	
 	PresentationCore.dll!System.Windows.UIElement.OnMouseLeftButtonDownThunk(object sender, System.Windows.Input.MouseButtonEventArgs e) + 0x59 bytes	
 	PresentationCore.dll!System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(System.Delegate genericHandler, object genericTarget) + 0x2c bytes	
 	PresentationCore.dll!System.Windows.RoutedEventArgs.InvokeHandler(System.Delegate handler, object target) + 0x33 bytes	
 	PresentationCore.dll!System.Windows.RoutedEventHandlerInfo.InvokeHandler(object target, System.Windows.RoutedEventArgs routedEventArgs) + 0x44 bytes	
 	PresentationCore.dll!System.Windows.EventRoute.InvokeHandlersImpl(object source, System.Windows.RoutedEventArgs args, bool reRaised) + 0x1a8 bytes	
 	PresentationCore.dll!System.Windows.UIElement.ReRaiseEventAs(System.Windows.DependencyObject sender, System.Windows.RoutedEventArgs args, System.Windows.RoutedEvent newEvent) + 0x108 bytes	
 	PresentationCore.dll!System.Windows.UIElement.OnMouseDownThunk(object sender, System.Windows.Input.MouseButtonEventArgs e) + 0xee bytes	
 	PresentationCore.dll!System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(System.Delegate genericHandler, object genericTarget) + 0x2c bytes	
 	PresentationCore.dll!System.Windows.RoutedEventArgs.InvokeHandler(System.Delegate handler, object target) + 0x33 bytes	
 	PresentationCore.dll!System.Windows.RoutedEventHandlerInfo.InvokeHandler(object target, System.Windows.RoutedEventArgs routedEventArgs) + 0x44 bytes	
 	PresentationCore.dll!System.Windows.EventRoute.InvokeHandlersImpl(object source, System.Windows.RoutedEventArgs args, bool reRaised) + 0x1a8 bytes	
 	PresentationCore.dll!System.Windows.UIElement.RaiseEventImpl(System.Windows.DependencyObject sender, System.Windows.RoutedEventArgs args) + 0x73 bytes	
 	PresentationCore.dll!System.Windows.UIElement.RaiseTrustedEvent(System.Windows.RoutedEventArgs args) + 0x3d bytes	
 	PresentationCore.dll!System.Windows.UIElement.RaiseEvent(System.Windows.RoutedEventArgs args, bool trusted) + 0x40 bytes	
 	PresentationCore.dll!System.Windows.Input.InputManager.ProcessStagingArea() + 0x1f8 bytes	
 	PresentationCore.dll!System.Windows.Input.InputManager.ProcessInput(System.Windows.Input.InputEventArgs input) + 0x45 bytes	
 	PresentationCore.dll!System.Windows.Input.InputProviderSite.ReportInput(System.Windows.Input.InputReport inputReport) + 0x62 bytes	
 	PresentationCore.dll!System.Windows.Interop.HwndMouseInputProvider.ReportInput(System.IntPtr hwnd, System.Windows.Input.InputMode mode, int timestamp, System.Windows.Input.RawMouseActions actions, int x, int y, int wheel) + 0x272 bytes	
 	PresentationCore.dll!System.Windows.Interop.HwndMouseInputProvider.FilterMessage(System.IntPtr hwnd, MS.Internal.Interop.WindowMessage msg, System.IntPtr wParam, System.IntPtr lParam, ref bool handled) + 0x3bb bytes	
 	PresentationCore.dll!System.Windows.Interop.HwndSource.InputFilterMessage(System.IntPtr hwnd, int msg, System.IntPtr wParam, System.IntPtr lParam, ref bool handled) + 0x6c bytes	
 	WindowsBase.dll!MS.Win32.HwndWrapper.WndProc(System.IntPtr hwnd, int msg, System.IntPtr wParam, System.IntPtr lParam, ref bool handled) + 0x9b bytes	
 	WindowsBase.dll!MS.Win32.HwndSubclass.DispatcherCallbackOperation(object o) + 0x6b bytes	
 	WindowsBase.dll!System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate callback, object args, int numArgs) + 0x56 bytes	
 	WindowsBase.dll!MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(object source, System.Delegate method, object args, int numArgs, System.Delegate catchHandler) + 0x3a bytes	
 	WindowsBase.dll!System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority priority, System.TimeSpan timeout, System.Delegate method, object args, int numArgs) + 0x10e bytes	
 	WindowsBase.dll!MS.Win32.HwndSubclass.SubclassWndProc(System.IntPtr hwnd, int msg, System.IntPtr wParam, System.IntPtr lParam) + 0xf1 bytes	
 	[Native to Managed Transition]	
 	[Managed to Native Transition]	
 	WindowsBase.dll!System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame frame) + 0xae bytes	
 	WindowsBase.dll!System.Windows.Threading.Dispatcher.PushFrame(System.Windows.Threading.DispatcherFrame frame) + 0x49 bytes	
 	PresentationFramework.dll!System.Windows.Window.ShowHelper(object booleanBox) + 0x13a bytes	
 	PresentationFramework.dll!System.Windows.Window.Show() + 0x5c bytes	
 	PresentationFramework.dll!System.Windows.Window.ShowDialog() + 0x27d bytes	
>	eKlient.exe!eKlient.MainWindow.btnPridatKlienta_Click(Object sender, System.Windows.RoutedEventArgs e) Line 254 + 0x1a bytes	Basic
 	PresentationCore.dll!System.Windows.RoutedEventHandlerInfo.InvokeHandler(object target, System.Windows.RoutedEventArgs routedEventArgs) + 0x7a bytes	
 	PresentationCore.dll!System.Windows.EventRoute.InvokeHandlersImpl(object source, System.Windows.RoutedEventArgs args, bool reRaised) + 0x1a8 bytes	
 	PresentationCore.dll!System.Windows.UIElement.RaiseEventImpl(System.Windows.DependencyObject sender, System.Windows.RoutedEventArgs args) + 0x73 bytes	
 	PresentationCore.dll!System.Windows.UIElement.RaiseEvent(System.Windows.RoutedEventArgs e) + 0x29 bytes	
 	PresentationFramework.dll!System.Windows.Controls.Primitives.ButtonBase.OnClick() + 0x3b bytes	
 	PresentationFramework.dll!System.Windows.Controls.Button.OnClick() + 0x45 bytes	
 	PresentationFramework.dll!System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(System.Windows.Input.MouseButtonEventArgs e) + 0x84 bytes	
 	PresentationCore.dll!System.Windows.UIElement.OnMouseLeftButtonUpThunk(object sender, System.Windows.Input.MouseButtonEventArgs e) + 0x59 bytes	
 	PresentationCore.dll!System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(System.Delegate genericHandler, object genericTarget) + 0x2c bytes	
 	PresentationCore.dll!System.Windows.RoutedEventArgs.InvokeHandler(System.Delegate handler, object target) + 0x33 bytes	
 	PresentationCore.dll!System.Windows.RoutedEventHandlerInfo.InvokeHandler(object target, System.Windows.RoutedEventArgs routedEventArgs) + 0x44 bytes	
 	PresentationCore.dll!System.Windows.EventRoute.InvokeHandlersImpl(object source, System.Windows.RoutedEventArgs args, bool reRaised) + 0x1a8 bytes	
 	PresentationCore.dll!System.Windows.UIElement.ReRaiseEventAs(System.Windows.DependencyObject sender, System.Windows.RoutedEventArgs args, System.Windows.RoutedEvent newEvent) + 0x108 bytes	
 	PresentationCore.dll!System.Windows.UIElement.OnMouseUpThunk(object sender, System.Windows.Input.MouseButtonEventArgs e) + 0xc7 bytes	
 	PresentationCore.dll!System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(System.Delegate genericHandler, object genericTarget) + 0x2c bytes	
 	PresentationCore.dll!System.Windows.RoutedEventArgs.InvokeHandler(System.Delegate handler, object target) + 0x33 bytes	
 	PresentationCore.dll!System.Windows.RoutedEventHandlerInfo.InvokeHandler(object target, System.Windows.RoutedEventArgs routedEventArgs) + 0x44 bytes	
 	PresentationCore.dll!System.Windows.EventRoute.InvokeHandlersImpl(object source, System.Windows.RoutedEventArgs args, bool reRaised) + 0x1a8 bytes	
 	PresentationCore.dll!System.Windows.UIElement.RaiseEventImpl(System.Windows.DependencyObject sender, System.Windows.RoutedEventArgs args) + 0x73 bytes	
 	PresentationCore.dll!System.Windows.UIElement.RaiseTrustedEvent(System.Windows.RoutedEventArgs args) + 0x3d bytes	
 	PresentationCore.dll!System.Windows.UIElement.RaiseEvent(System.Windows.RoutedEventArgs args, bool trusted) + 0x40 bytes	
 	PresentationCore.dll!System.Windows.Input.InputManager.ProcessStagingArea() + 0x1f8 bytes	
 	PresentationCore.dll!System.Windows.Input.InputManager.ProcessInput(System.Windows.Input.InputEventArgs input) + 0x45 bytes	
 	PresentationCore.dll!System.Windows.Input.InputProviderSite.ReportInput(System.Windows.Input.InputReport inputReport) + 0x62 bytes	
 	PresentationCore.dll!System.Windows.Interop.HwndMouseInputProvider.ReportInput(System.IntPtr hwnd, System.Windows.Input.InputMode mode, int timestamp, System.Windows.Input.RawMouseActions actions, int x, int y, int wheel) + 0x272 bytes	
 	PresentationCore.dll!System.Windows.Interop.HwndMouseInputProvider.FilterMessage(System.IntPtr hwnd, MS.Internal.Interop.WindowMessage msg, System.IntPtr wParam, System.IntPtr lParam, ref bool handled) + 0x3f4 bytes	
 	PresentationCore.dll!System.Windows.Interop.HwndSource.InputFilterMessage(System.IntPtr hwnd, int msg, System.IntPtr wParam, System.IntPtr lParam, ref bool handled) + 0x6c bytes	
 	WindowsBase.dll!MS.Win32.HwndWrapper.WndProc(System.IntPtr hwnd, int msg, System.IntPtr wParam, System.IntPtr lParam, ref bool handled) + 0x9b bytes	
 	WindowsBase.dll!MS.Win32.HwndSubclass.DispatcherCallbackOperation(object o) + 0x6b bytes	
 	WindowsBase.dll!System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate callback, object args, int numArgs) + 0x56 bytes	
 	WindowsBase.dll!MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(object source, System.Delegate method, object args, int numArgs, System.Delegate catchHandler) + 0x3a bytes	
 	WindowsBase.dll!System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority priority, System.TimeSpan timeout, System.Delegate method, object args, int numArgs) + 0x10e bytes	
 	WindowsBase.dll!MS.Win32.HwndSubclass.SubclassWndProc(System.IntPtr hwnd, int msg, System.IntPtr wParam, System.IntPtr lParam) + 0xf1 bytes	
 	[Native to Managed Transition]	
 	[Managed to Native Transition]	
 	WindowsBase.dll!System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame frame) + 0xae bytes	
 	WindowsBase.dll!System.Windows.Threading.Dispatcher.PushFrame(System.Windows.Threading.DispatcherFrame frame) + 0x49 bytes	
 	WindowsBase.dll!System.Windows.Threading.Dispatcher.Run() + 0x4b bytes	
 	PresentationFramework.dll!System.Windows.Application.RunDispatcher(object ignore) + 0x17 bytes	
 	PresentationFramework.dll!System.Windows.Application.RunInternal(System.Windows.Window window) + 0x6f bytes	
 	PresentationFramework.dll!System.Windows.Application.Run(System.Windows.Window window) + 0x26 bytes	
 	PresentationFramework.dll!System.Windows.Application.Run() + 0x1b bytes	
 	eKlient.exe!eKlient.Application.Main() Line 78 + 0xa bytes	Basic
 	[Native to Managed Transition]	
 	[Managed to Native Transition]	
 	mscorlib.dll!System.AppDomain.nExecuteAssembly(System.Reflection.RuntimeAssembly assembly, string[] args) + 0x9 bytes	
 	mscorlib.dll!System.Runtime.Hosting.ManifestRunner.Run(bool checkAptModel) + 0x6f bytes	
 	mscorlib.dll!System.Runtime.Hosting.ManifestRunner.ExecuteAsAssembly() + 0x90 bytes	
 	mscorlib.dll!System.Runtime.Hosting.ApplicationActivator.CreateInstance(System.ActivationContext activationContext, string[] activationCustomData) + 0x65 bytes	
 	mscorlib.dll!System.Runtime.Hosting.ApplicationActivator.CreateInstance(System.ActivationContext activationContext) + 0xd bytes	
 	mscorlib.dll!System.Activator.CreateInstance(System.ActivationContext activationContext) + 0x44 bytes	
 	Microsoft.VisualStudio.HostingProcess.Utilities.dll!Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssemblyDebugInZone() + 0x20 bytes	
 	mscorlib.dll!System.Threading.ThreadHelper.ThreadStart_Context(object state) + 0x6f bytes	
 	mscorlib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) + 0xa7 bytes	
 	mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) + 0x16 bytes	
 	mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state) + 0x41 bytes	
 	mscorlib.dll!System.Threading.ThreadHelper.ThreadStart() + 0x44 bytes	
 	[Native to Managed Transition]	

nahlásit spamnahlásit spam 0 odpovědětodpovědět

Tak už jsem našel co způsobuje tu chybu resp. v XAMLu definice datagridu je toto CellStyle="{DynamicResource DataGridCellStyleVerticalCenter}"

Když to dám pryč chyba nevznikne. A teď čím to je?

Tady je definice toho stylu, který je v Application.xaml

        <Style x:Key="DataGridCellStyleVerticalCenter" TargetType="{x:Type DataGridCell}">
            <Setter Property="Background" Value="Transparent"/>
            <Setter Property="BorderBrush" Value="Transparent"/>
            <Setter Property="BorderThickness" Value="1"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type DataGridCell}">
                        <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="True">
                            <ContentPresenter ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" ContentStringFormat="{TemplateBinding ContentStringFormat}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="Center"/>
                        </Border>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
            <Style.Triggers>
                <Trigger Property="IsSelected" Value="True">
                    <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
                    <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.HighlightTextBrushKey}}"/>
                    <Setter Property="BorderBrush" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
                </Trigger>
                <Trigger Property="IsKeyboardFocusWithin" Value="True">
                    <Setter Property="BorderBrush" Value="{DynamicResource {ComponentResourceKey ResourceId=FocusBorderBrushKey, TypeInTargetAssembly={x:Type DataGrid}}}"/>
                </Trigger>
                <MultiTrigger>
                    <MultiTrigger.Conditions>
                        <Condition Property="IsSelected" Value="True"/>
                        <Condition Property="Selector.IsSelectionActive" Value="False"/>
                    </MultiTrigger.Conditions>
                    <Setter Property="Background" Value="{DynamicResource}"/>
                    <Setter Property="BorderBrush" Value="{DynamicResource}"/>
                    <Setter Property="Foreground" Value="{DynamicResource}"/>
                </MultiTrigger>
                <Trigger Property="IsEnabled" Value="False">
                    <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
                </Trigger>
            </Style.Triggers>
        </Style>

Napádá mě jestli by to nemohlo být těmi TemplateColumns, ale i když jsem všechny tři vyhodil chyba byla stejně takže v tom to asi nebude..

Někdo nějaký nápad kde je problém?

nahlásit spamnahlásit spam 0 odpovědětodpovědět

Chyba je v těchto řádkách v MultiTrigger:

<Setter Property="Background" Value="{DynamicResource}"/>
<Setter Property="BorderBrush" Value="{DynamicResource}"/>
<Setter Property="Foreground" Value="{DynamicResource}"/>

Nejsou tam uvedeny názvy resourců.

nahlásit spamnahlásit spam 0 odpovědětodpovědět

Já jsem dal jenom upravit aktuální template a dopsal jsem tam vertikální vystředění nic jinýho...

Tak jsem ty 3 řádky zakomentoval a už je to OK.

Teď zbývá vyřešit tento problém: http://www.dotnetportal.cz/forum/tema/15...

a to proč je datagrid při cca 400 řádcích hrozně pomalý..

Díky moc za pomoc

nahlásit spamnahlásit spam 0 odpovědětodpovědět

Vytáhl jsem výchozí styl a přidal VerticalAlignment="Center", výsledek správného stylu je tento:

<Style x:Key="DataGridCellStyleVerticalCenter" TargetType="{x:Type DataGridCell}">
    <Setter Property="Background" Value="Transparent"/>
    <Setter Property="BorderBrush" Value="Transparent"/>
    <Setter Property="BorderThickness" Value="1"/>
    <Setter Property="Template">
        <Setter.Value>
            <ControlTemplate TargetType="{x:Type DataGridCell}">
                <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="True">
                    <ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="Center"/>
                </Border>
            </ControlTemplate>
        </Setter.Value>
    </Setter>
    <Style.Triggers>
        <Trigger Property="IsSelected" Value="True">
            <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
            <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.HighlightTextBrushKey}}"/>
            <Setter Property="BorderBrush" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
        </Trigger>
        <Trigger Property="IsKeyboardFocusWithin" Value="True">
            <Setter Property="BorderBrush" Value="{DynamicResource {x:Static DataGrid.FocusBorderBrushKey}}"/>
        </Trigger>
        <MultiTrigger>
            <MultiTrigger.Conditions>
                <Condition Property="IsSelected" Value="true"/>
                <Condition Property="Selector.IsSelectionActive" Value="false"/>
            </MultiTrigger.Conditions>
            <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.InactiveSelectionHighlightBrushKey}}"/>
            <Setter Property="BorderBrush" Value="{DynamicResource {x:Static SystemColors.InactiveSelectionHighlightBrushKey}}"/>
            <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.InactiveSelectionHighlightTextBrushKey}}"/>
        </MultiTrigger>
        <Trigger Property="IsEnabled" Value="false">
            <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
        </Trigger>
    </Style.Triggers>
</Style>
nahlásit spamnahlásit spam 0 odpovědětodpovědět

Díky...

Divný je že jsem dal jenom kopírovat a upravit. Dopsal tam to vystředění a nic víc.. A že to tam chybělo je podezřelé, ale budiž... Hlavně že se na to přišlo... Díky moc

nahlásit spamnahlásit spam 0 odpovědětodpovědět

Ješte kdyby někdo věděl jak vyřešit toto díky: http://www.dotnetportal.cz/forum/tema/15...

nahlásit spamnahlásit spam 0 odpovědětodpovědět
                       
Nadpis:
Antispam: Komu se občas házejí perly?
Příspěvek bude publikován pod identitou   anonym.
  • Administrátoři si vyhrazují právo komentáře upravovat či mazat bez udání důvodu.
    Mazány budou zejména komentáře obsahující vulgarity nebo porušující pravidla publikování.
  • Pokud nejste zaregistrováni, Vaše IP adresa bude zveřejněna. Pokud s tímto nesouhlasíte, příspěvek neodesílejte.

přihlásit pomocí externího účtu

přihlásit pomocí jména a hesla

Uživatel:
Heslo:

zapomenuté heslo

 

založit nový uživatelský účet

zaregistrujte se

 
zavřít

Nahlásit spam

Opravdu chcete tento příspěvek nahlásit pro porušování pravidel fóra?

Nahlásit Zrušit

Chyba

zavřít

feedback