tags:

views:

155

answers:

1

how to change the color of the selected cell in datagrid.im using .net 1.1,and i need it windows applns.

if i click the a cell in row no 2 then particular cell color should be changed

+1  A: 

I suspect what you are looking for in .NET 1.1 is something like this:

DataGridTest.Rows(1).Cells(1).Style.Backcolor = Color.Red


The .NET2 equivalent would be something like:

DataGridViewCellStyle MakeItGreen = new DataGridViewCellStyle;
MakeItGreen.BackColor = Color.Green;

DataGridViewRow row2 = myGrid.Rows(2);
row2.Cells(2).Style = MakeItGreen

Or simply:

this.myDataGridView[2,3].Style.BackColor = Color.Green;

If this is not what you were looking for please provide more information in your question...

Sakkle
This is pretty much it for .NET2. OP wants it for .NET 1.1
Henk Holterman
Ah... I missed that
Sakkle
Edited to reflect this. I'm no .net 1.1 expert but this is what i found on msdn
Sakkle