Compare ItemTemplate value to RadTextBox

2 posts, 0 answers
  1. Christian
    Christian avatar
    4 posts
    Member since:
    Apr 2015

    Posted 22 Feb Link to this post

     

    i have grid

    <telerik:GridTemplateColumn DataField="Mark" DataType="System.Int16" FilterControlAltText="Filter Mark column" HeaderText="Mark" SortExpression="Mark" UniqueName="Mark">
                                <ItemTemplate>
                                    <asp:TextBox ID="txtMark" runat="server" Text='<%# Bind("Mark") %>' Width="50px" AutoPostBack="True" Font-Names="Arial" Font-Size="Small"></asp:TextBox>
                                </ItemTemplate>
                                <HeaderStyle Font-Names="Arial" Font-Size="Small" />
                                <ItemStyle Font-Names="Arial" Font-Size="Small" />
                            </telerik:GridTemplateColumn>

     and  a Radtextbox outside the grid

    i would like to compare the value from the ItemTeplate to the one in the RadTextbox and if the itemplate value is greater than the RadTextbox throw a msg.

    Can anyone help?

  2. Eyup
    Admin
    Eyup avatar
    3005 posts

    Posted 25 Feb Link to this post

    Hi Christian,

    Generally, if you will use numeric values in these inputs, it is better that you use RadNumericTextBoxes. Then, you can use the client-side or server-side validation functions of the asp:CustomValidator to achieve this requirement:
    https://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.customvalidator%28v=vs.110%29.aspx

    I hope this will prove helpful.

    Regards,
    Eyup
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top