Validation not working on Model Bound Grid

2 posts, 0 answers
  1. Michael
    Michael avatar
    38 posts
    Member since:
    Mar 2009

    Posted 19 Apr Link to this post


    I can not get this simple required field validator column to trigger. I've followed the examples and tried various different syntax options. Can anyone shed lany light on why this isn't firing?

    <telerik:RadGrid ID="RadGrid1" runat="server" AllowAutomaticInserts="true" AllowPaging="true"
                            AutoGenerateColumns="False" AutoGenerateDeleteColumn="true"
                            GroupPanelPosition="Top" Skin="Metro">
                            <%--<ValidationSettings EnableValidation="true" CommandsToValidate="PerformInsert" />--%>
                            <MasterTableView CommandItemDisplay="Top" AllowAutomaticInserts="true" InsertItemDisplay="Top" DataKeyNames="ParticipantID" 
                                InsertMethod="insertParticipant" DeleteMethod="deleteParticipant" UpdateMethod="updateParticipant" SelectMethod="getParticipants" 
                                    <telerik:GridBoundColumn DataField="Username" HeaderText="Username" UniqueName="Username" ColumnEditorID="Username">
                                        <ColumnValidationSettings EnableRequiredFieldValidation="true" EnableModelErrorMessageValidation="true">
                                            <RequiredFieldValidator SetFocusOnError="true" ErrorMessage="* - Required Field" ForeColor="Red" Font-Bold="true" />
                                            <ModelErrorMessage ModelStateKey="Username" AssociatedControlID="Username" SetFocusOnError="true" ForeColor="Red"                                                   Font-Bold="true" />




    Thanks in advance!


  2. Michael
    Michael avatar
    38 posts
    Member since:
    Mar 2009

    Posted 19 Apr Link to this post

    I'm noticing that my classes don't have data annotations. Going to put them in and see if it helps.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top