Carl3003
asked on
change <EditItemTemplate>'s text box width???
I have a datagrid with edit/update/cancel template. The datagrid has autogeneratecolumn property set. The only one template columns are edit and delete link buttons. When pressing Edit, the edit text boxes appears. However, those edit boxes make my table too big. I would just like to change the witdh of those edit text boxes. Would it be that possible to do and how. I appriciate greatly any help . Here are my codes..
Thanks..
<asp:datagrid id="XmlDataGrid" runat="server" BorderColor="#999999" BorderStyle="None" BorderWidth="1px"
BackColor="White" CellPadding="3" GridLines="Vertical" AllowSorting="True" OnSortCommand="SortGrid"
OnDeleteCommand="doDelete" OnEditCommand="doEdit" OnCancelCommand="doCancel" OnUpdateCommand="doUpdate" >
<SelectedItemStyle Font-Bold="True" ForeColor="White" BackColor="#008A8C"></Sele ctedItemSt yle>
<AlternatingItemStyle BackColor="Gainsboro"></Al ternatingI temStyle>
<ItemStyle ForeColor="Black" BackColor="#EEEEEE"></Item Style>
<HeaderStyle Font-Bold="True" HorizontalAlign="Center" ForeColor="White" BackColor="#000084"></Head erStyle>
<FooterStyle ForeColor="Black" BackColor="#CCCCCC"></Foot erStyle>
<Columns>
<asp:TemplateColumn>
<ItemTemplate>
<asp:LinkButton runat="server" Text="Edit" CommandName="Edit" CausesValidation="false">< /asp:LinkB utton>
</ItemTemplate>
<EditItemTemplate>
<asp:LinkButton runat="server" Text="Update" CommandName="Update"></asp :LinkButto n>
<asp:LinkButton runat="server" Text="Cancel" CommandName="Cancel" CausesValidation="false">< /asp:LinkB utton>
</EditItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="Delete">
<ItemStyle HorizontalAlign="Center">< /ItemStyle >
<ItemTemplate>
<asp:LinkButton Runat="server" Text="Delete" CommandName="Delete" ID="Linkbutton1" NAME="Linkbutton1"></asp:L inkButton>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:datagrid>
Thanks..
<asp:datagrid id="XmlDataGrid" runat="server" BorderColor="#999999" BorderStyle="None" BorderWidth="1px"
BackColor="White" CellPadding="3" GridLines="Vertical" AllowSorting="True" OnSortCommand="SortGrid"
OnDeleteCommand="doDelete"
<SelectedItemStyle Font-Bold="True" ForeColor="White" BackColor="#008A8C"></Sele
<AlternatingItemStyle BackColor="Gainsboro"></Al
<ItemStyle ForeColor="Black" BackColor="#EEEEEE"></Item
<HeaderStyle Font-Bold="True" HorizontalAlign="Center" ForeColor="White" BackColor="#000084"></Head
<FooterStyle ForeColor="Black" BackColor="#CCCCCC"></Foot
<Columns>
<asp:TemplateColumn>
<ItemTemplate>
<asp:LinkButton runat="server" Text="Edit" CommandName="Edit" CausesValidation="false"><
</ItemTemplate>
<EditItemTemplate>
<asp:LinkButton runat="server" Text="Update" CommandName="Update"></asp
<asp:LinkButton runat="server" Text="Cancel" CommandName="Cancel" CausesValidation="false"><
</EditItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="Delete">
<ItemStyle HorizontalAlign="Center"><
<ItemTemplate>
<asp:LinkButton Runat="server" Text="Delete" CommandName="Delete" ID="Linkbutton1" NAME="Linkbutton1"></asp:L
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:datagrid>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I have tried this way, it works very well;however, i am adding programatically datacolumns to the dataset and if i use manual EditItemtemplate for each just added column i have to manually add a new EditItemTemplate. IF i use autogenaratecolumns property i dont have to add manually new columns.But thanks any way. I wil try to go around.
John