how to make Gridviewcombobox column element not selectable based on some condition, and also how to set that element background colour to some other colour(like gray).
Thanks
Uday
1 Answer, 1 is accepted
0
Stefan
Telerik team
answered on 02 Jul 2012, 07:52 AM
Hi Uday,
Thank you for writing.
The correct place to disable a CellElement is the CellFormatting event. Here is a small sample demonstrating how to do that upon some condition:
public Form1()
{
InitializeComponent();
GridViewDecimalColumn c = new GridViewDecimalColumn("id");
radGridView1.Columns.Add(c);
GridViewComboBoxColumn col = new GridViewComboBoxColumn("combo col");
radGridView1.Columns.Add(col);
col.DataSource = new string[] { "asd", "qwe", "zxc" };
radGridView1.Rows.Add(1, "asd");
radGridView1.Rows.Add(2, "qwe");
radGridView1.Rows.Add(3, "zxc");
radGridView1.CellFormatting += new CellFormattingEventHandler(radGridView1_CellFormatting);