We have a Iqueryable(of object) bound to the grid. In this grid we have a column with imagebuttons. When the button is pressed we want pass along the object of the row to our javascript function that is called popUp. The problem we are having is that right now we are only able to pass one single property to the function.
The code we use for this looks like this in VB.NET Razor syntax:
.Columns(Sub(column)coulmn.[For](Function(x) x.ViewRemarkDetailsPlaceHolder).FormatterFunction("function(val) {return '<input type=""image"" src=""../Resources/MagnifyingGlass.png"" align=""left"" onclick=""popUp()"">'; }").Width("25px").HeaderText(" ") End Sub)
Hi,
i would suggest to use templates (either rowTemplate or a column template) in order to achieve this functionality, it won't work with the formatter function. "this" will give you the current data context if you define a function and use it in the template.
Hope it helps. Thanks
Angel
Could you provide an example how to do this with a template?