I want to change the value & its backcolor of cell.
On Button1_Click,I m adding records to the Gridview.
On Button3_Click,I want to chnage the value of cell & its backcolor.
Suppose two Rows & two columns are there in Grdiview
1 10
2 20
Suppose I want to change the value of item(Row=2,Colomn=2) to 100. I change the value but i m not ablt to change the backcolor.Can somebody tell me?
Code:Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Try Dim row0 As String() = {TextBox1.Text, TextBox2.Text} DataGridView1.Rows.Add(row0) row0 = Nothing Catch ex As Exception MsgBox(ex.Message) End Try End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click Try DataGridView1.Item(1, 1).Value = 100 'What to write to chnage the cell color Catch ex As Exception MsgBox(ex.Message) End Try End Sub




Reply With Quote