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

[Solved] find Radchart in a TemplateColumn using this.Radgrid1.Mastertableview

1 Answer 95 Views
Grid
This is a migrated thread and some comments may be shown as answers.
DragonBall
Top achievements
Rank 1
DragonBall asked on 21 Apr 2009, 05:16 AM
 
 <telerik:GridTemplateColumn UniqueName="RadChrt" HeaderText="RadChrt"
                        <ItemTemplate> 
                            <asp:Label Text="ChartPos" Visible="false" runat="server">    </asp:Label> 
                            <telerik:RadChart ID="RadChart1" runat="server"
                               <PlotArea> 
                                <EmptySeriesMessage Visible="True"
                                    <Appearance Visible="True"
                                    </Appearance> 
                                </EmptySeriesMessage> 
                               </PlotArea> 
                                <ChartTitle> 
                                    <TextBlock Text="Nested Chart"
                                    </TextBlock> 
                                </ChartTitle> 
                           </telerik:RadChart> 
                             
                        </ItemTemplate>    
  </telerik:GridTemplateColumn> 
 
 
 
RadGrid1_ItemDataBound(object sender, GridItemEventArgs e) { 
if (e.Item is GridDataItem) 
        { 
            GridDataItem item = e.Item as GridDataItem; 
            RadChart chart = item["RadChrt"].FindControl("RadChart1") as RadChart; 
 
how do i search for a radchart control in a template column within the mastertableview.
i want to get the value NOT within the RadGrid1_ItemDataBound event
 

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 21 Apr 2009, 06:26 AM
Hello Manuel,

You cannot access the RadChart directly but you can only loop through the data items and then access the RadChart as shown below in the PreRender event of the grid or PageLoad:

c#:
protected void RadGrid1_PreRender(object sender, EventArgs e) 
    {         
        foreach (GridDataItem item in RadGrid1.Items) 
        { 
            RadChart chart = item.FindControl("RadChart1"as RadChart;            
        } 
    } 

Thanks
Princy.
Tags
Grid
Asked by
DragonBall
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or