<asp:GridView ID="gvTestScript" runat="Server" CssClass="GridViewStyle" AutoGenerateColumns="False" CellPadding="4" ForeColor="Black" DataKeyNames="TestScriptID" ShowFooter="false" Height="110px" Style="margin-right: 0px" Width="990px" BackColor="White" OnRowDataBound="gvTestScript_RowDataBound" AutoGenerateEditButton="True" OnRowEditing="gvTestScript_RowEditing" OnRowCancelingEdit="gvTestScript_RowCancelingEdit" OnRowUpdating="gvTestScript_RowUpdating" OnRowDeleted="gvTestScript_RowDeleted" BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" OnRowCommand="gvTestScript_RowCommand"> <Columns> <asp:TemplateField HeaderText="TestScriptID" ItemStyle-HorizontalAlign="Left"> <ItemTemplate> <asp:Label ID="lblTestScriptID" runat="server" Height="20px" Text='<%#Eval("TestScriptID")%>'> </asp:Label> </ItemTemplate> <ItemStyle HorizontalAlign="Center"></ItemStyle> </asp:TemplateField> <asp:TemplateField HeaderText="Options" ItemStyle-HorizontalAlign="Left"> <ItemTemplate> <asp:ImageButton ID="btnDelete" runat="server" ImageUrl="images/delete.ico" CausesValidation="false" CommandName="DeleteRow" OnClick="btnDelete_Click" OnClientClick='return confirm("Are you sure you want to delete?");' /> </ItemTemplate> <FooterTemplate> <asp:ImageButton ID="btnSave" runat="server" ImageUrl="images/save.ico" CausesValidation="false" CommandName="SaveRow" OnClick="btnSave_Click" /> </FooterTemplate> <ItemStyle HorizontalAlign="Center"></ItemStyle> </asp:TemplateField> <asp:TemplateField HeaderText="StepTableName" ItemStyle-HorizontalAlign="Left"> <ItemTemplate> <asp:Label ID="lblStepTableName" runat="server" Height="20px" Text='<%#Eval("StepName")%>'> </asp:Label> </ItemTemplate> <ItemStyle HorizontalAlign="Left"></ItemStyle> <EditItemTemplate> <asp:DropDownList ID="ddlStepTableName" runat="server" Visible="true" AutoPostBack="True" OnSelectedIndexChanged="ddlStepTableName_SelectedIndexChanged"> </asp:DropDownList> </EditItemTemplate> <FooterTemplate> <asp:DropDownList ID="ddlFooterStepTableName" runat="server" Visible="true" AutoPostBack="True" OnSelectedIndexChanged="ddlFooterStepTableName_SelectedIndexChanged"> </asp:DropDownList> </FooterTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Test Data" ItemStyle-HorizontalAlign="Left"> <ItemTemplate> <asp:Label ID="lblTestData" runat="server" Height="20px" Text='<%#Eval("Aruguments")%>'> </asp:Label> </ItemTemplate> <ItemStyle HorizontalAlign="Left"></ItemStyle> <EditItemTemplate> <asp:DropDownList ID="ddlTestData" runat="server" Visible="true" AutoPostBack="True" OnSelectedIndexChanged="ddlTestData_SelectedIndexChanged"> </asp:DropDownList> </EditItemTemplate> <FooterTemplate> <asp:DropDownList ID="ddlFooterTestData" runat="server" Visible="true" AutoPostBack="True" OnSelectedIndexChanged="ddlFooterTestData_SelectedIndexChanged"> </asp:DropDownList> </FooterTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Description" ItemStyle-HorizontalAlign="Left"> <ItemTemplate> <asp:Label ID="lblDescription" runat="server" Height="20px" Text='<%#Eval("Descritpion")%>'></asp:Label> </ItemTemplate> <ItemStyle HorizontalAlign="Left"></ItemStyle> <EditItemTemplate> <asp:TextBox ID="txtDescription" runat="server" Text='<%# Bind("Descritpion")%>' Visible="true"> </asp:TextBox> </EditItemTemplate> <FooterTemplate> <asp:TextBox ID="txtFooterDescription" runat="server" Visible="true"></asp:TextBox> </FooterTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="UserParameters" ItemStyle-HorizontalAlign="Left"> <ItemTemplate> <%--<asp:Label ID="lblUserParameters" runat="server" Height="20px" Text='<%#Eval("UserParameters")%>'></asp:Label>--%> <asp:Label ID="lblUserParameters" runat="server" Height="20px" Text='<%# Eval("UserParameters").ToString().Length>25 ? (Eval("UserParameters") as string).Substring(0,25) : Eval("UserParameters") %>'></asp:Label> </ItemTemplate> <ItemStyle HorizontalAlign="Left"></ItemStyle> <EditItemTemplate> <asp:TextBox ID="txtUserParameters" runat="server" Text='<%# Bind("UserParameters") %>' Visible="true"> </asp:TextBox> </EditItemTemplate> <FooterTemplate> <asp:TextBox ID="txtFooterUserParameters" runat="server" Visible="true"></asp:TextBox> </FooterTemplate> </asp:TemplateField> </Columns> <FooterStyle BackColor="#CCCC99" ForeColor="Black" /> <PagerStyle BackColor="White" ForeColor="Black" HorizontalAlign="Right" /> <SelectedRowStyle BackColor="#CC3333" Font-Bold="True" ForeColor="White" /> <HeaderStyle BackColor="#333333" Font-Bold="True" ForeColor="White" HorizontalAlign="Justify" VerticalAlign="Middle" /> <SortedAscendingCellStyle BackColor="#F7F7F7" /> <SortedAscendingHeaderStyle BackColor="#4B4B4B" /> <SortedDescendingCellStyle BackColor="#E5E5E5" /> <SortedDescendingHeaderStyle BackColor="#242121" /> <EmptyDataTemplate> <table> <tr style="background-color: #999999;"> <th> Option </th> <th> StepTableName </th> <th> Test Data </th> <th> Description </th> <th> UserParameters </th> </tr> <tr> <td headers="Option"> <asp:ImageButton ID="btnSave" runat="server" ImageUrl="images/save.ico" CausesValidation="false" CommandName="FirstSaveRow" OnClick="btnSave_Click" /> </td> <td headers="StepTableName"> <asp:DropDownList ID="ddlFooterStepTableName" runat="server" Visible="true" > </asp:DropDownList> </td> <td headers="Test Data"> <asp:DropDownList ID="ddlFooterTestData" runat="server" Visible="true" > </asp:DropDownList> </td> <td headers="Description"> <asp:TextBox ID="txtFooterDescription" runat="server" Visible="true"></asp:TextBox> </td> <td headers="UserParameters"> <asp:TextBox ID="txtFooterUserParameters" runat="server" Visible="true"></asp:TextBox> </td> </tr> </table> </EmptyDataTemplate> </asp:GridView>
MaxLength
<asp:TextBox ID="txtUserParameters" MaxLength="25" runat="server" Text='<%# Bind("UserParameters") %>' Visible="true"> </asp:TextBox>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)