DataGrid Formatting Cells

headphones2hdv

New Member
Is there any way to create a DataGrid and change the color of a single cell? Is there any control that would produce something simular to this?As you can see in a datagrid you can add a template in which you you change the BackColor. ( look for <asp:TemplateColumn ...)<BR><BR>Beware that Template work for column in datagrid compare by row for the datalist or the datarepeater.<BR><BR><asp:datagrid id=dgDetail runat="server" DataSource='<%# DataBinder.Eval(ds, "Tables[2]") %>'><BR><AlternatingItemStyle BackColor="Aqua"></AlternatingItemStyle><BR><ItemStyle BackColor="Beige"></ItemStyle><BR> <Columns><BR> <asp:BoundColumn DataField="location" ReadOnly="True" HeaderText="Location"></asp:BoundColumn><BR> <asp:TemplateColumn HeaderText="Rsv Qty" runat="server" ><BR> <itemtemplate><BR> <asp:TextBox runat="server" id="txtQtyReserved" Text='<%# DataBinder.Eval(Container.DataItem,"QtyReserved")%>' Width="50" MaxLength ="6" AutoPostBack="true" EnableViewState="true" OnTextChanged="RowChanged" BackColor="Blue"><BR> </asp:TextBox><BR> </itemtemplate> <BR></asp:TemplateColumn><BR> </Columns><BR></asp:datagrid>
 
Back
Top