This is a migrated thread and some comments may be shown as answers.

[Solved] MVC Remote Validation not working while editing CheckBox in Grid

1 Answer 28 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Pavi
Top achievements
Rank 1
Pavi asked on 26 Sep 2012, 07:09 PM

I have a editable grid in which I have a boolean column. A validation needs to be performed so that the grid contains only one row with the boolean column set to true. I am using MVCs remote validation and it does not seem to work.

Here is my column,

 

columns.Bound(c => c.IsDefault).Title("Is Default").ClientTemplate("<input type='checkbox' disabled='disabled' name='CheckedIsDefault' <#= IsDefault? 'checked' : '' #> />").Width(50);

And here the remote validation attribute in my Model
[DisplayName("Is Default")]
  [Remote("AllowDefaultSelection", "Validation", AdditionalFields = "KeywordListId, id",HttpMethod = "POST")]
  public bool IsDefault { get; set; } 

Previously my column was a nullable boolean so the grid was rendered as a drop-down list with 3 options (not selected, true and false) the validation seems to work fine when it was a drop down list.

Thanks in advance for your help.

1 Answer, 1 is accepted

Sort by
0
Pavi
Top achievements
Rank 1
answered on 02 Oct 2012, 03:09 PM
Actually I don't think the nullable boolean has anything to do with the issue. But can anybody atleast point me to a Telerik inline editing grid example that uses MVC's Remote validation????? Is it even possible to use remote validation? Or should I just look for another way to perform my validation.

Anybody? Please!
Tags
Grid
Asked by
Pavi
Top achievements
Rank 1
Answers by
Pavi
Top achievements
Rank 1
Share this question
or