DataGridView.currentCell bytes

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Luckie
    New Member
    • Jun 2009
    • 4

    DataGridView.currentCell bytes

    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.CurrentC ell.Value = 22

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

    3- MyGrid.BeginEdi t(True)
    3- MyGrid.CurrentC ell.Value = strData

    Thanks in advance
    Luckie
  • Plater
    Recognized Expert Expert
    • Apr 2007
    • 7872

    #2
    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

    Comment

    • Luckie
      New Member
      • Jun 2009
      • 4

      #3
      Daragridview.cu rrentcell.value bytes

      Thanks for your interest
      No did you notice that the virtual mode = true
      Thanks

      Comment

      • Luckie
        New Member
        • Jun 2009
        • 4

        #4
        DataGridView

        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(B yVal sender As System.Object, ByVal e As System.EventArg s) Handles Button1.Click

        DataGridView1.R ows(DataGridVie w1.CurrentCell. RowIndex).Cells (DataGridView1. CurrentCell.Col umnIndex).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

        Comment

        • Luckie
          New Member
          • Jun 2009
          • 4

          #5
          Same again

          Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As System.EventArg s) Handles Button1.Click
          DataGridView1.B eginEdit(False)
          DataGridView1.R ows(0).Cells(0) .Value = 12234
          DataGridView1.R ows(0).Cells(1) .Selected = True
          End Sub

          even here its click twice to fill the first one

          Comment

          Working...