Quantcast
Channel: Internet Explorer Web Development forum
Viewing all articles
Browse latest Browse all 3527

How to add column format on a webgrid in .cs file(asp.net mvc3.0)

$
0
0

Thanks for reading

When we add a webgrid column format on cshtml file, we often write code as below:

grid.Gethtml(columns:grid.Columns(grid.Column(format:(item)=>new HtmlString(Ajax.ActionLink("Next","someAction","someControllerName", new{....},new AjaxOptions{......})).ToString())))

now I want to create a webGridColumn list in .cs file, when I was adding column format, I could not make through. this is my code below:

WebGridColumn column = new WebGridColumn();

column.Format=(item=> new HtmlString(AjaxExtensions.ActionLink(thisAjaxHelper....).ToString());

we need a AjaxHelper here, but how can I get a instance or create one. Please teach me


loveslut



Viewing all articles
Browse latest Browse all 3527

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>