Автоматическая строка DataGrid C# WPFC#

Место общения программистов C#
Anonymous
 Автоматическая строка DataGrid C# WPF

Сообщение Anonymous »

Я пытаюсь добавить DataGrid с помощью Feauture, чтобы Auto добавить строку в последнюю. Таким образом, если строка заполнена нажатием ввода вкладки или нажала новую строку.pack://application:,,,/font/GemunuLibre.ttf#Gemunu Librepack://application:,,,/font/Abel.ttf#Abelpack://application:,,,/font/FjallaOne.ttf#FjallaOnepack://application:,,,/font/Oswald.ttf#Oswaldpack://application:,,,/font/Cairo.ttf#Cairo
< /code>























































































































































< /code>

< /code>
C# CODE:using System;using System.Collections.Generic;using System.Collections.ObjectModel;using System.ComponentModel;using System.Linq;using System.Text;using System.Threading.Tasks;using System.Windows;using System.Windows.Controls;using System.Windows.Data;using System.Windows.Documents;using System.Windows.Input;using System.Windows.Media;using System.Windows.Media.Imaging;using System.Windows.Shapes;
< /code>
namespace PasswordManager.Presse.content{/// /// Logica di interazione per IpData_Window.xaml/// public partial class IpData_Window : Window, INotifyPropertyChanged{public ObservableCollection IpData { get; set; }
< /code>
public IpData_Window()
{
InitializeComponent();
IpData = new ObservableCollection();
DataContext = this;

DataGridIP.ItemsSource = IpData;
}

public class IPEntry
{
public string Descrizione { get; set; } = string.Empty;
public string IP { get; set; } = string.Empty;

// Costruttore vuoto richiesto dalla DataGrid per aggiungere nuove righe
public IPEntry() { }
}

public event PropertyChangedEventHandler PropertyChanged;
protected void OnPropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = null)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}

}
< /code>
}
< /code>
How i do i resolve or it's a bug?
Thanks!!
the problem is that worked for 1 time!

Подробнее здесь: https://stackoverflow.com/questions/794 ... -sharp-wpf

Вернуться в «C#»