redheadpgr
Programmer
I'm using template columns in a datagrid so that a user can edit data when they select "edit".
The problem I'm having is when I've added some validation controls. Not all the columns have validation controls. The ones that do, have the text boxes align differently in the cells from ones that don't have validation controls.
Is there a way to align these textbox controls in a row so that all would align at the top of the row?
Here is a sample of the code I'm using in a typical template column:
<asp:TemplateColumn HeaderText="Date">
<ItemTemplate>
<%# (DataBinder.Eval(Container.DataItem, "trans_dte")%></ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="txtDateUpdate" Runat=server Width=80 Text='<%# DataBinder.Eval(Container.DataItem, "trans_dte") %>'/> <asp:RequiredFieldValidator Runat="server" ErrorMessage="Date Required" ControlToValidate="txtDateUpdate" />
<asp:CompareValidator Runat="server" ErrorMessage="Must be in format mm/dd/yyyy" Type="Date" ControlToValidate="txtDateUpdate" Operator="DataTypeCheck" />
</EditItemTemplate>
</asp:TemplateColumn>
Thanks in advance for any help.
The problem I'm having is when I've added some validation controls. Not all the columns have validation controls. The ones that do, have the text boxes align differently in the cells from ones that don't have validation controls.
Is there a way to align these textbox controls in a row so that all would align at the top of the row?
Here is a sample of the code I'm using in a typical template column:
<asp:TemplateColumn HeaderText="Date">
<ItemTemplate>
<%# (DataBinder.Eval(Container.DataItem, "trans_dte")%></ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="txtDateUpdate" Runat=server Width=80 Text='<%# DataBinder.Eval(Container.DataItem, "trans_dte") %>'/> <asp:RequiredFieldValidator Runat="server" ErrorMessage="Date Required" ControlToValidate="txtDateUpdate" />
<asp:CompareValidator Runat="server" ErrorMessage="Must be in format mm/dd/yyyy" Type="Date" ControlToValidate="txtDateUpdate" Operator="DataTypeCheck" />
</EditItemTemplate>
</asp:TemplateColumn>
Thanks in advance for any help.