问题要从gridview精炼数据 [英] Problem To refine data from gridview

查看:68
本文介绍了问题要从gridview精炼数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

我有一个gridview,我在gridview中绑定了数据,现在在gridview中绑定了100个数据.我通过使用itemtemplate在gridview中添加了一个checkboc控件.因此,当我单击标题的复选框时,所有复选框都将被选中或不可见,我可以选择.

因此,假设我从100中选择了20行,现在我想将20条记录放入我选择的DataTable中.

如何从gridview获取20条记录的详细信息.



谢谢...

Hello,

I have a gridview and I have bind data in gridview and now 100 data inside the gridview. There is a checkboc control I have added inside gridview by taking itemtemplate.So when I click the check box of header then all the check box will be selected or indivisuall I can select .

So Suppose I have selected 20 row out of hundred, Now i want to put the 20 records in a DataTable Which I have selected.

How Can I get the details of the 20 record from gridview.



Thanks...

推荐答案

检查此链接

http://stackoverflow.com/questions/1074378/c-sharp- datagridview-checkbox-checked-event-multiple-rows [ ^ ]

http ://tech.chitgoks.com/2008/11/17/c-add-select-all-deselect-all-checkbox-in-column-header-in-datagridview-control/ [ ^ ]

希望他们会引导您
check this links

http://stackoverflow.com/questions/1074378/c-sharp-datagridview-checkbox-checked-event-multiple-rows[^]

http://tech.chitgoks.com/2008/11/17/c-add-select-all-deselect-all-checkbox-in-column-header-in-datagridview-control/[^]

hope they will guide you


DataGridViewCheckBoxColumn checkboxColumn = new DataGridViewCheckBoxColumn();
checkboxColumn.Width = 30;
checkboxColumn.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
list.Columns.Insert(0, checkboxColumn);
 
// add checkbox header
Rectangle rect = list.GetCellDisplayRectangle(0, -1, true);
// set checkbox header to center of header cell. +1 pixel to position correctly.
rect.X = rect.Location.X + (rect.Width / 4);
 
CheckBox checkboxHeader = new CheckBox();
checkboxHeader.Name = "checkboxHeader";
checkboxHeader.Size = new Size(18, 18);
checkboxHeader.Location = rect.Location;
checkboxHeader.CheckedChanged += new EventHandler(checkboxHeader_CheckedChanged);
 
list.Controls.Add(checkboxHeader);


这篇关于问题要从gridview精炼数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆