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

Add a button to every row in RadGrid

1 Answer 1156 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Meghna
Top achievements
Rank 1
Meghna asked on 20 Jul 2016, 02:57 AM

Hi all,

I need to add a replace button to every row in the RadGrid. Any help is appreciated

My code is as follows

<div>     

<telerik:RadGrid ID="grdVwPrecisionsources" runat="server" OnNeedDataSource="PrecisionSourcesDataGrid" Width="60%">        

<ClientSettings>                            

 <Resizing AllowColumnResize="true" ResizeGridOnColumnResize="true" AllowResizeToFit="true" />                         

</ClientSettings>       

</telerik:RadGrid>

<div>

ascx.cs

protected void PrecisionSourcesDataGrid(object sender, EventArgs e)         

{                    

var table = new DataTable();             

table.Columns.Add("Source");             

table.Columns.Add("ID");             

table.Columns.Add("Name");             

table.Columns.Add("Date");                          

table.Columns.Add("Reminder");                          

table.Columns.Add("Status");             

table.Columns.Add(" ", typeof(string));       - This needs to be button column             

table.Rows.Add("Point", "M6-515", "Co-57", "8/30/2016", "1 week to expiration", "Replace in 40 days", "");             

table.Rows.Add("Point", "M6-515", "Co-57", "8/30/2016", "1 week to expiration", "Replace in 40 days", "");             

grdVwPrecisionsources.DataSource = table;      

   }

1 Answer, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 22 Jul 2016, 02:52 PM
Hello,

Simply add ButtonColumn in the Grid definition:
table.Columns.Add("Name", typeof(string));
 
<telerik:GridButtonColumn Text='<%# Eval("Name") %>'
    UniqueName="NameColumn" >
</telerik:GridButtonColumn>


Regards,
Maria Ilieva
Telerik by Progress
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Tags
Grid
Asked by
Meghna
Top achievements
Rank 1
Answers by
Maria Ilieva
Telerik team
Share this question
or