We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

how to perform validation for dropdown in gridview

e-columns="columns"
class="gridStyle"
e-allowresizing="true"
e-allowkeyboardnavigation="true"
e-allowscrolling="true"
e-allowsorting="true"
e-minwidth="550"
e-isresponsive="true"
e-scrollsettings-height="320"
>
var dropList = [
{ empid: "SelectedRowIndex", text: "SelectedRowIndex" }, { empid: "ViewRecord", text: "ViewRecord" }
];
var data = [
{ OrderID: 10248, EmployeeID: 1 },
{ OrderID: 10249, EmployeeID: 2 },
{ OrderID: 10250, EmployeeID: 3 },
{ OrderID: 10251, EmployeeID: 4 },
{ OrderID: 10252, EmployeeID: 5 }
];
$scope.setTargetList = function (targetList) {
$scope.data = data;
$scope.list = dropList
}
If we generate column in this way into grid than how to perform validation with column using jquery add method
for dropdown
2) if I will include extra textbox and in this way how to perform validation for that extra textbox.

1 Reply

RU Ragavee U S Syncfusion Team September 23, 2015 11:27 AM UTC

Hi Bharat,

We are quite unclear on your query to perform validation with dropdown column.

As of now, we have created a sample with validation: {required: true} to the dropdown column, which can be downloaded from the following location.

Sample Link: http://jsplayground.syncfusion.com/lye0q1x3

In the above sample, we have bound dropDown dataSource with one blank value. On selecting the blank value on editing and saving, the validation message is popped.

Query: if I will include extra textbox and in this way how to perform validation for that extra textbox.

By above query, do you mean to set validation for other columns upon adding/editing. We can set the jquery validation for the columns using the validation property under the ejGrid columns api. If your query differs from our understanding,

Please share the below details
1.       jquery validation rule that you are expecting to apply to the dropdown column
2.       Are you expecting to set validation to the dropdown column based on another column value
3.       Explain what you actually meant by “if I will include extra textbox and in this way how to perform validation for that extra textbox.
4.       Share more and clear details on your requirement.

Regards,
Ragavee U S

Loader.
Live Chat Icon For mobile
Up arrow icon