DataGridView and Row

  • Thread starter Thread starter Meelis
  • Start date Start date
M

Meelis

Hi


Im using on my form standard DataGridView
I need special properties for DataGridViewRow and so i created class that
inherits DataGridViewRow.
Created my own properties for example FieldID

Now i define new row, set property value and add this new row to grid

Dim oRow as New clsRow
clsRow.FieldID=100
theGrid.Rows.Add(oRow)


But when i want to get selected rows property value its alwys 0!!

Dim oRow as clsRow
oRow=theGrid.CurrentRow
MsgBox(oRow.FieldID)

value is alwys 0!

when i make same thing with ListView and ListViewItem, then all works fine!

Any ideas?

Best regards;
Meelis
 
hmmm

if i call oRow.CreateCells(theGrid)
and set oRow.Cells(0).Value="" then all works

whats going on?

Meelis
 
Back
Top