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

Adding Delete Link button to the last column of the Radgrid.

8 Answers 217 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Sushanth
Top achievements
Rank 1
Sushanth asked on 21 Aug 2008, 07:17 AM
I want to add a column says "Delete Link Button" to the last column of the RadGrid which is already binded with the datasource

Can any one help me for this issue..

Thanks & Regards, 
Sushanth Mathew 

8 Answers, 1 is accepted

Sort by
0
Konstantin Petkov
Telerik team
answered on 21 Aug 2008, 08:04 AM
Hello Sushanth,

You can use GridButtonColumn for this purpose. Here is an example:

        <telerik:RadGrid ID="RadGrid1" runat="server" OnNeedDataSource="RadGrid1_NeedDataSource"
            <MasterTableView> 
                <Columns> 
                    <telerik:GridButtonColumn ButtonType="LinkButton" CommandName="Delete"></telerik:GridButtonColumn> 
                </Columns> 
            </MasterTableView> 
        </telerik:RadGrid> 
 


The easiest way to add that is through the Property Builder Design-time. I suggest you review the Getting Started help article available here.

You can also review the live demos as the one below which uses such column:

http://www.telerik.com/DEMOS/ASPNET/Prometheus/Grid/Examples/DataEditing/UserControlEditForm/DefaultCS.aspx

Best wishes,
Konstantin Petkov
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Sushanth
Top achievements
Rank 1
answered on 21 Aug 2008, 10:32 AM
Hai,

Thank you for your respons.

I can be able to create the Delete Link Button at the design time. But its come before the autogenerate column.
As i told you the columns are autogenerated, these columns are comes only after the Delete Link Button if i add the link button in the design time.
I want to place this Delete Link Button after the autogenerated column.


Thanks & Regards,
Sushanth Matehw
0
Konstantin Petkov
Telerik team
answered on 21 Aug 2008, 11:21 AM
Hi Sushanth,

You can use auto generated delete column for this purpose:

        <telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateDeleteColumn="True" ..>   
            ... 
        </telerik:RadGrid> 
 

Best wishes,
Konstantin Petkov
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Sushanth
Top achievements
Rank 1
answered on 21 Aug 2008, 11:53 AM
Hai

 I tried that option also, now am giving the AutoGenerateColumns= True; AutoGenerateDeleteColumn="True".
 But still the Delete Link Button is comming at the last position. Is it possible for me to place the Delete Link Button in the last column.

Thanks & Regards,
Sushanth Mathew


0
Shinu
Top achievements
Rank 2
answered on 22 Aug 2008, 07:11 AM
Hi Sushanth,

One suggestion will be to swap the autogenerated delete column with the last column as shown below.

CS:
protected void RadGrid2_PreRender(object sender, EventArgs e) 
    { 
        RadGrid2.MasterTableView.SwapColumns("AutoGeneratedDeleteColumn", "LastColumnUniqueName");  
     


Thanks
Shinu.
0
Sushanth
Top achievements
Rank 1
answered on 25 Aug 2008, 11:20 AM
Hai

Since my columns are autogenerated how will i add the unique name for the last column.  Then only i can be able to give the swap function in the prerender as you mentioned.


Thanks & Regards,
Sushanth Mathew
0
Princy
Top achievements
Rank 2
answered on 25 Aug 2008, 12:28 PM
Hello Sushanth,

The UniqueName of AutoGeneratedColumns is automatically set as the DataField of the Column.

Princy
0
Sushanth
Top achievements
Rank 1
answered on 25 Aug 2008, 01:02 PM
Hai,

Thank you very much. That issue has solved.

Regards,
Sushanth Matehw
Tags
Grid
Asked by
Sushanth
Top achievements
Rank 1
Answers by
Konstantin Petkov
Telerik team
Sushanth
Top achievements
Rank 1
Shinu
Top achievements
Rank 2
Princy
Top achievements
Rank 2
Share this question
or