c# - Is there a way to have alternating row colors in WinForm Table -


I am new to all things. Net, and some small changes were worked out. I see that I see there is a method of attracting allRows in the code if I do this, then I can get the rows in alternate color:

  if (line Index% 2 == 0) {backColor = grayColor; } And {backColor = Color.White; }   

It works by default. However, because there is a kind of capacity, it will not always be right because the rows are supported. Is there a default way to do this in properties? Or some other method of achieving this effect? Thank you.

What type of component are you using? In A AlternatingRowsDefaultCellStyle is the property that allows you to do exactly the same things you want here.

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -