Connecting Tech Pros Worldwide Forums | Help | Site Map

DataGridView.currentCell bytes

Luckie's Avatar
Newbie
 
Join Date: Jun 2009
Location: Computers and Music
Posts: 4
#1: Jun 12 '09
Hi All experts there,
I am developing a software using datagridview (vb6 feels better) and i am using virtualMode.

it shows the focus blue box but it is not possible to fill data to the first cell programatically. what is wrong here.

also i have used from within a button_click event as follows

1- MyGrid.CurrentCell.Value = 22

2- MyGrid.Rows(0).Cells(0).value = 22

3- MyGrid.BeginEdit(True)
3- MyGrid.CurrentCell.Value = strData

Thanks in advance
Luckie

Plater's Avatar
Moderator
 
Join Date: Apr 2007
Location: New England
Posts: 7,270
#2: Jun 12 '09

re: DataGridView.currentCell bytes


You are saying you cannot progmatically edit the values in your DataGridView object? Hmm.
This line should have worked:
MyGrid.Rows(0).Cells(0).value = 22
Luckie's Avatar
Newbie
 
Join Date: Jun 2009
Location: Computers and Music
Posts: 4
#3: Jun 12 '09

re: DataGridView.currentCell bytes


Thanks for your interest
No did you notice that the virtual mode = true
Thanks
Luckie's Avatar
Newbie
 
Join Date: Jun 2009
Location: Computers and Music
Posts: 4
#4: Jun 13 '09

re: DataGridView.currentCell bytes


forget the last one

just draged a datagridview and a button on to the stage
created a colomn list for the datagrid at design time

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

DataGridView1.Rows(DataGridView1.CurrentCell.RowIn dex).Cells(DataGridView1.CurrentCell.ColumnIndex). Value = 90000
'now how to rightarrow key for the DataGridView1
'so the data will be gone into the cell and get the focus to the next cell
'actually i neew this action to create a row and make it ready to accept data
'inserted by a class or something
'this is not bound to any data source
'******** notice if you enter data directly a new row is created
'here it is not why?

End Sub
Luckie's Avatar
Newbie
 
Join Date: Jun 2009
Location: Computers and Music
Posts: 4
#5: Jun 13 '09

re: DataGridView.currentCell bytes


Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
DataGridView1.BeginEdit(False)
DataGridView1.Rows(0).Cells(0).Value = 12234
DataGridView1.Rows(0).Cells(1).Selected = True
End Sub

even here its click twice to fill the first one
Reply