Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx_beginners thread: Re: DataGrid: SelectedItemStyle Not working...


Message #1 by "Kendell Churchwell" <kendell.churchwell@t...> on Fri, 21 Feb 2003 16:21:11
>> HI - DID YOU EVER FIGURE OUT THE PROBLEM? I HAVE THIS SAME PROBLEM AND 
>> CAN'T FIND A SOLUTION.  USING A DATAGRID, AND SELECTITEMSTYLE TAG; ITEM/
>> ROW DOES NOT CHANGE COLORS WHEN SELECTED.
>> PLEASE LET ME KNOW ANSWER IF YOU KNOW IT.  THANKS!  KENDELL

> Hi

I want the selected Row to appear to have a RED back ground.

This is my code: But its do4esn't work ? why ?

<asp:datagrid id="FileList" runat="server" Visible="False"
AllowSorting="True" AutoGenerateColumns="False" CellPadding="2"
CellSpacing="2" BorderStyle="None" BorderWidth="0" BackColor="white"
Width="100%" HorizontalAlign="Left" Font-Name="Verdana" Font-Size="8pt">
<HeaderStyle BackColor="#dddddd" CssClass="NormalBlack" Font-Bold="True"
Font-Name="Verdana" Font-Size="8pt" HorizontalAlign="Left" />
<SelectedItemStyle BackColor="#990000" ForeColor="#990000" /> '<--
<AlternatingItemStyle BackColor="#eeeeee" />
<Columns>
	<asp:BoundColumn SortExpression="Filename" ReadOnly="True"
HeaderText="Filename" DataField="Filename" />
	<asp:ButtonColumn ButtonType="LinkButton"
ItemStyle-HorizontalAlign="Center" ItemStyle-Width="45" 
CommandName="DoView"
Text="View" />
	<asp:BoundColumn HeaderText="Size" ReadOnly="True" DataField="Size"
DataFormatString="{0:#,####KB}" />
	<asp:BoundColumn SortExpression="Type" ReadOnly="True" 
HeaderText="Type"
DataField="Type" />
	<asp:BoundColumn SortExpression="Modified" ReadOnly="True"
HeaderText="Modified" DataField="Modified" DataFormatString="{0:d}" />
	<asp:EditCommandColumn ItemStyle-HorizontalAlign="Center"
ItemStyle-Width="45" UpdateText="Yes" CancelText="No" EditText="Delete" />
</Columns>
</asp:datagrid>



Best Regards

Robert Sindall

_______________________________

Tel: +44 (0)1242 251251
Email: rsindall@z...
Website: http://www.zethics.com


  Return to Index