Thanks, yes. I tried something similar which also gave me some values for e:
Private Sub DataGridView1_CellEnter(ByVal sender As Object, ByVal e As
System.Windows.Forms.DataGridViewCellEventArgs) Handles
DataGridView1.CellEnter
Console.WriteLine(DataGridView1.Columns(e.ColumnIn dex).Name.ToString
& " " & DataGridView1.Rows(e.RowIndex).ToString)
Console.WriteLine("*" &
DataGridView1.Rows(e.RowIndex).Cells(e.ColumnIndex ).Value.ToString & "*")
End Sub
I guess I will just have to play around with the datagridview to get the
hang of it. Would you know how to individually format a cell in a datagrid
view? I noticed that if I do this:
Private Sub DataGridView1_CellFormatting(ByVal sender As Object, ByVal e As
System.Windows.Forms.DataGridViewCellFormattingEve ntArgs) Handles
DataGridView1.CellFormatting
e.CellStyle.ForeColor = Color.Red
e.CellStyle.BackColor = Color.Yellow
End Sub
all the cells in the grid have red text and a yellow background. How can I
do that only to the cell that I click?
"james" wrote:
"Rich" <Ri**@discussions.microsoft.com> wrote in message
news:41**********************************@microsof t.com... Hello,
If I want to update data displayed in a datagrideview/datagridview cell,
how
can I determine what cell I am updating? I am looking at the click event
below, for example. Can I get information from the sender object or the
EventArgs? How?
Private Sub DataGridView1_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles DataGridView1.Click
Console.WriteLine("row number of cell is ?")
Console.Writeline("Column Name of Cell is ?")
End Sub
Thanks,
Rich
I did this by having an event handler of:
private sub dViewWeek_CellMouseDown(ByVal sender As Object, ByVal e as
DataGridViewCellMouseEventArgs)
then you get e.ColumnIndex and e.RowIndex