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

GridViewCommandColumn Not Filling Cell

1 Answer 51 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Paul Patterson
Top achievements
Rank 1
Paul Patterson asked on 16 Jul 2010, 04:15 PM
Hi all,

I created a GridViewCommandColumn for a grid. When the grid is rendered it appears that the button (command column) is sized based on the cell padding. 

How do I adjust the column so that the command appears to fill the entire cell?

(see example attached)

Any advice is appreciated,

Paul

1 Answer, 1 is accepted

Sort by
0
Paul Patterson
Top achievements
Rank 1
answered on 16 Jul 2010, 04:58 PM
I found the solution - setting the padding of the cell element using the ViewCellFormatting event...

C#
private void gridviewAssetChecklist_ViewCellFormatting(object sender, Telerik.WinControls.UI.CellFormattingEventArgs e)
{
    if ((e.CellElement) is GridCommandCellElement) {
        e.CellElement.Padding = new Padding(0);
    }
 
}

Cheers, 

Paul
Tags
GridView
Asked by
Paul Patterson
Top achievements
Rank 1
Answers by
Paul Patterson
Top achievements
Rank 1
Share this question
or