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

Style and position edit & delete columns

3 Answers 123 Views
Grid
This is a migrated thread and some comments may be shown as answers.
AMF
Top achievements
Rank 2
AMF asked on 21 Nov 2011, 12:28 PM
Hi all,

I would like to know how I can style the edit & the delete buttons and still use the auto generate columns option.
I can get both columns add the beginning of the grid, with text Edit & Delete,  I would like to know how I can get both columns add the end of the grid, and use an image for the edit and delete buttons.

thanks.

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 21 Nov 2011, 12:44 PM
Hello,

You can use GridEditCommandColumn and GridButtonColumn for this purpose.
aspx:
<Columns>
. . . .
<telerik:GridEditCommandColumn EditImageUrl="Images/editButton.gif" CancelImageUrl="Images/CancelButton.gif"></telerik:GridEditCommandColumn>
<telerik:GridButtonColumn ButtonType="ImageButton" ImageUrl="Images/DeleteButton.gif"></telerik:GridButtonColumn>
</Columns>
0
AMF
Top achievements
Rank 2
answered on 21 Nov 2011, 01:17 PM
Thanks Shinu for your fast response. 
Perhaps you could also tell me how I can get these columns at the end of the Grid?

0
Shinu
Top achievements
Rank 2
answered on 22 Nov 2011, 06:35 AM
Hello

Since you are using AutoGeneratedColumns, you can swap the columns as shown below.
C#:
protected void grid_PreRender(object sender, EventArgs e)
{
grid.MasterTableView.SwapColumns("DeleteColumnUniqueName","ColumnUniqueName1");
grid.MasterTableView.SwapColumns("EditCommandColumnUniqueName", "ColumnUniqueName2");
}

-Shinu.
Tags
Grid
Asked by
AMF
Top achievements
Rank 2
Answers by
Shinu
Top achievements
Rank 2
AMF
Top achievements
Rank 2
Share this question
or