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

Add chart or any other control to a cell

2 Answers 54 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Chuck Thompson
Top achievements
Rank 1
Chuck Thompson asked on 29 Oct 2009, 08:39 PM
What I wantto do is in the CellFormatting event(of elsewhere) I want to dynamically add a chart to a cell.
I can create the chart from code with no problem but I don't see a way to add a chart or any other control to a cell.
What I thought I would be able to do is this(pseudo):

 

GridCellElement cell = e.CellElement;

 

cell.Controls.Add(createChart(series1Val, series2Val));


Is there a way to add a chart to a grid and or a cell specifically?
Of if I need to do it at the column level(and use values from other columns) or any other level, please let me know..

Thanks

--Chuck

2 Answers, 1 is accepted

Sort by
0
Chuck Thompson
Top achievements
Rank 1
answered on 29 Oct 2009, 09:15 PM
I worked around this issue for now by using the GetBitmap method off of the chart like so.
 GridCellElement cell = e.CellElement;  
 RadChart cellChart = createChart(same, diff);  
 cell.Image = cellChart.GetBitmap(); 

But I am still curious as how to add other controls or any control to a cell.
Thanks in advance..

0
Nick
Telerik team
answered on 03 Nov 2009, 02:58 PM
Hello Chuck Thompson,

The solution that you found is really the most appropriate for your scenario. Please refer to our documentation about custom editors and custom cell elements. You need to be expert in WinForms and have some knowledge of RadGridView to implement most of these custom scenarios.

Kind regards,
Nick
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
GridView
Asked by
Chuck Thompson
Top achievements
Rank 1
Answers by
Chuck Thompson
Top achievements
Rank 1
Nick
Telerik team
Share this question
or