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

How do the typical grid cells determine cell border color information.

2 Answers 94 Views
GridView
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 1
David asked on 12 Oct 2010, 03:49 PM
I've created a custom GridViewColumn, along with a custom CellElement, inheriting from GridCommandCellElement, and by default, the GridCommandCellElement does not have DrawBorder set to true.  When I set it to true, it draws a border that is a different color than, say, a GridViewTextBoxElement within the same grid.  How does the GridViewTextBoxElement know to draw it's own border as the light blue color it is currently drawing it with, as opposed to the black color my custom element is being drawn with, and how can I fetch that value?

Thanks, 

David

2 Answers, 1 is accepted

Sort by
0
Accepted
Emanuel Varga
Top achievements
Rank 1
answered on 12 Oct 2010, 04:13 PM
Hello David,

The custom cell does not have any borders because you forgot to set the ThemeEffectiveType for the cell, just add this property to the CustomCell and you will have a border by default without having to set DrawBorder to true

protected override Type ThemeEffectiveType
{
    get
    {
        return typeof(GridDataCellElement);
    }
}

Hope this helps, if you have any other questions or comments, please let me know,

Best Regards,
Emanuel Varga
0
David
Top achievements
Rank 1
answered on 12 Oct 2010, 04:21 PM
That was perfect, thanks!
Tags
GridView
Asked by
David
Top achievements
Rank 1
Answers by
Emanuel Varga
Top achievements
Rank 1
David
Top achievements
Rank 1
Share this question
or