I am using Data grid and have a combination of numeric and string column in my object. When I am binding the numeric columns with data type as the number, it is also changing the alignment of the column header. I want the header as is and position of all the option like sort and filter icon should be consistent across the grid i.e. Header text on left and filter icon (Excel filter) on right side as it is aligned when we used data type as String. Need CSS
Hello Shobhana SuaraThank you for posting in our forum.
You can apply style to header row using "headerClasses".https://www.infragistics.com/products/ignite-ui-angular/docs/typescript/latest/classes/igxcolumncomponent.html#headerclasses
<igx-grid #grid1 [data]="data" width="700px" height="300px" displayDensity="compact"> <igx-column field="Id" header="ID"></igx-column> <igx-column field="Name" header="Product Name" headerClasses="name-column-header"></igx-column> <igx-column field="Price" header="Price"></igx-column> <igx-column field="RegisteredDate" header="Registered Date"> <ng-template igxCell let-val> {{val | date:'yyyy/MM/dd'}} </ng-template> </igx-column> <igx-column field="IsActive" header="Is Active"></igx-column> </igx-grid>
::ng-deep { .name-column-header .igx-grid__th-title { color: red; text-decoration: underline; } }
Here is a sample application which uses the above codes.7888.igx-grid-column-styling.zip
Hello Motaki,
First of all thank you for replying. But i am unable to align the header as well content of data grid using above answer. What i want is to left align header and content and right align the filter icon as it is for data type String. Kindly help
Can u please reply.. it urgent.