Hi Vivek,
Thank you for writing.
You can achieve the desired behavior by subscribing your
RadPivotGrid instance to the
MouseDoubleClick event and in the handler display a message box with the relevant information for the cell which is being clicked:
private
void
radPivotGrid1_MouseDoubleClick(
object
sender, MouseEventArgs e)
{
string
res =
string
.Empty;
RadPivotGrid grid = (RadPivotGrid)sender;
LightVisualElement cell = grid.ElementTree.GetElementAtPoint(e.Location)
as
LightVisualElement;
if
(cell !=
null
)
{
if
(cell
is
PivotCellElement)
{
PivotCellElement pivotCell = (PivotCellElement)cell;
string
caption =
"Caption: "
+ pivotCell.AggregateDescription.DisplayName +
"\n"
;
string
value =
"Value: "
+ pivotCell.Text +
"\n"
;
string
row =
this
.GetScreenTipValue(pivotCell.Row,
"Row: "
) +
"\n"
;
string
col =
this
.GetScreenTipValue(pivotCell.Column,
"Column: "
) +
"\n"
;
res = caption + value + row + col;
}
else
if
(cell.ToolTipText !=
""
)
{
res = cell.ToolTipText;
}
else
if
(cell
is
PivotGroupElement)
{
res = cell.Text;
}
}
if
(res !=
string
.Empty)
{
MessageBox.Show(res);
}
}
private
string
GetScreenTipValue(PivotGroupNode value,
string
prefix)
{
IGroup group = value.Group;
if
(group !=
null
)
{
List<IGroup> parents =
new
List<IGroup>();
while
(group !=
null
)
{
parents.Add(group);
group = group.Parent;
}
StringBuilder sb =
new
StringBuilder();
sb.AppendFormat(
"{0}: "
, prefix);
int
count = parents.Count;
while
(count > 0)
{
count--;
if
(count > 0)
{
sb.AppendFormat(
"{0} - "
, parents[count].Name);
}
else
{
sb.AppendFormat(
"{0}"
, parents[count].Name);
}
}
return
sb.ToString();
}
return
String.Empty;
}
I am also sending you a gif file showing the result on my end.
I hope this helps. Should you have further questions please do not hesitate to write back.
Regards,
Hristo Merdjanov
Telerik
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 Feedback Portal and vote to affect the priority of the items