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

Adding a Button Column to Autogenerated Grid

1 Answer 20 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Joe
Top achievements
Rank 1
Joe asked on 02 Jul 2013, 10:35 PM
Hello!
Relatively new with Telerik, but I will try my best to explain:
I have a RadGrid where I used

<telerik:RadGrid Width="95%" ID="pogrid" runat="server" AutoGenerateColumns="true" OnColumnCreated="Grid_ColumnCreated" CellSpacing="0" >
    </telerik:RadGrid></div>
and in the Grid_ColumnCreated event, I set some of the properties for those columns..
protected void Grid_ColumnCreated(object sender, Telerik.Web.UI.GridColumnCreatedEventArgs e)
        {
            if (e.Column is GridBoundColumn)
            {
                GridBoundColumn col = (GridBoundColumn)e.Column;
                if (col.DataTypeName != "System.DateTime")
                {
                    col.AllowFiltering = true;  ...


Is there a way that I can make one of the columns a LinkButton? I am looking to fire a report by passing a variable belonging to the item whose button was clicked. Thank you!!!

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 1
answered on 03 Jul 2013, 06:11 AM
Hi Joe,

I'm not sure about your requirements,I guess you want to add a column along with the autogenerated column.
You can add a GridHyperLinkColumn or a GridTemplateColumn .Please have a look at this documentation.It describes about adding columns pragmatically.
Programmatic Creation

Hope this Helps,
Thanks,
Princy
Tags
Grid
Asked by
Joe
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 1
Share this question
or