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!

Can't get SelectedItemStyle to work with DataGrid's TemplateColumns.

Status
Not open for further replies.

LenardD

Programmer
Dec 1, 2002
35
CA
How does one get the SelectedItemStyle to apply in a DataGrid when using a TemplateColumn to "select" a row? For example:

<asp:TemplateColumn >
<ItemTemplate>
<asp:RadioButton Runat=&quot;server&quot; AutoPostBack=&quot;True&quot; GroupName=&quot;Select&quot; OnCheckedChanged=&quot;Selection_Click&quot; ID=&quot;Select&quot;></asp:RadioButton>
</ItemTemplate>
</asp:TemplateColumn>

I've tried forcing a row to a particular background color in the OnCheckedChanged event and that doesn't even work after postback. I do have my <SelectedItemStyle ForeColor=&quot;GhostWhite&quot; BackColor=&quot;DarkSlateGray&quot;></SelectedItemStyle> tag defined.

Thanks.

--Lenard
 
I figured out my problem. In my StyleSheet, I defined a &quot;TD&quot; tag and it was overriding most of my styles I defined for my datagrid.

--Lenard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top