Hello,
I am using the ColumnCreated handler in a RadGrid to set the .ButtonType and Alignment of the Edit and Delete Autogenerated columns. This is working but when I try to size the columns the alignment shifts left.
protected void grdSponsoredLinks_ColumnCreated(object sender, GridColumnCreatedEventArgs e) |
{ |
// Set the LinkButtons to show as Edit / Delete icons instead |
foreach ( GridColumn column in grdSponsoredLinks.MasterTableView.Columns ) |
{ |
if ( column.ColumnType == "GridButtonColumn" ) |
{ |
(column as GridButtonColumn).ButtonType = GridButtonColumnType.ImageButton; |
// (column as GridButtonColumn).ItemStyle.Width = Unit.Point(C_DEFAULT_EDITCOMMAND_COLUMN_WIDTH); |
(column as GridButtonColumn).ItemStyle.HorizontalAlign = HorizontalAlign.Center; |
} |
if ( column.ColumnType == "GridEditCommandColumn" ) |
{ |
(column as GridEditCommandColumn).ButtonType = GridButtonColumnType.ImageButton; |
(column as GridEditCommandColumn).ItemStyle.HorizontalAlign = HorizontalAlign.Center; |
} |
} |
If I uncomment out the line above the buttons align to the left.
Any suggestions would be welcomed.
Thanks