protected void btnAddDropDownListValidation_Click(object sender, EventArgs e)
{
// ExStart:AddDropDownListValidation
// Accessing the cells collection of the worksheet that is currently active
GridWorksheet sheet = GridWeb1.WorkSheets[GridWeb1.ActiveSheetIndex];
// Access "B1" cell and add some text
GridCell cell = sheet.Cells[0, 1];
cell.PutValue("Select Degree:");
// Accessing "C1" cell
cell = sheet.Cells[0, 2];
// Creating DropDownList validation for the "C1" cell
var validation = cell.CreateValidation(GridValidationType.DropDownList, true);
// Adding values to DropDownList validation
var values = new System.Collections.Specialized.StringCollection();
values.Add("Bachelor");
values.Add("Master");
values.Add("Doctor");
validation.ValueList = values;
// ExEnd:AddDropDownListValidation
}
}