Home All Groups Group Topic Archive Search About

change colour of the selectedrow in datagridview

Author
10 Jun 2009 2:32 PM
friend
hello all,

How to change the colour of  the selectedrow in datagridview ??

thank you..

Author
10 Jun 2009 3:26 PM
Appr3nt1c3
On 10 Hun, 22:32, friend <lavanyaredd***@gmail.com> wrote:
> hello all,
>
> How to change the colour of  the selectedrow in datagridview ??
>
> thank you..

do it in the paint event.

sample (untested)
'-------------------------
for each orow as datagridviewrow in dg.rows
if orow.selected then
orow.style.backcolor = <desired back color>
orow.style.forecolor = <desired foreground color>
end if
next

hth,
'------------------------------
diego