This is a migrated thread and some comments may be shown as answers.

Row Border - Seperator?

3 Answers 112 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Raimund
Top achievements
Rank 1
Raimund asked on 09 Apr 2011, 10:24 AM
Hello,

im trying to give the border of a row a custom color. I tried everything - but the border on the bottom and on the top does not change ( the border between 2 rows)

Here is my current RowFormatting Event
void _radGV_RowFormatting(object sender, RowFormattingEventArgs e)
{
    e.RowElement.BorderBoxStyle = BorderBoxStyle.SingleBorder;
    e.RowElement.BorderGradientStyle = GradientStyles.Solid;
 
    if (e.RowElement.IsCurrent)
    {
        System.Drawing.Color c = System.Drawing.Color.LightBlue;
 
        e.RowElement.BackColor = c;
        e.RowElement.BackColor2 = c;
        e.RowElement.BackColor3 = c;
        e.RowElement.BackColor4 = c;
 
        e.RowElement.GradientStyle = GradientStyles.Solid;
        e.RowElement.BorderColor = c;
        e.RowElement.BorderColor2 = c;
        e.RowElement.BorderColor3 = c;
        e.RowElement.BorderColor4 = c;
    }
}

Attached is a picture if my description was a little bit unclear.

I would be very happy if someone knows where my problem or mistake is.

Greetings,
Raimund

//edit .. just noticed that i spelled "separator" wrong

3 Answers, 1 is accepted

Sort by
0
Raimund
Top achievements
Rank 1
answered on 09 Apr 2011, 10:39 AM
Also tried with BorderBottomColor and BorderTopColor

System.Drawing.Color c = System.Drawing.Color.LightBlue;
 
e.RowElement.BorderBottomColor = c;
e.RowElement.BorderBottomShadowColor = c;
 
e.RowElement.BorderTopColor = c;
e.RowElement.BorderTopShadowColor = c;

but does not work either
0
Accepted
Richard Slade
Top achievements
Rank 2
answered on 11 Apr 2011, 10:21 AM
Hello,

You can change the selected cell border color using the CellFormatting event. For exmaple

void radGridView1_CellFormatting(object sender, CellFormattingEventArgs e)
{
    if (e.CellElement.IsCurrent)
    {
        e.CellElement.BorderColor = System.Drawing.Color.Red;
    }
}

Hope that helps but let me know if you need further information
Richard
0
Raimund
Top achievements
Rank 1
answered on 16 Apr 2011, 04:14 PM
Hello Richard,

Im sorry that i replied so late. Your post helped a lot!

Thank you very much.

Regards,
Raimund
Tags
GridView
Asked by
Raimund
Top achievements
Rank 1
Answers by
Raimund
Top achievements
Rank 1
Richard Slade
Top achievements
Rank 2
Share this question
or