如何使用checklstbox设置数据网格的行的颜色 [英] how to set the colour of rows of a datagrid using checklstbox
本文介绍了如何使用checklstbox设置数据网格的行的颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
这些天我正在研究数据网格.
我有一个清单框,其中包含一些诸如鞋子品牌名称之类的内容.我想要的是每当我检查任何品牌时,包含该品牌的所有行都将在datagrid中以颜色显示.
hello to all,
i am working on a datagrid these days.
i have a checklist box containing some items say like shoes brands name. what i want is whenever i check any brand, all the row containing that brand will be displayed with color in datagrid.
推荐答案
为该复选框创建回发该复选框,以检查寄件者所在行的复选框
create a postback for the checkbox that checks which checkbox in which row was the sender
CheckBox isClickedCheckBox = (CheckBox)Sender; GridViewRow row = (GridViewRow)isClickedCheckBox.NamingContainer; GridView.SelectedIndex = row.RowIndex; row.BackColor = Color.PickAColor;
或使用javascript
or use javascript
这篇关于如何使用checklstbox设置数据网格的行的颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文