I am doing project in ASP.net. I want to Change the color of the boxes in a datagrid. I have tried various method none of then worked out, if you are having knowledge about it, and then please give me that.
I am doing project in ASP.net. I want to Change the color of the boxes in a datagrid. I have tried various method none of then worked out, if you are having knowledge about it, and then please give me that.
You should check the code below and then by making use of the similar event you will able to get the solution for your issue.
Code:CheckBox CBox; CBox = (CheckBox)(e.Item.Cells[2].Controls[0]); if (CBox.Checked == true) e.Item.BackColor = Color.Red;
Try to understand following code given below which is solve your problem. In the following code I have use DataGridComboBoxColumn to perform this.
Code:DataGridComboBoxColumn column = (DataGridComboBoxColumn) DataG.TableStyles[0].GridColumnStyles[4]; column.combo.BackColor = Color.White; column.combo.ForeColor = Color.Green;
Bookmarks