This is a migrated thread and some comments may be shown as answers.

Assign different CSS to each column of the filter row

1 Answer 75 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Janaki
Top achievements
Rank 1
Janaki asked on 30 Apr 2012, 11:35 AM
Hi all,

Is there a way to assign different CSS to each column of the filter row?
please provide some suggestions.
Thanks in advance.

1 Answer, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 30 Apr 2012, 12:18 PM
Hello Janaki,

Try the following code to achieve your scenario.
C#:
protected void grid1_ItemCreated(object sender, GridItemEventArgs e)
{
 if (e.Item is GridFilteringItem)
 {
  GridFilteringItem filteringItem = e.Item as GridFilteringItem;
  TextBox box = filteringItem["UniqueName"].Controls[0] as TextBox;
  box.CssClass = "test";
 }
}
CSS:
<style type="text/css">
.test
{
    color:Red !important;
}
</style>

Thanks,
Princy.
Tags
Grid
Asked by
Janaki
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or