Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
985
How to find object bound to the row
posted

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)

Parents
No Data
Reply
  • 24671
    Verified Answer
    posted

    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

Children