which will contain a button to implement custom logic. The problem with this is that when I edit or insert a row, the grid editing form contains a field named "Custom column". Now, since no data is ever associated to this field, which is there just to contain the button, what should I do in order not to display this field in the grid editing form?

this looks a little risky..isn't there a cleaner way to pass these parameters to the function?

2) In future requirements which I'll have to meet, I'll also need to change the button text (at least) and possibly style (like background, foreground) depending, for example, on the value of a model property "IsEnabled" (for instance: if, for the current row, IsEnable = true, then the button should contain the text "Navigate" with a green background. Otherwise, if IsEnable = false, then the button should contain the text "Check" with a red background)

Thanks for the kind help and keep up with this excellent technical support =)

1.For Query 1, you have mentioned to pass the parameter to the function. Could you please let us know exactly what you have to achieve?

let's say that my model is as follows:

public class MyModel

{

public Int32 Id {get;set;}

public Int32 ForeignKey1{ get; set; }

public Int32 ForeignKey2{ get; set; }

public bool Condition { get; set; }}

my requirement is: for each row of the grid which contains the model, a button must be displayed in an unbound column (so that column doesn't appear in the grid editing dialog). Each row button should have a different style (for ex. text and background) based on the value of bool Condition:

Then, when I click a row button, if Condition is true (for that row) the button calls an action of a controller passing ForeignKey1 through GET.

If Condition is false (for that row) the button calls an action of a different controller, passing ForeignKey2 through GET.

2.For Query 2, did you need to change the button background and text based on the other field (value of the model property)?

Yes, as explained previously the background and text of the button should depend on the "Condition" boolean of the model.