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

Grid / Chart in TemplateColumn Returning Data with "or em"

1 Answer 24 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Tommy
Top achievements
Rank 1
Tommy asked on 17 Jun 2010, 11:55 AM
I'm basically took the example the telerik had on its site with having a chart inside a grid. However when I run it I'm returning "or em" in the values where I would like currency to display. Trying to run this so that the different Currency exchange will pull in daily. I can't figure out why its doing this and whether its a cs error that I messed up on or not. Even anyone can please help me with this or have any ideas would be greatly appreciated! Here is my code behind this.

 

<td valign="top">

 

 

<telerik:RadGrid ID="rgdCurrency" runat="server" AutoGenerateColumns="False" DataSourceID="dsCurrencyHeader"

 

 

GridLines="None" Width="200px" OnItemDataBound="rgdCurrency_ItemDataBound" >

 

 

<MasterTableView DataSourceID="dsCurrencyHeader" AutoGenerateColumns="False" DataKeyNames="currencycd">

 

 

<Columns>

 

 

<telerik:GridBoundColumn DataField="currencycd" HeaderText="Currency" SortExpression="currencycd"

 

 

UniqueName="currencycdFld">

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridTemplateColumn DataField="currencycd" UniqueName="ChartColumn" HeaderText="Exchange">

 

 

<ItemTemplate>

 

 

<telerik:RadChart ID="rdcCurrency" runat="server" AutoLayout="True" DataSourceID="dsCurrencyDetail"

 

 

DefaultType="Line" Height="25px" Width="50px" CreateImageMap="False" SeriesPalette="WebBlue">

 

 

<Series>

 

 

<telerik:ChartSeries Name="perDirhamExchAmt" DataYColumn="perDirhamExchAmt" Type="Line">

 

 

<Appearance>

 

 

<FillStyle MainColor="94, 117, 142" SecondColor="222, 245, 245">

 

 

</FillStyle>

 

 

<LabelAppearance Visible="False">

 

 

</LabelAppearance>

 

 

<Border Color="DimGray" />

 

 

</Appearance>

 

 

</telerik:ChartSeries>

 

 

</Series>

 

 

<PlotArea>

 

 

<XAxis IsZeroBased="False">

 

 

<Appearance MajorTick-Visible="False">

 

 

<MajorGridLines Color="DimGray" Visible="False" Width="0" />

 

 

<LabelAppearance Visible="False">

 

 

</LabelAppearance>

 

 

</Appearance>

 

 

<AxisLabel>

 

 

<TextBlock>

 

 

<Appearance TextProperties-Font="Verdana, 9.75pt, style=Bold">

 

 

</Appearance>

 

 

</TextBlock>

 

 

</AxisLabel>

 

 

</XAxis>

 

 

<YAxis IsZeroBased="False">

 

 

<Appearance MajorTick-Visible="False" MinorTick-Visible="False">

 

 

<MajorGridLines Color="DimGray" Visible="False" />

 

 

<LabelAppearance Visible="False">

 

 

</LabelAppearance>

 

 

</Appearance>

 

 

<AxisLabel>

 

 

<TextBlock>

 

 

<Appearance TextProperties-Font="Verdana, 9.75pt, style=Bold">

 

 

</Appearance>

 

 

</TextBlock>

 

 

</AxisLabel>

 

 

</YAxis>

 

 

<YAxis2>

 

 

<Appearance MajorTick-Visible="False" MinorTick-Visible="False">

 

 

<MinorGridLines Visible="False" />

 

 

<LabelAppearance Visible="False">

 

 

</LabelAppearance>

 

 

</Appearance>

 

 

<AxisLabel>

 

 

<TextBlock>

 

 

<Appearance TextProperties-Font="Verdana, 9.75pt, style=Bold">

 

 

</Appearance>

 

 

</TextBlock>

 

 

</AxisLabel>

 

 

</YAxis2>

 

 

<Appearance Corners="Round, Round, Round, Round, 6" SeriesPalette="WebBlue">

 

 

<FillStyle FillType="Solid" MainColor="White" SecondColor="White">

 

 

</FillStyle>

 

 

<Border Color="DimGray" Visible="False" />

 

 

</Appearance>

 

 

</PlotArea>

 

 

<ChartTitle Visible="False">

 

 

<Appearance Corners="Round, Round, Round, Round, 6" Dimensions-Margins="4%, 10px, 14px, 0%"

 

 

Position-AlignedPosition="Top" Visible="False">

 

 

<FillStyle GammaCorrection="False" MainColor="224, 224, 224">

 

 

</FillStyle>

 

 

<Border Color="DimGray" />

 

 

</Appearance>

 

 

<TextBlock>

 

 

<Appearance TextProperties-Font="Verdana, 11.25pt">

 

 

</Appearance>

 

 

</TextBlock>

 

 

</ChartTitle>

 

 

<Legend Visible="False">

 

 

<Appearance Visible="False">

 

 

<ItemTextAppearance TextProperties-Color="DimGray">

 

 

</ItemTextAppearance>

 

 

<Border Color="DimGray" />

 

 

</Appearance>

 

 

</Legend>

 

 

</telerik:RadChart>

 

 

</ItemTemplate>

 

 

</telerik:GridTemplateColumn>

 

 

</Columns>

 

 

</MasterTableView>

 

 

</telerik:RadGrid>

.cs

 

 

protected void rgdCurrency_ItemDataBound(object sender, GridItemEventArgs e)

 

{

 

if (e.Item is GridDataItem)

 

{

 

GridDataItem item = e.Item as GridDataItem;

 

 

RadChart chart = item["ChartColumn"].FindControl("rdcCurrency") as RadChart;

 

dsCurrencyDetail.SelectParameters[0].DefaultValue = item.GetDataKeyValue(

"currencycd").ToString();

 

chart.DataSource = dsCurrencyDetail.Select(

DataSourceSelectArguments.Empty);

 

chart.DataBind();

}

}

1 Answer, 1 is accepted

Sort by
0
Radoslav
Telerik team
answered on 23 Jun 2010, 10:46 AM
Hi Tommy,

I examined the code which you post and it is looks correct, however it is not runnable and I could not reproduce the described issue. Could you please send us a small runnable project which demonstrates the issue. You could open a formal support ticket from your Telerik account and attach a ZIP file there. Thus we will be able to we debug the project and provide you with more to-the-point answer.

Kind regards,
Radoslav
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
Tags
Grid
Asked by
Tommy
Top achievements
Rank 1
Answers by
Radoslav
Telerik team
Share this question
or