Setting A Datagrid Cell Border At Runtime

I

Iain Wilson

Hi All

I would like to set the width of the bottom line of a datagrid row at
runtime.

I know how to set the complete lines style color etc at runtime but I
cannot figure how to change the line.

eg

e.Item.BackColor = Color.Cornsilk;

Is it possible ?

Thanks in advance for any assistance offered

Iain
 
J

jake

Is your grid a DataGridView? If so, are you referring to the
DividerHeight? If so, it is as simple as:

grid.Rows[x].DividerHeight = <int value> (in default units, mine is
pixels)

The one drawback is that it does not add to the height of the row (in
fact, it takes away from the height.) But you can independently
increase the height of that row.
Also, it takes on the color of the foreground color of the grid.

Hope this helps,
jake
 
I

Ignacio Machin ( .NET/ C# MVP )

Hi All

I would like to set the width of the bottom line of a datagrid row at
runtime.

I know how to set the complete lines style color etc at runtime but I
cannot figure how to change the line.

eg

e.Item.BackColor   = Color.Cornsilk;

Is it possible ?

Thanks in advance for any assistance offered

Iain

is this a win or a web app?
for a web app IIRC you can set the CSS style for each row if you need
to do so.
for a win app I do not know if you can do it
 

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