<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default4.aspx.cs" Inherits="Default4" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager>
    <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" Height="200px" Width="300px">
        <telerik:RadGrid ID="RadGrid1" runat="server" GridLines="None" 
            onneeddatasource="RadGrid1_NeedDataSource" 
            onitemcommand="RadGrid1_ItemCommand">
            <MasterTableView AutoGenerateColumns="false">
                <Columns>
                    <telerik:GridTemplateColumn DataField="ID" HeaderText="ID" UniqueName="ID">
                        <ItemTemplate>
                            <%# Eval("ID") %>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:TextBox Enabled="true" ID="itemID" MaxLength="20" runat="server" Width="90px"
                                Text='<%# Bind("ID") %>' AutoPostBack="true"
                                CausesValidation="true" ValidationGroup="valGrpItemID" />
                            <asp:CustomValidator ID="custValItemID" ControlToValidate="itemID" Display="Dynamic"
                                class="txtNormal" runat="server" ValidateEmptyText="true" OnServerValidate="custValItemID_ServerValidate"
                                ValidationGroup="valGrpItemID" Text="<br/>Invalid Expense Type/Item No." />
                        </EditItemTemplate>
                    </telerik:GridTemplateColumn>
                    <telerik:GridTemplateColumn UniqueName="EditColumn" EditFormColumnIndex="1">
                        <ItemTemplate>
                            <asp:ImageButton ID="imbEdit" runat="server" ImageUrl="~/Images/Edit.gif" CommandName="Edit"
                                ToolTip="Edit this line" />
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:ImageButton ID="imbUpdate" runat="server" ImageUrl="~/Images/Update.gif"
                                CommandName="Update" ToolTip="Accept Changes"
                                ValidationGroup="valGrpItemID" />
                            <asp:ImageButton ID="imbCancel" runat="server" ImageUrl="~/Images/Cancel.gif"
                                CommandName="Cancel" ToolTip="Cancel Edit"
                                OnClientClick="if(!confirm('Are you sure you want to cancel any changes?')) return false;"
                                CausesValidation="false" />
                        </EditItemTemplate>
                    </telerik:GridTemplateColumn>
                </Columns>
                <EditFormSettings ColumnNumber="2">
                    <EditColumn Visible="false"></EditColumn>
                </EditFormSettings>
            </MasterTableView>
        </telerik:RadGrid>
        <asp:Label ID="Label1" runat="server"></asp:Label>
    </telerik:RadAjaxPanel>
    </form>
</body>
</html>
