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

Showing multiple color in a grid cell

1 Answer 24 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Nish
Top achievements
Rank 1
Nish asked on 12 Jun 2012, 04:51 PM
I need to implement the below requirement in my telerik rad grid.

1. In the X-> Axis we need to show the days of a month(1-31) and in Y-Axis we need to show the month name. We have a name column which shows the name of different persons worked on a team.

2. A person can take multiple categories leaves in a single day. For Example in a day if we consider 8 hours as working hours and lets say I took 2 hours of Sick Leave, 2 hours of Working from home and 4 hours of out of office.

3. For each kind of leave we have different color codes to represents that in a grid cell for that day. These color code as the hex codes coming from a database based on the user preference set for that employee.

4. If you see the attachment, for the month of Jan, Person1, took 3 categories of leaves on 3rd Jan and 14th Jan. How to achieve this functionality of having 3 different color codes in a single grid cell and that to those colors are coming from database.

It will be great if you can tell me how to achieve this functionality.

Thanks,
Nishith

1 Answer, 1 is accepted

Sort by
0
Richard
Top achievements
Rank 1
answered on 13 Jun 2012, 09:41 PM
Nish,

Though I have yet to try this, I'm thinking that you could accomplish this by using the newly added functionality of the ClientItemTemplate for the GridTemplateColumn, as featured in this blog post, covered near the bottom of the Column Types documentation page, and demonstrated with the Grid/ClientItemTemplate online demo.

You should be able to create a template that incorporates three individual image tags that can each be bound to your data source in the same manner that the image is bound in the Customer Info column of the above online demo.

Hope this helps!
Tags
Grid
Asked by
Nish
Top achievements
Rank 1
Answers by
Richard
Top achievements
Rank 1
Share this question
or