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"
                            ItemType="MYCOMPANY.BusinessData.BusinessObjects.Participant"  
                            AutoGenerateColumns="False" AutoGenerateDeleteColumn="true"
                            AutoGenerateEditColumn="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" 
                                PageSize="12">
                                    <Columns>
                                    <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" />

                                        </ColumnValidationSettings>
                                    </telerik:GridBoundColumn>

     

     

    Thanks in advance!

    Michael

  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