By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,168 Members | 2,548 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,168 IT Pros & Developers. It's quick & easy.

DataGridView and Row

P: n/a
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


Apr 1 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
sry, typo in my last post

clsRow.FieldID showld be oRow.FieldID
Meelis

"Meelis" <me*@hot.ee> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
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

Apr 1 '06 #2

P: n/a
hmmm

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

whats going on?

Meelis

"Meelis" <me*@hot.ee> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
sry, typo in my last post

clsRow.FieldID showld be oRow.FieldID
Meelis

"Meelis" <me*@hot.ee> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
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


Apr 1 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.