I am attempting to do a compare of values from three dropdowns in a grid edit form:
If the selected value from any of the dropdowns matches the dropdown from any other dropdown then I would like to be able to stop the update somehow.
This posts the message but I am not sure how to stop the update.
Here is the item created:
Here is the index changed:
If the selected value from any of the dropdowns matches the dropdown from any other dropdown then I would like to be able to stop the update somehow.
This posts the message but I am not sure how to stop the update.
Here is the item created:
protected void gvEdit_ItemCreated(object sender, Telerik.Web.UI.GridItemEventArgs e) { if (e.Item is GridEditableItem && e.Item.IsInEditMode) { DropDownList list1 = (e.Item as GridEditableItem)["GridDropDownColumn999111"].Controls[0] as DropDownList; list1.AutoPostBack = true; list1.SelectedIndexChanged += new System.EventHandler(this.list1_SelectedIndexChanged); DropDownList list2 = (e.Item as GridEditableItem)["GridDropDownColumn9992"].Controls[0] as DropDownList; list2.AutoPostBack = true; list2.SelectedIndexChanged += new System.EventHandler(this.list2_SelectedIndexChanged); DropDownList list3 = (e.Item as GridEditableItem)["GridDropDownColumn9993"].Controls[0] as DropDownList; list3.AutoPostBack = true; list3.SelectedIndexChanged += new System.EventHandler(this.list3_SelectedIndexChanged); } }Here is the index changed:
protected void list1_SelectedIndexChanged(object sender, System.EventArgs e) { String x = "System 1, System 2, and System 3 must have different values"; DisplayMessage(y); } protected void list2_SelectedIndexChanged(object sender, System.EventArgs e) { String x = "System 1, System 2, and System 3 must have different values"; DisplayMessage(x); } protected void list3_SelectedIndexChanged(object sender, System.EventArgs e) { String x = "System 1, System 2, and System 3 must have different values"; DisplayMessage(x); }