RadGrid Edit / Update help needed

1 posts, 0 answers
  1. Bob
    Bob avatar
    15 posts
    Member since:
    Jun 2017

    Posted 26 Aug 2017 Link to this post

    I have a RadGrid on my web page and I populate the RadGrid from my SQL database.  The RadGrid displays correctly.  I can then click on the Edit icon and I then display an email address from the RadGrid.  I allow the user to modify the email address.  If the email address adheres to my RegEx expression and is valid then I update the email address in my database.  But if it is not valid, I want to display an error message directly to the right of the email address that displays when I click Edit.  I cannot figure out how to do this.  Can anyone provide an example on how to do this?

    Here is my aspx code:

    <telerik:RadGrid ID="gvEmailRedirectMaint"
                <GroupingSettings CollapseAllTooltip="Collapse all groups" CaseSensitive="false"></GroupingSettings>
                    <Resizing AllowColumnResize="true" AllowRowResize="true" ResizeGridOnColumnResize="false" ClipCellContentOnResize="true" EnableRealTimeResize="false"AllowResizeToFit="true" />
                <AlternatingItemStyle BackColor="#E0E0E0" />
                <MasterTableView AutoGenerateColumns="false" TableLayout="Auto" CommandItemDisplay="Top" DataKeyNames="ID" EditMode="EditForms">
                    <CommandItemSettings ShowAddNewRecordButton="false" ShowRefreshButton="false" />
                        <telerik:GridEditCommandColumn HeaderText="Edit:" ButtonType="ImageButton">
                            <HeaderStyle Width="50px" />
                            <ItemStyle Width="50px" />
                        <telerik:GridBoundColumn DataField="ID" AllowFiltering="false" HeaderText="ID" UniqueName="ID" ReadOnly="true" Visible="false">
                            <HeaderStyle Width="160px" />
                            <ItemStyle Width="160px" />
                        <telerik:GridBoundColumn DataField="VIPPreferredID" AllowFiltering="true" UniqueName="VIPPreferredID" ReadOnly="true" HeaderText="VIP Preferred ID">
                            <HeaderStyle Width="160px" />
                            <ItemStyle Width="160px" />
                        <telerik:GridBoundColumn DataField="FullName" AllowFiltering="true" UniqueName="FullName" ReadOnly="true" HeaderText="Full Name">
                            <HeaderStyle Width="300px" />
                            <ItemStyle Width="300px" />
                        <telerik:GridBoundColumn DataField="RedirectEmailAddress" AllowFiltering="true" UniqueName="RedirectEmailAddress" ReadOnly="false" HeaderText="Redirect Email Address">
                           <HeaderStyle Width="320px" />
                            <ItemStyle Width="320px" />
                        <telerik:GridBoundColumn DataField="ModifiedBy" AllowFiltering="false" UniqueName="ModifiedBy" ReadOnly="true" HeaderText="Last Modified By">
                            <HeaderStyle Width="160px" />
                            <ItemStyle Width="160px" />
                        <telerik:GridBoundColumn DataField="ModifiedDate" AllowFiltering="false" UniqueName="ModifiedDate" ReadOnly="true" HeaderText="Last Modified Date">
                            <HeaderStyle Width="200px" />
                            <ItemStyle Width="20px" />
                        <telerik:GridButtonColumn CommandName="Delete" HeaderText="Delete" Text="Delete" ConfirmText="Are you sure you want to delete this record?"ButtonType="ImageButton" UniqueName="DeleteColumn"></telerik:GridButtonColumn>

    When I click Edit, the RedirectEmailAddress does display and allows the user to change the value.  I just want to display an error message to the right of this value if it fails validation.  Something like: "Invalid Email Address".  Seems like this would be rather easy but I cannot find anything that does this.

Back to Top