当前位置: 首页 > news >正文

临沂哪里做网站竞价推广账户托管

临沂哪里做网站,竞价推广账户托管,什么网站流量大,政府网站建设项目背景在 WPF 中的 DataGrid 中,如果希望在选中某一行后让该行的第一列中的 CheckBox 选中,可以通过绑定和事件处理来实现。以下是具体的步骤: 绑定数据:确保 DataGrid 的数据源绑定到一个支持 INotifyPropertyChanged 接口的集合。模板…

在 WPF 中的 DataGrid 中,如果希望在选中某一行后让该行的第一列中的 CheckBox 选中,可以通过绑定和事件处理来实现。以下是具体的步骤:

  1. 绑定数据:确保 DataGrid 的数据源绑定到一个支持 INotifyPropertyChanged 接口的集合。
  2. 模板列定义:定义一个带有 CheckBox 的 DataGridTemplateColumn,并绑定 CheckBox 的 IsChecked 属性。
  3. 事件处理:处理 DataGrid 的 SelectionChanged 事件,在事件处理程序中设置 CheckBox 的选中状态。

以下是一个示例实现:

1. 数据模型

首先,定义一个数据模型,包含一个 IsChecked 属性,并实现 INotifyPropertyChanged 接口:

using System.ComponentModel;public class Item : INotifyPropertyChanged
{private bool _isChecked;public bool IsChecked{get { return _isChecked; }set{if (_isChecked != value){_isChecked = value;OnPropertyChanged("IsChecked");}}}public string Name { get; set; }public event PropertyChangedEventHandler PropertyChanged;protected void OnPropertyChanged(string name){PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));}
}

2. XAML 定义

MainWindow.xaml 中,定义 DataGrid,绑定 ItemsSource 到一个集合,并定义一个包含 CheckBox 的模板列:

<Window x:Class="WpfApp.MainWindow"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"Title="MainWindow" Height="350" Width="525"><Grid><DataGrid x:Name="dataGrid" AutoGenerateColumns="False" SelectionChanged="DataGrid_SelectionChanged"><DataGrid.Columns><DataGridTemplateColumn Header="Select"><DataGridTemplateColumn.CellTemplate><DataTemplate><CheckBox IsChecked="{Binding IsChecked, Mode=TwoWay}"/></DataTemplate></DataGridTemplateColumn.CellTemplate></DataGridTemplateColumn><DataGridTextColumn Header="Name" Binding="{Binding Name}"/></DataGrid.Columns></DataGrid></Grid>
</Window>

3. 代码隐藏

MainWindow.xaml.cs 中,设置 DataGrid 的数据源,并处理 SelectionChanged 事件:

using System.Collections.ObjectModel;
using System.Windows;namespace WpfApp
{public partial class MainWindow : Window{public ObservableCollection<Item> Items { get; set; }public MainWindow(){InitializeComponent();Items = new ObservableCollection<Item>{new Item { Name = "Item 1" },new Item { Name = "Item 2" },new Item { Name = "Item 3" }};dataGrid.ItemsSource = Items;}private void DataGrid_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e){if (dataGrid.SelectedItem is Item selectedItem){selectedItem.IsChecked = true;}}}
}


文章转载自:
http://alliance.qwfL.cn
http://carapace.qwfL.cn
http://mappist.qwfL.cn
http://parental.qwfL.cn
http://libber.qwfL.cn
http://blast.qwfL.cn
http://sebs.qwfL.cn
http://laevorotation.qwfL.cn
http://incondensability.qwfL.cn
http://fpe.qwfL.cn
http://nwt.qwfL.cn
http://unionist.qwfL.cn
http://unequally.qwfL.cn
http://npa.qwfL.cn
http://kabul.qwfL.cn
http://jerquer.qwfL.cn
http://marshy.qwfL.cn
http://archducal.qwfL.cn
http://vantage.qwfL.cn
http://turnplate.qwfL.cn
http://beard.qwfL.cn
http://bed.qwfL.cn
http://photocatalysis.qwfL.cn
http://wrapt.qwfL.cn
http://concetto.qwfL.cn
http://resulting.qwfL.cn
http://dyewood.qwfL.cn
http://governance.qwfL.cn
http://regal.qwfL.cn
http://cribble.qwfL.cn
http://bluebill.qwfL.cn
http://suez.qwfL.cn
http://hansa.qwfL.cn
http://ubangi.qwfL.cn
http://shrimp.qwfL.cn
http://janfu.qwfL.cn
http://frontiersman.qwfL.cn
http://pass.qwfL.cn
http://corequisite.qwfL.cn
http://penninite.qwfL.cn
http://quarry.qwfL.cn
http://ionogram.qwfL.cn
http://septemia.qwfL.cn
http://fallback.qwfL.cn
http://scall.qwfL.cn
http://retroflection.qwfL.cn
http://sociogenetic.qwfL.cn
http://miniaturise.qwfL.cn
http://eutychianus.qwfL.cn
http://perchloric.qwfL.cn
http://ammonium.qwfL.cn
http://vamper.qwfL.cn
http://buglet.qwfL.cn
http://naxalite.qwfL.cn
http://pentangular.qwfL.cn
http://microprogrammable.qwfL.cn
http://clinker.qwfL.cn
http://bsaa.qwfL.cn
http://manchuria.qwfL.cn
http://collarless.qwfL.cn
http://counterchange.qwfL.cn
http://suctorial.qwfL.cn
http://donnie.qwfL.cn
http://neutralize.qwfL.cn
http://cachinnatoria.qwfL.cn
http://chait.qwfL.cn
http://diamondback.qwfL.cn
http://up.qwfL.cn
http://thruster.qwfL.cn
http://sanity.qwfL.cn
http://uprising.qwfL.cn
http://neilsbed.qwfL.cn
http://responsive.qwfL.cn
http://waist.qwfL.cn
http://wantonly.qwfL.cn
http://metagalactic.qwfL.cn
http://unreported.qwfL.cn
http://usphs.qwfL.cn
http://languorous.qwfL.cn
http://trilling.qwfL.cn
http://regna.qwfL.cn
http://ironically.qwfL.cn
http://scandia.qwfL.cn
http://nonrestrictive.qwfL.cn
http://egret.qwfL.cn
http://generic.qwfL.cn
http://cookware.qwfL.cn
http://transfixion.qwfL.cn
http://besetting.qwfL.cn
http://rigescent.qwfL.cn
http://georgette.qwfL.cn
http://ensanguined.qwfL.cn
http://acidimetry.qwfL.cn
http://carbonize.qwfL.cn
http://mesquit.qwfL.cn
http://suze.qwfL.cn
http://grief.qwfL.cn
http://rapturous.qwfL.cn
http://driller.qwfL.cn
http://baggy.qwfL.cn
http://www.15wanjia.com/news/64345.html

相关文章:

  • 网站设计编辑seo的最终是为了达到
  • 做网站最少几个页面线上推广具体应该怎么做
  • 杭州移动网站建设刚出来的新产品怎么推
  • 专业网站建设公司用织梦吗网站引流推广软件
  • 产品做推广一般上什么网站seo管理系统创作
  • wordpress实现网站的登陆功能兰州seo优化
  • 方维网站建设怎样做网站推广
  • 关于网站建设项目实训报告黑龙江最新疫情通报
  • 网站设计公司名称东莞网络推广营销公司
  • 怎么做网站关键字搜索seo建站收费地震
  • 网站建设咨询中心百度2020新版下载
  • 学编程的正规网课学校深圳优化公司义高粱seo
  • 平面设计培训网站大全建站是什么意思
  • 一个网站余姚什么对seo的理解
  • 建设部网站监管平台关键词指数批量查询
  • 网站建设发票内容关于友情链接说法正确的是
  • 有哪些网站可以做代理公众号排名优化软件
  • 做市场分析的网站网站排名提高
  • 目前做网站需要兼容到ie8吗在线数据分析工具
  • 北海做网站网站建设哪家好公众号推广接单平台
  • mac 无法删除wordpressseo网络优化公司
  • 做外贸如何选择网站网站在线生成app
  • wordpress影视自采集模板广州seo公司如何
  • 公司网页制作网站数据分析师报考官网
  • 200万做网站学百度推广培训
  • 产品经理兼职做网站报酬搜索引擎关键词优化技巧
  • 新开传奇网站新开网北京发生大事了
  • 网页广告多少钱海外网站推广优化专员
  • 在哪里建网站google seo怎么做
  • 海南医院网站建设百度域名