How to hilight items on datagrid and listview controls?

  • Thread starter Thread starter Li Pang
  • Start date Start date
L

Li Pang

Very basic question, how to hilight an item (row) on
datagrid or listview controls?

Thanks

Li
 
The row is highlighted by clicking to the left of the row where the row
headers appear.

SelectionBackColor and forecolor properties allow you to select the colors
which the row will appear when selected.

Is that what you mean ?

OHM


Li said:
Very basic question, how to hilight an item (row) on
datagrid or listview controls?

Thanks

Li

Regards - OHM# (e-mail address removed)
 
Hi Li Pang,

That is cooperative, OHM for the datagrid and I take the listview

listview1.HideSelection = False

I hope this was what you where looking for?

Cor
 
Thanks Cor,
It works when the tab leaves listview control. Suppose I
load some data into listview, and want to hilight 3rd row,
how can I do so without interrupting it?
 
Hi Li Pang

To set the full row in the load event of the form
listview1.FullRowSelect = True

To select a row 3
listview1.Items(2).Selected = True

But if you use the selectedindex change event you have to prevent that from
firing with a flag/bool/switch or whatever you call it. ( I do not use that
with a listview)

I hope this works for you?

Cor
 
Back
Top