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

cell hints

7 Answers 36 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Mark
Top achievements
Rank 1
Mark asked on 05 Apr 2011, 03:22 PM
good day,

I am looking for the best way to show hints when hovering over a cell in the grid.

Thanks

-Markus

7 Answers, 1 is accepted

Sort by
0
Pavel Pavlov
Telerik team
answered on 05 Apr 2011, 03:24 PM
Hi Mark,

Do you mean Tooltips ?

Best wishes,
Pavel Pavlov
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
Mark
Top achievements
Rank 1
answered on 05 Apr 2011, 05:32 PM
yes, I guess wording makes all the difference. :)

Here is my current object structure (me fooling around trying to get it to work):

    public class Appointment
    {
        public string Employee { get; set; }
        public string Sunday { get; set; }
        public string Monday { get; set; }
        public string Tuesday { get; set; }
        public string Wednesday { get; set; }
        public string Thursday { get; set; }
        public string Friday { get; set; }
        public string Saturday { get; set; }
        public int[] CellColors;

        public Appointment()
        {
        }
    }

Thinking about adding something like:

        public string EmployeeHint { get; set; }
        public string SundayHint { get; set; }
...

-Markus
0
Mark
Top achievements
Rank 1
answered on 05 Apr 2011, 07:13 PM
I am looking at other posts such as:

http://www.telerik.com/community/forums/silverlight/gridview/tooltip-in-datagridcell.aspx

Will let you know if this addresses my issue.

-Markus
0
Pavel Pavlov
Telerik team
answered on 06 Apr 2011, 03:54 PM
Hi Mark,

You may try something like :

<telerik:RadGridView  x:Name="RootGridView" AutoGenerateColumns="False" >
            <telerik:RadGridView.Columns>
                <telerik:GridViewDataColumn DataMemberBinding="{Binding Employee}" >
                    <telerik:GridViewDataColumn.ToolTipTemplate>
                        <DataTemplate>
                            <TextBlock Text="{Binding EmployeeHint}" />
                        </DataTemplate>
                    </telerik:GridViewDataColumn.ToolTipTemplate>
                </telerik:GridViewDataColumn>
            </telerik:RadGridView.Columns>
  
        </telerik:RadGridView>
    </Grid>


Greetings,
Pavel Pavlov
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
Mark
Top achievements
Rank 1
answered on 06 Apr 2011, 10:46 PM
Hey Pavel,

My grid will have manually created columns (evenually a monthly calendar will come as well).

There will be 8 columns :

employee  sun  mon  tue  wed  thu  fri  sat

and 1..n rows.

Every cell can have have its own tooltip (or no tooltip at all).

I currently have a rowloaded event since each cell can have its own colors as well.

-Markus
0
Accepted
Maya
Telerik team
answered on 07 Apr 2011, 07:55 AM
Hi Mark,

May you take a look at this forum thread to verify whether the suggested approach there meets your requirements ?
 

Greetings,
Maya
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
Mark
Top achievements
Rank 1
answered on 08 Apr 2011, 10:59 PM
Hey Maya,

Perfect, this code from the other thread was exactly what I was looking for:

void playersGrid_RowLoaded(object sender, RowLoadedEventArgs e)
{
    var row = e.Row as GridViewRow;
    var cells = row.ChildrenOfType<GridViewCell>();
    foreach (GridViewCell cell in cells)
    {
        cell.SetValue(ToolTipService.ToolTipProperty, (cell.Column as GridViewDataColumn).DataMemberBinding.Path.Path);
    }          
}
Tags
GridView
Asked by
Mark
Top achievements
Rank 1
Answers by
Pavel Pavlov
Telerik team
Mark
Top achievements
Rank 1
Maya
Telerik team
Share this question
or