This project is read-only.

Change selected cell border

May 28, 2009 at 4:09 AM

Guys,

I'm sorry if this question had asked before.

How to change selected cell border with another color and another style (dot, dash, etc)?

Which method in the source code did this exactly?

 

Thank you.

 

JC

May 28, 2009 at 7:35 AM

There should be somewhere a "Border" property from a cell. Might be something like this myCell.View.Border

May 28, 2009 at 11:18 AM

Yes it was there..

SourceGrid.Cells.Views.Cell  viewNoBorder =new SourceGrid.Cells.Views.Cell();

  _viewNoBorder.Border = New DevAge.Drawing.RectangleBorder(DevAge.Drawing.BorderLine.NoBorder);
 grid1[row, 2].View =
_viewNoBorder;

 

But, this is not what i want. I want something like owner-draw-border, changing color and style. Can you help me?

 

Thank you

JC

May 28, 2009 at 12:13 PM

Take a look at sample 3 , you can get your need (Custom Border , Custom View , ...)

Jun 1, 2009 at 11:56 AM

@borchanii,

Thanks for the fast response. Any ideas how to create dash-dot border?

Thanks.

Jun 1, 2009 at 4:40 PM
Edited Jun 1, 2009 at 4:50 PM

It is easy , look you can create one specific border or more for the cell'rectangle then use them as your choice ( if you taked a look for the form 3 , you see you can create a border , specify it as dashDot , DashDotDot  ... , as you like :) )

this is a simple example

 BorderLine _Border = new BorderLine(Color.Red, 5);
  _Border.DashStyle = System.Drawing.Drawing2D.DashStyle.DashDot;

Jun 2, 2009 at 4:23 AM

@borchanii.

Thank you. I'll try.