This is a migrated thread and some comments may be shown as answers.

RadGrid Edit / Update help needed

0 Answers 60 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Bob
Top achievements
Rank 1
Bob asked on 26 Aug 2017, 12:04 PM

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"
                         runat="server"
                         AllowFilteringByColumn="true"
                         AllowSorting="true"
                         AllowPaging="false"
                         GroupPanelPosition="Top"
                         RenderMode="Lightweight"
                         EnableLinqExpressions="false"
                         OnItemCreated="gvEmailRedirectMaint_ItemCreated"
                         OnNeedDataSource="gvEmailRedirectMaint_NeedDataSource"
                         OnUpdateCommand="gvEmailRedirectMaint_UpdateCommand"
                         OnDeleteCommand="gvEmailRedirectMaint_DeleteCommand"
                         ClientSettings-Scrolling-AllowScroll="true"
                         ClientSettings-Scrolling-UseStaticHeaders="true"
                         Height="575px">
            <GroupingSettings CollapseAllTooltip="Collapse all groups" CaseSensitive="false"></GroupingSettings>
            <ClientSettings>
                <Resizing AllowColumnResize="true" AllowRowResize="true" ResizeGridOnColumnResize="false" ClipCellContentOnResize="true" EnableRealTimeResize="false"AllowResizeToFit="true" />
            </ClientSettings>
            <AlternatingItemStyle BackColor="#E0E0E0" />
            <MasterTableView AutoGenerateColumns="false" TableLayout="Auto" CommandItemDisplay="Top" DataKeyNames="ID" EditMode="EditForms">
                <CommandItemSettings ShowAddNewRecordButton="false" ShowRefreshButton="false" />
                <Columns>
                    <telerik:GridEditCommandColumn HeaderText="Edit:" ButtonType="ImageButton">
                        <HeaderStyle Width="50px" />
                        <ItemStyle Width="50px" />
                    </telerik:GridEditCommandColumn>
                    <telerik:GridBoundColumn DataField="ID" AllowFiltering="false" HeaderText="ID" UniqueName="ID" ReadOnly="true" Visible="false">
                        <HeaderStyle Width="160px" />
                        <ItemStyle Width="160px" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="VIPPreferredID" AllowFiltering="true" UniqueName="VIPPreferredID" ReadOnly="true" HeaderText="VIP Preferred ID">
                        <HeaderStyle Width="160px" />
                        <ItemStyle Width="160px" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="FullName" AllowFiltering="true" UniqueName="FullName" ReadOnly="true" HeaderText="Full Name">
                        <HeaderStyle Width="300px" />
                        <ItemStyle Width="300px" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="RedirectEmailAddress" AllowFiltering="true" UniqueName="RedirectEmailAddress" ReadOnly="false" HeaderText="Redirect Email Address">
                       <HeaderStyle Width="320px" />
                        <ItemStyle Width="320px" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="ModifiedBy" AllowFiltering="false" UniqueName="ModifiedBy" ReadOnly="true" HeaderText="Last Modified By">
                        <HeaderStyle Width="160px" />
                        <ItemStyle Width="160px" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="ModifiedDate" AllowFiltering="false" UniqueName="ModifiedDate" ReadOnly="true" HeaderText="Last Modified Date">
                        <HeaderStyle Width="200px" />
                        <ItemStyle Width="20px" />
                    </telerik:GridBoundColumn>
                    <telerik:GridButtonColumn CommandName="Delete" HeaderText="Delete" Text="Delete" ConfirmText="Are you sure you want to delete this record?"ButtonType="ImageButton" UniqueName="DeleteColumn"></telerik:GridButtonColumn>
                </Columns>
            </MasterTableView>

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.

No answers yet. Maybe you can help?

Tags
Ajax
Asked by
Bob
Top achievements
Rank 1
Share this question
or