Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Why do my edit fields in a datagrid have special formatting?

Status
Not open for further replies.

iRead

Programmer
Mar 12, 2004
25
US
Any help will be greatly appreciated! Here’s the problem: in edit mode the first 3 fields firstName, middleName and lastName have special formatting. Those 3 fields are a different color and have a 3-D shadow effect. The other two socialSecurityNumber and amount appear as a normal textbox. The real problem is I don’t know where in the following code the special effects comes from or is it in my code behind?. Can anyone point me in the right direction?

Thank you!
iRead


<font face="arial" size="3">
<b>List Contacts</b>
</font>
<br>
<td>
<A href="newMatchRow.aspx"><FONT face=Tahoma size=2>Add New Contact</FONT></A> |
<A href="Default.asp"><FONT face=Tahoma size=2>Main Menu</FONT></A>
</td>

<form runat="server">

<asp:DataGrid id="People" runat="server"
BorderColor="SaddleBrown"
Width="640"
PageSize="25"
AllowPaging="true"
OnPageIndexChanged="Page_Grid"
BorderWidth="1"
CellPadding="4"
AutoGenerateColumns="false"
ShowHeader="true"
Visible="true"

OnEditCommand="People_Edit"
OnCancelCommand="People_Cancel"
OnUpdateCommand="People_Update"
OnDeleteCommand="People_Delete">

<HeaderStyle BorderColor="SaddleBrown" BackColor="PapayaWhip"
ForeColor="Black"
Font-Bold="True"
Font-Name="Verdana"
Font-Size="9" HorizontalAlign="Center"/>

<ItemStyle BorderColor=""
BackColor="PapayaWhip"
ForeColor="Black"
Font-Name="Verdana"
Font-Size="8"
Font-Bold="False" HorizontalAlign="Center"/>

<EditItemStyle BorderColor=""
BackColor="PapayaWhip"
ForeColor="Black"
Font-Name="Verdana"
Font-Size="7"
Font-Bold="False" HorizontalAlign="Center"/>

<PagerStyle Mode="NumericPages" Font-Size="8"/>

<Columns>

<asp:BoundColumn HeaderText="ID" ReadOnly="true" DataField="contactID"/>



<asp:TemplateColumn>

<HeaderTemplate>
<b> First Name </b>
</HeaderTemplate>

<ItemTemplate>
<asp:Label
Width="80"
Text='<%# DataBinder.Eval(Container.DataItem, "FirstName") %>'
runat="server"/>
</ItemTemplate>


<EditItemTemplate>
<asp:TextBox id="FirstName" Text='<%# DataBinder.Eval(Container.DataItem, "FirstName") %>'
runat="server"/>
</EditItemTemplate>

</asp:TemplateColumn>

<asp:TemplateColumn>

<HeaderTemplate>
<b> Middle Name </b>
</HeaderTemplate>

<ItemTemplate>
<asp:Label
Width="80"
Text='<%# DataBinder.Eval(Container.DataItem, "MiddleName") %>'
runat="server"/>
</ItemTemplate>


<EditItemTemplate>
<asp:TextBox id="MiddleName" Text='<%# DataBinder.Eval(Container.DataItem, "MiddleName") %>'
runat="server"/>
</EditItemTemplate>

</asp:TemplateColumn>

<asp:TemplateColumn>

<HeaderTemplate>
<b> Last Name </b>
</HeaderTemplate>

<ItemTemplate>
<asp:Label
Width="80"
Text='<%# DataBinder.Eval(Container.DataItem, "LastName") %>'
runat="server"/>
</ItemTemplate>

<EditItemTemplate>
<asp:TextBox id="LastName" Text='<%# DataBinder.Eval(Container.DataItem, "LastName") %>'
runat="server"/>
</EditItemTemplate>

</asp:TemplateColumn>

<asp:TemplateColumn>

<HeaderTemplate>
<b> Social Security </b>
</HeaderTemplate>

<ItemTemplate>
<asp:Label
Width="125"
Text='<%# DataBinder.Eval(Container.DataItem, "socialSecurityNumber") %>'
runat="server"/>
</ItemTemplate>


<EditItemTemplate>
<asp:TextBox id="socialSecurityNumber" Text='<%# DataBinder.Eval(Container.DataItem, "socialSecurityNumber") %>'
runat="server"/>
</EditItemTemplate>

</asp:TemplateColumn>

<asp:TemplateColumn>

<HeaderTemplate>
<b> Amount </b>
</HeaderTemplate>

<ItemTemplate>
<asp:Label
Width="75"
Text='<%# DataBinder.Eval(Container.DataItem, "amount") %>'
runat="server"/>
</ItemTemplate>


<EditItemTemplate>
<asp:TextBox id="amount" Text='<%# DataBinder.Eval(Container.DataItem, "amount") %>'
runat="server"/>
</EditItemTemplate>

</asp:TemplateColumn>

<asp:EditCommandColumn
ButtonType="LinkButton"
CancelText="Cancel"
EditText="Edit"
UpdateText="Update" />

<asp:ButtonColumn Text= "Delete" CommandName="Delete"></asp:ButtonColumn>

</Columns>

</asp:DataGrid>

</form>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top