We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

How to show link column in Grid using Razor views

Hello,

I am trying to show one of grid column as link column. I found the sample for .aspx page as below

column.Add("Delete").HeaderText("Delete Record").Format("Delete");

but how can I format same in Razor view?

I tried to use same code in razor view but it didn't work. A quick reply will be appreciated.

Thanks
Rajesh




1 Reply

ES Eswari S Syncfusion Team December 13, 2011 04:41 PM UTC

Hi Rajesh,

Thank you for using Syncfusion products.

We have prepared the sample for your requirement with Unbound column and the same can be downloaded from the following link:

Sample-1107725.zip

Please refer to the following code snippets:

@( Html.Syncfusion().Grid("SampleGrid")
.Datasource(Model)
.Caption("Orders")
.Column(col =>
{
. . . .
col.Add(c => c.OrderDate);
col.Add(c => c.ShipCountry);

col.Add("Delete").HeaderText("Delete Record").Format("Delete"); // hyperlink column which is directed to DeleteRecord action in home controller.

})

)

Also, we would request you to check our online Sample link:

http://mvc.syncfusion.com/sfmvcsamplebrowser/9.4.0.62/Grid_MVC/Samples/4.0/Razor/GettingStarted/UnBoundColumn

Please try this and let us know if you need any further assistance.

Regards,
Eswari.S






Loader.
Live Chat Icon For mobile
Up arrow icon