Dan Ramler
Top achievements
Rank 1
Dan Ramler
asked on 26 Jul 2010, 08:57 PM
If I set either the HeaderStyle CssClass or the ItemStyle CssClass value the "rgSorted" class isn't being added to the column on the grid.
3 Answers, 1 is accepted
0
Hello Dan,
Unfortunately I'm unable to reproduce this issue on my end. Please download the attached project (fully runnable) and let me know if I'm missing something.
Best regards,
Daniel
the Telerik team
Unfortunately I'm unable to reproduce this issue on my end. Please download the attached project (fully runnable) and let me know if I'm missing something.
Best regards,
Daniel
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Public Issue Tracking
system and vote to affect the priority of the items
0
Dan Ramler
Top achievements
Rank 1
answered on 01 Aug 2010, 05:32 PM
If the item css is set on an individual column, it stops adding the rgSorted class to those specific TD cells.
(See attached screen shot)
(See attached screen shot)
0
Hello Dan,
Thank you for the clarification. Due to compatibility reasons, the rgSorted style is applied only to columns which do not have an ItemStyle declared explicitly.
You could try the following workaround:
Best regards,
Daniel
the Telerik team
Thank you for the clarification. Due to compatibility reasons, the rgSorted style is applied only to columns which do not have an ItemStyle declared explicitly.
You could try the following workaround:
.myCssClass
{
background-color
: Red;
}
<
telerik:GridBoundColumn
DataField
=
"ID"
HeaderText
=
"ID"
UniqueName
=
"MyColumn"
SortExpression
=
"ID"
>
<
ItemStyle
CssClass
=
"myCssClass"
/>
</
telerik:GridBoundColumn
>
protected
void
RadGrid1_PreRender(
object
sender, EventArgs e)
{
if
((sender
as
RadGrid).MasterTableView.SortExpressions.ContainsExpression(
"ID"
))
{
GridItem[] headerItems = (sender
as
RadGrid).MasterTableView.GetItems(GridItemType.Header);
foreach
(GridDataItem item
in
(sender
as
RadGrid).MasterTableView.Items)
item[
"MyColumn"
].CssClass =
"rgSorted myCssClass"
;
}
}
Best regards,
Daniel
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Public Issue Tracking
system and vote to affect the priority of the items