格式形如指定 | ID号 | 名称 | 年龄 | // 头部
-------------------------------
checkbox | 数据 | 数据 | 数据 | // 记录1
-------------------------------
checkbox | 数据 | 数据 | 数据 | // 记录2这个控件的数据基本上来源于数据库
可以实现,checkbox全选中和全解除或单选,多选最后根据被选中的checkbox,来确定如何对某条或多条数据
输入其它文件或其它的操作最好给的是通用的控件,不是某个个人开发的。
也可以简单说说操作思路。
多谢!
-------------------------------
checkbox | 数据 | 数据 | 数据 | // 记录1
-------------------------------
checkbox | 数据 | 数据 | 数据 | // 记录2这个控件的数据基本上来源于数据库
可以实现,checkbox全选中和全解除或单选,多选最后根据被选中的checkbox,来确定如何对某条或多条数据
输入其它文件或其它的操作最好给的是通用的控件,不是某个个人开发的。
也可以简单说说操作思路。
多谢!
http://www.syncfusion.com/faq/winforms/Files/DataGridTextBoxCombo.zip
========================
// Step 1. Derive a custom column style from DataGridTextBoxColumn
// a) add a ComboBox member
// b) track when the combobox has focus in Enter and Leave events
// c) override Edit to allow the ComboBox to replace the TextBox
// d) override Commit to save the changed data
// Step 2 - Use the combo column style
// Add 1 col with combo style
DataGridComboBoxColumn ComboTextCol = new DataGridComboBoxColumn();
ComboTextCol.MappingName = "custCity";
ComboTextCol.HeaderText = "Customer Address";
ComboTextCol.Width = 100;
ts1.GridColumnStyles.Add(ComboTextCol);
// Step 3 - Additional setup for Combo style
// a) make the row height a little larger to handle minimum combo height
ts1.PreferredRowHeight = ComboTextCol.ColumnComboBox.Height + 3;
// b) Populate the combobox somehow. It is a normal combobox, so whatever...
ComboTextCol.ColumnComboBox.Items.Clear();
ComboTextCol.ColumnComboBox.Items.Add("Chicago");
ComboTextCol.ColumnComboBox.Items.Add("Corvallis");
ComboTextCol.ColumnComboBox.Items.Add("Denver");
ComboTextCol.ColumnComboBox.Items.Add("Great Falls");
ComboTextCol.ColumnComboBox.Items.Add("Kansas City");
ComboTextCol.ColumnComboBox.Items.Add("Los Angeles");
ComboTextCol.ColumnComboBox.Items.Add("Raleigh");
ComboTextCol.ColumnComboBox.Items.Add("Washington");
// c) set the dropdown style of the combo...
ComboTextCol.ColumnComboBox.DropDownStyle = ComboBoxStyle.DropDownList;
谢谢copine(),chengpei_chen() 。下面这个方法更有针对性
quote from
http://www.syncfusion.com/faq/windowsforms/search/754.aspxDataGridColumnStyle boolCol = new DataGridBoolColumn();
boolCol.MappingName = "custID";
boolCol.HeaderText = "指定";
ts1.GridColumnStyles.Add(boolCol);