How? setting DataGridView row error text and indicator

L

Lee Gillie

I am using the DataGridView in virtual mode.
I respond to data needed, RowErrorTextNeeded, and such.
I have done a number of these sorts of apps just fine.

Trying to indicate error conditions for selected rows which I am about
to perform a complex operation for, showing a different error perhaps
for each row. Lets test by setting error condition for all selected rows...

I have the ShowRowErrors set to TRUE, and respond to RowErrorTextNeeded,
which debugger shows me is being called, and I even call
UpdateRowErrorText. But I have yet to see an error glyph in the row
header or error message / error tooltip anywhere.

Whadam I doin wrong?


' Attempting to set error and error text for all selected rows
RowErrors.Clear()
dgvCurrentTime.ShowRowErrors = True

For Each dgvr In dgvCurrentTime.SelectedRows

idx = dgvCurrentTime.Rows.IndexOf(dgvr)

' NEITHER OF THIS SHOW THE ERROR GLYPH OR MY ROW ERROR MESSAGE
dgvCurrentTime.Rows(idx).ErrorText = "problem"
RowErrors.Add(idx, "problem")
' RowErrors is a dictionary keyed on row index for
' responding to RowErrorTextNeeded

dgvCurrentTime.UpdateRowErrorText(idx)
' Does cause my RowErrorTextNeeded to be called, though
' It just won't show it in the grid!! Why even ask then?
Next
 
L

Lee Gillie

I could find no way to get the error icon to appear except for one
single row at a time. Not what I needed.

So I eliminated the header column, and added an image column, and I
reflect add/edit state myself, as well as the error indicator I need for
indicating feedback individualized for each row when performing
multi-row operations.

Seems short sighted and artificially constrained, that you can not do
that with a row header though.

- Lee
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top