Hi:
I have to to be persistent, but I can get the validation to be ignored. First the code (view):
Code behind:
and data for the data source (in App_Code):
Now place a break point in the code behind on the _i int. Now launch the page. Click the button and all works as expected (does not submit and the * indicates a validation error). Now delete the text, and tab out and delete the text again and tab out (the combo-box should be empty now). Now click the button and the validation control does NOT stop the submit, and if you check the SelectedValue the combo-box is empty.
Phil
I have to to be persistent, but I can get the validation to be ignored. First the code (view):
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %><%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %><!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"> <title></title></head><body> <form id="form1" runat="server"> <telerik:RadScriptManager ID="RadScriptManager1" runat="server"></telerik:RadScriptManager> <div> <telerik:RadComboBox ID="haulerDropDown" runat="server" DataSourceID = "haulerDataSource" DataTextField="Text" DataValueField="Value" AllowCustomText="true" Width="200" > </telerik:RadComboBox> <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ControlToValidate="haulerDropDown" ValidationGroup="HeaderValidationGroup" ErrorMessage="'Hauler' is required" Text="*" ForeColor="Red" /> </div> <asp:Button ID="Button1" runat="server" Text="Button" ValidationGroup="HeaderValidationGroup" /> <asp:ObjectDataSource ID="haulerDataSource" runat="server" SelectMethod="Hauler" TypeName="App.DropDowns"> </asp:ObjectDataSource> </form> </body></html>Option Strict OnOption Explicit OnPartial Class _Default Inherits System.Web.UI.Page Protected Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click Dim _value As String = haulerDropDown.SelectedValue Dim _i As Integer = 1 End SubEnd ClassOption Strict OnOption Explicit OnImports Microsoft.VisualBasicNamespace App Public Class DropDown Public Property Value() As String Public Property Text() As String Public Property Selected() As Boolean Public Sub New() Me.Value = "" Me.Text = "" Me.Selected = False End Sub Public Sub New(ByVal value As String, ByVal text As String) Me.Value = value Me.Text = text Me.Selected = False End Sub Public Sub New(ByVal value As String, ByVal text As String, ByVal selected As Boolean) Me.Value = value Me.Text = text Me.Selected = selected End Sub End Class ' Public Class DropDowns Public Function Hauler() As List(Of DropDown) Dim _dropDown As List(Of DropDown) = _ New List(Of DropDown) From { _ New DropDown With {.Value = "9 Point", .Text = "9 Point"}, _ New DropDown With {.Value = "R. A.", .Text = "R. A."}, _ New DropDown With {.Value = "A. B.", .Text = "A. B."}, _ New DropDown With {.Value = "B. C.", .Text = "B. C."}, _ New DropDown With {.Value = "Beck", .Text = "Beck"}} Return _dropDown End Function End ClassEnd NamespacePhil