WPF ListBox获取选中的值
程序员文章站
2022-03-02 12:05:48
...
private void DG1_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
ListBoxItem item = new ListBoxItem
{
Content = (DG1.SelectedItem as DataRowView).Row["SQL"].ToString(),
};
ListBox_Result.Items.Add(item);
}