Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
73 views
I have a web page where I am attempting to use aschycronous service calls to update different series of a line chart to produce three lines. This code works when done schyronously (causes the UI thread to wait, making the app look hung up...), but when hooked up this way my web app is responsive, but I get only one line in my chart, my question is: why? Is it the Ajax panel? Am I doing this the wrong way?
private void fillchart(RadChart chart, int chartSeriesID, List<decimal> dataPoints)
{
    // For display of empty grids:
    if (dataPoints.Count < 1) { dataPoints.Add(-1.00M); }
 
    double y = 0;
    double x = 0;
    chart.Series[chartSeriesID].Clear();
    foreach (decimal point in dataPoints)
    {
        y = double.Parse(point.ToString());
        ChartSeriesItem item = new ChartSeriesItem(x, y);
        item.PointAppearance.Figure = "*";  // Telerik.Charting.Styles.DefaultFigures.Star6; // Appearance.ItemMarkerAppearance.Figure = Telerik.Charting.Styles.DefaultFigures.Diamond;
        chart.Series[chartSeriesID].AddItem(item);
        x++;
    }
}
 
#region ChartOriginalTerm:
private void FillChartOriginalTerm(int? loanImportID, int? SellerID)
{
    chartOriginalTerm.Series.ClearItems();
    chartOriginalTerm.Chart.PlotArea.YAxis.Clear();
    chartOriginalTerm.Chart.PlotArea.YAxis.AddRange(0, 100, 10);
    chartOriginalTerm.Chart.PlotArea.YAxis.MaxValue = 100;
    chartOriginalTerm.Chart.PlotArea.YAxis.MinValue = 0;
    chartOriginalTerm.Chart.PlotArea.YAxis.AutoScale = false;
    for (int i = 0; i < chartOriginalTerm.Chart.PlotArea.YAxis.Items.Count; i++)
        chartOriginalTerm.Chart.PlotArea.YAxis[i].TextBlock.Text = chartOriginalTerm.Chart.PlotArea.YAxis[i].TextBlock.Text + "%";
 
    ws.GetOrigianlTermChartValuesCompleted += new EventHandler<GetOrigianlTermChartValuesCompletedEventArgs>(ws_GetOrigianlTermChartValuesCompleted);
    ws.GetOrigianlTermChartValuesAsync(loanImportID, SellerID);
 
    if (loanImportID != null)
    {   // Fill second line with Just the selected Import:
        ws.GetOrigianlTermChartValuesCompleted += new EventHandler<GetOrigianlTermChartValuesCompletedEventArgs>(ws_GetOrigianlTermChartValuesCompletedLoanImportCompleted);
        ws.GetOrigianlTermChartValuesAsync(loanImportID, null);
    }
 
    if ((SellerID != null) && (SellerID > 0))
    {   // Fill third line with the Seller Company only data
        ws.GetOrigianlTermChartValuesCompleted += new EventHandler<GetOrigianlTermChartValuesCompletedEventArgs>(ws_GetOrigianlTermChartValuesCompletedSellerCompleted);
        ws.GetOrigianlTermChartValuesAsync(null, SellerID);
    }
}
 
private void ws_GetOrigianlTermChartValuesCompletedLoanImportCompleted(object sender, GetOrigianlTermChartValuesCompletedEventArgs e)
{
    ws.GetOrigianlTermChartValuesCompleted -= ws_GetOrigianlTermChartValuesCompletedLoanImportCompleted;
    List<decimal> data1 = e.Result;
    fillchart(this.chartOriginalTerm, 1, data1);
    chartOriginalTerm.Series[1].Appearance.LineSeriesAppearance.Color = System.Drawing.Color.Red;
    chartOriginalTerm.Series[1].Appearance.LineSeriesAppearance.PenStyle = System.Drawing.Drawing2D.DashStyle.Solid;
    chartOriginalTerm.Series[1].Appearance.LineSeriesAppearance.Width = 2;
    chartOriginalTerm.Series[1].Appearance.LineSeriesAppearance.StartCap = System.Drawing.Drawing2D.LineCap.RoundAnchor;
    chartOriginalTerm.Series[1].Appearance.LineSeriesAppearance.EndCap = System.Drawing.Drawing2D.LineCap.RoundAnchor;
}
 
private void ws_GetOrigianlTermChartValuesCompletedSellerCompleted(object sender, GetOrigianlTermChartValuesCompletedEventArgs e)
{
    ws.GetOrigianlTermChartValuesCompleted -= ws_GetOrigianlTermChartValuesCompletedSellerCompleted;
    List<decimal> data2 = e.Result;
    fillchart(this.chartOriginalTerm, 2, data2);
    chartOriginalTerm.Series[2].Appearance.LineSeriesAppearance.Color = System.Drawing.Color.DarkBlue;
    chartOriginalTerm.Series[2].Appearance.LineSeriesAppearance.PenStyle = System.Drawing.Drawing2D.DashStyle.Solid;
    chartOriginalTerm.Series[2].Appearance.LineSeriesAppearance.Width = 2;
    chartOriginalTerm.Series[2].Appearance.LineSeriesAppearance.StartCap = System.Drawing.Drawing2D.LineCap.SquareAnchor;
    chartOriginalTerm.Series[2].Appearance.LineSeriesAppearance.EndCap = System.Drawing.Drawing2D.LineCap.SquareAnchor;
}
 
private void ws_GetOrigianlTermChartValuesCompleted(object sender, GetOrigianlTermChartValuesCompletedEventArgs e)
{
    // Fill the first line with ALL the ILS portfolio:
    ws.GetOrigianlTermChartValuesCompleted -= ws_GetOrigianlTermChartValuesCompleted;
 
    List<decimal> data0 = e.Result;
    fillchart(this.chartOriginalTerm, 0, data0);
    chartOriginalTerm.Series[0].Appearance.LineSeriesAppearance.Color = System.Drawing.Color.Black;
    chartOriginalTerm.Series[0].Appearance.LineSeriesAppearance.PenStyle = System.Drawing.Drawing2D.DashStyle.Solid;
    chartOriginalTerm.Series[0].Appearance.LineSeriesAppearance.Width = 2;
    chartOriginalTerm.Series[0].Appearance.LineSeriesAppearance.StartCap = System.Drawing.Drawing2D.LineCap.DiamondAnchor;
    chartOriginalTerm.Series[0].Appearance.LineSeriesAppearance.EndCap = System.Drawing.Drawing2D.LineCap.DiamondAnchor;
}
#endregion

<asp:Content ID="Content3" ContentPlaceHolderID="Column1" runat="server">
    <div class="dynamic_box" style="width: 95%; height: 425px;" >
        <telerik:RadAjaxPanel ID="RadAjaxPanelColumn1" runat="server" EnableAJAX="true" LoadingPanelID="ajaxLoadingPanel">
            <br /><h2>Choose a Loan Pool:<br /></h2>
 
            <telerik:RadComboBox ID="ddlSeller" runat="server" Width="95%" AutoPostBack="True"
                OnSelectedIndexChanged="ddlSeller_SelectedIndexChanged" DataTextField="Value"
                DataValueField="Key">
            </telerik:RadComboBox><br />
 
            <telerik:RadComboBox ID="ddlLoanPackage" runat="server" Width="95%" Height="150px"
                AutoPostBack="True" OnSelectedIndexChanged="ddlLoanPackage_SelectedIndexChanged"
                Enabled="false" EnableLoadOnDemand="true" ShowMoreResultsBox="true" EnableVirtualScrolling="true"
                OnItemsRequested="ddlLoanPackage_ItemsRequested" ItemsPerRequest="20">
            </telerik:RadComboBox>
 
            <br clear="all" />
             
            <div style="height: 90px; width: 100%">
                <div style="float: left; margin: 0px 10px 0px 10px;  padding: 5px 0pc 0px 0px; text-align: center; font-size: 16px; font-weight: bold;">
                    <asp:ImageButton ID="btnImportName" runat="server" OnClick="btnLoadLoanImport_Click" ImageUrl="~/images/icon_dashboard.png" />
                </div>
                <div style="text-align: left;">
                    <h2 style="display: inline-block; margin: 10px 0px 10px 0px;">
                        <asp:Label runat="server" ID="lbtnSellerName">Status Snapshot</asp:Label>
                    </h2>
                    <h3 style="display: inline-block; margin: 10px 0px 10px 0px;">
                        <asp:LinkButton runat="server" ID="lblImportName" OnClick="imgBtnLoadLoanImport_Click" />
                    </h3>
                </div>
            </div>
            <br clear="all" />
 
            <table border="0" cellpadding="2" cellspacing="0" style="text-align: right; width: 100%">
                <tr>
                    <td class="FieldLabel" width="250px"># of Units:</td>
                    <td><asp:Label runat="server" ID="lblUnitsCount" /></td>
                    <td class="FieldLabel" width="250px">Wtd APR:</td>
                    <td><asp:Label runat="server" ID="lblWtdAPR" /></td>
                </tr>
                <tr>
                    <td class="FieldLabel" width="250px">Orig. Balance:</td>
                    <td><asp:Label runat="server" ID="lblOriginalBalance" /></td>
                    <td class="FieldLabel" width="250px">Wtd Avg Model Yr:</td>
                    <td><asp:Label runat="server" ID="lblWtdAvgModelYear" /></td>
                </tr>
                <tr>
                    <td class="FieldLabel" width="250px">Curr. Balance:</td>
                    <td><asp:Label runat="server" ID="lblCurrentBalance" /></td>
                    <td class="FieldLabel" width="250px">Wtd Avg Mileage:</td>
                    <td><asp:Label runat="server" ID="lblWtdAvgMileage" /></td>
                </tr>
                <tr>
                    <td class="FieldLabel" width="250px">Wtd Orig. Term(mos):</td>
                    <td><asp:Label runat="server" ID="lblWtdOriginalTerm" /></td>
                    <td class="FieldLabel" width="250px">Wtd Bureau Score:</td>
                    <td><asp:Label runat="server" ID="lblWtdBureauScore" /></td>
                </tr>
                <tr>
                    <td class="FieldLabel" width="250px">Wtd Rem. Term:</td>
                    <td><asp:Label runat="server" ID="lblWtdRemainingTerm" /></td>
                    <td class="FieldLabel" width="250px">Wtd LTV:</td>
                    <td><asp:Label runat="server" ID="lblWtdLTV" /></td>
                </tr>
                <tr>
                    <td class="FieldLabel" width="250px">Wtd Seasoning:</td>
                    <td><asp:Label runat="server" ID="lblWtdSeasoning" /></td>
                    <td class="FieldLabel" width="250px">Wtd LTV Clean:</td>
                    <td><asp:Label runat="server" ID="lblWtdLTVClean" /></td>
                </tr>
                <tr>
                    <td colspan="4" class="FieldLabel"><hr /></td>
                </tr>
                <tr>
                    <td style="text-align: left;"><strong>Payment Period:</strong></td>
                    <td class="FieldLabel">% Monthly:</td>
                    <td><asp:Label runat="server" ID="lblPaymentPeriodMonthly" /></td>
                    <td> </td>
                </tr>
                <tr>
                    <td> </td>
                    <td class="FieldLabel">BW/SM/W:</td>
                    <td><asp:Label runat="server" ID="lblPaymentPeriodOther" /></td>
                    <td> </td>
                </tr>
            </table>
        </telerik:RadAjaxPanel>
    </div>
    <div class="dynamic_box" style="width: 95%">
        <telerik:RadAjaxPanel ID="apnlChartOriginalTerm" runat="server" LoadingPanelID="ajaxLoadingPanel">
            <telerik:RadChart ID="chartOriginalTerm" runat="server" Skin="Mac" Width="490px" AutoLayout="True" DefaultType="Line" IntelligentLabelsEnabled="True">
                <ClientSettings EnableZoom="false" ScrollMode="None" />
                <Appearance Corners="Round, Round, Round, Round, 6">
                    <FillStyle FillType="Image">
                        <FillSettings BackgroundImage="{chart}" ImageDrawMode="Flip" ImageFlip="FlipX" />
                    </FillStyle>
                    <Border Color="138, 138, 138" />
                </Appearance>
                <Series>
                    <telerik:ChartSeries Type="Line" Name="Full ILS Profolio" DataYColumn="ProfolioPercent1" DefaultLabelValue="#Y{N0}">
                        <Appearance ShowLabels="false" PointShape="Diamond">
                            <FillStyle MainColor="55, 167, 226" SecondColor="22, 85, 161">
                                <FillSettings GradientMode="Vertical" />
                            </FillStyle>
                            <TextAppearance TextProperties-Color="Black" />
                            <LineSeriesAppearance Width="2" PenStyle="Solid" />
                        </Appearance>
                    </telerik:ChartSeries>
                    <telerik:ChartSeries Type="Line" Name="Import Profolio" DataYColumn="ProfolioPercent2" DefaultLabelValue="#Y{N0}">
                        <Appearance ShowLabels="false" PointShape="Triangle">
                            <FillStyle MainColor="223, 87, 60" SecondColor="200, 38, 37">
                                <FillSettings GradientMode="Vertical" />
                            </FillStyle>
                            <TextAppearance TextProperties-Color="Black" />
                            <LineSeriesAppearance Width="2" PenStyle="Solid" />
                        </Appearance>
                    </telerik:ChartSeries>
                    <telerik:ChartSeries Type="Line" Name="Seller's Profolio" DataYColumn="ProfolioPercent3" DefaultLabelValue="#Y{N0}">
                        <Appearance ShowLabels="false" PointShape="Star3">
                            <FillStyle MainColor="118, 203, 76" SecondColor="73, 166, 22">
                                <FillSettings GradientMode="Vertical" />
                            </FillStyle>
                            <TextAppearance TextProperties-Color="Black" />
                            <LineSeriesAppearance Width="2" PenStyle="Solid" />
                        </Appearance>
                    </telerik:ChartSeries>
                </Series>
                <Legend>
                    <Appearance Overflow="Row" Dimensions-Margins="1%, 1%, 1%, 1%" Position-AlignedPosition="Top">
                        <ItemMarkerAppearance Figure="Diamond" >
                            <Border Color="134, 134, 134" />
                        </ItemMarkerAppearance>
                        <FillStyle MainColor="">
                        </FillStyle>
                        <Border Color="Transparent" />
                    </Appearance>
                </Legend>
                <PlotArea>
                    <EmptySeriesMessage TextBlock-Text=" No data available" />
                    <XAxis DataLabelsColumn="Label" Step="1">
                        <Appearance Color="134, 134, 134" MajorTick-Color="134, 134, 134">
                            <MajorGridLines Color="209, 222, 227" PenStyle="Solid" />
                            <TextAppearance TextProperties-Color="51, 51, 51" />
                        </Appearance>
                        <AxisLabel>
                            <TextBlock>
                                <Appearance TextProperties-Color="51, 51, 51" />
                            </TextBlock>
                        </AxisLabel>
                        <Items>
                            <telerik:ChartAxisItem TextBlock-Text="<=36" Value="0" />
                            <telerik:ChartAxisItem TextBlock-Text="37_42" Value="1" />
                            <telerik:ChartAxisItem TextBlock-Text="43_48" Value="2" />
                            <telerik:ChartAxisItem TextBlock-Text="49_54" Value="3" />
                            <telerik:ChartAxisItem TextBlock-Text="55_60" Value="4" />
                            <telerik:ChartAxisItem TextBlock-Text="61_66" Value="5" />
                            <telerik:ChartAxisItem TextBlock-Text="67_72" Value="6" />
                            <telerik:ChartAxisItem TextBlock-Text=">72" Value="7" />
                        </Items>
                    </XAxis>
                    <YAxis IsLogarithmic="false" Visible="true">
                        <Appearance Color="134, 134, 134" MajorTick-Color="134, 134, 134" MinorTick-Color="134, 134, 134" MinorTick-Width="0">
                            <MajorGridLines Color="209, 222, 227" />
                            <MinorGridLines Color="233, 239, 241" />
                            <TextAppearance TextProperties-Color="51, 51, 51" />
                        </Appearance>
                        <AxisLabel>
                            <TextBlock Text="% of Portfolio" >
                                <Appearance TextProperties-Color="51, 51, 51" Position-AlignedPosition="TopLeft"  />
                            </TextBlock>
                        </AxisLabel>
                        <Items>
                            <telerik:ChartAxisItem TextBlock-Text="0%" Value="0" />
                            <telerik:ChartAxisItem TextBlock-Text="10%" Value="1" />
                            <telerik:ChartAxisItem TextBlock-Text="20%" Value="2" />
                            <telerik:ChartAxisItem TextBlock-Text="30%" Value="3" />
                            <telerik:ChartAxisItem TextBlock-Text="40%" Value="4" />
                            <telerik:ChartAxisItem TextBlock-Text="50%" Value="5" />
                            <telerik:ChartAxisItem TextBlock-Text="60%" Value="6" />
                            <telerik:ChartAxisItem TextBlock-Text="70%" Value="7" />
                            <telerik:ChartAxisItem TextBlock-Text="80%" Value="8" />
                            <telerik:ChartAxisItem TextBlock-Text="90%" Value="9" />
                            <telerik:ChartAxisItem TextBlock-Text="100%" Value="10" />
                        </Items>
                    </YAxis>
                    <Appearance Dimensions-Margins="8%, 6%, 8%, 6%">
                        <FillStyle FillType="Solid" MainColor="White" />
                        <Border Color="134, 134, 134" />
                    </Appearance>
                </PlotArea>
                <ChartTitle>
                    <Appearance Position-AlignedPosition="Top" Dimensions-Margins="1%, 1%, 1%, 1%" >
                        <FillStyle MainColor="">
                        </FillStyle>
                    </Appearance>
                    <TextBlock Text="Original Term (mos)">
                        <Appearance TextProperties-Font="Tahoma, 13pt" />
                    </TextBlock>
                </ChartTitle>
            </telerik:RadChart>
        </telerik:RadAjaxPanel>
    </div>
    <div class="dynamic_box" style="width: 95%">
        <telerik:RadAjaxPanel ID="apnlChartRemainingTerm" runat="server" LoadingPanelID="ajaxLoadingPanel">
            <telerik:RadChart ID="chartRemainingTerm" runat="server" Skin="Mac" Width="490px" AutoLayout="True" DefaultType="Line" IntelligentLabelsEnabled="True">
                <ClientSettings EnableZoom="false" ScrollMode="None" />
                <Appearance Corners="Round, Round, Round, Round, 6">
                    <FillStyle FillType="Image">
                        <FillSettings BackgroundImage="{chart}" ImageDrawMode="Flip" ImageFlip="FlipX" />
                    </FillStyle>
                    <Border Color="138, 138, 138" />
                </Appearance>
                <Series>
                    <telerik:ChartSeries Type="Line" Name="Full ILS Profolio" DataYColumn="ProfolioPercent1" DefaultLabelValue="#Y{N0}">
                        <Appearance ShowLabels="false" PointShape="Diamond">
                            <FillStyle MainColor="55, 167, 226" SecondColor="22, 85, 161">
                                <FillSettings GradientMode="Vertical" />
                            </FillStyle>
                            <TextAppearance TextProperties-Color="Black" />
                            <LineSeriesAppearance Width="2" PenStyle="Solid" />
                        </Appearance>
                    </telerik:ChartSeries>
                    <telerik:ChartSeries Type="Line" Name="Import Profolio" DataYColumn="ProfolioPercent2" DefaultLabelValue="#Y{N0}">
                        <Appearance ShowLabels="false" PointShape="Triangle">
                            <FillStyle MainColor="223, 87, 60" SecondColor="200, 38, 37">
                                <FillSettings GradientMode="Vertical" />
                            </FillStyle>
                            <TextAppearance TextProperties-Color="Black" />
                            <LineSeriesAppearance Width="2" PenStyle="Solid" />
                        </Appearance>
                    </telerik:ChartSeries>
                    <telerik:ChartSeries Type="Line" Name="Seller's Profolio" DataYColumn="ProfolioPercent3" DefaultLabelValue="#Y{N0}">
                        <Appearance ShowLabels="false" PointShape="Star3">
                            <FillStyle MainColor="118, 203, 76" SecondColor="73, 166, 22">
                                <FillSettings GradientMode="Vertical" />
                            </FillStyle>
                            <TextAppearance TextProperties-Color="Black" />
                            <LineSeriesAppearance Width="2" PenStyle="Solid" />
                        </Appearance>
                    </telerik:ChartSeries>
                </Series>
                <Legend>
                    <Appearance Overflow="Row" Dimensions-Margins="1%, 1%, 1%, 1%" Position-AlignedPosition="Top">
                        <ItemMarkerAppearance Figure="Square">
                            <Border Color="134, 134, 134" />
                        </ItemMarkerAppearance>
                        <FillStyle MainColor="">
                        </FillStyle>
                        <Border Color="Transparent" />
                    </Appearance>
                </Legend>
                <PlotArea>
                    <EmptySeriesMessage TextBlock-Text=" No data available" />
                    <XAxis DataLabelsColumn="Label" Step="1">
                        <Appearance Color="134, 134, 134" MajorTick-Color="134, 134, 134">
                            <MajorGridLines Color="209, 222, 227" PenStyle="Solid" />
                            <TextAppearance TextProperties-Color="51, 51, 51" />
                        </Appearance>
                        <AxisLabel>
                            <TextBlock>
                                <Appearance TextProperties-Color="51, 51, 51" />
                            </TextBlock>
                        </AxisLabel>
                        <Items>
                            <telerik:ChartAxisItem TextBlock-Text="<=36" Value="0" />
                            <telerik:ChartAxisItem TextBlock-Text="37_42" Value="1" />
                            <telerik:ChartAxisItem TextBlock-Text="43_48" Value="2" />
                            <telerik:ChartAxisItem TextBlock-Text="49_54" Value="3" />
                            <telerik:ChartAxisItem TextBlock-Text="55_60" Value="4" />
                            <telerik:ChartAxisItem TextBlock-Text="61_66" Value="5" />
                            <telerik:ChartAxisItem TextBlock-Text="67_72" Value="6" />
                            <telerik:ChartAxisItem TextBlock-Text=">72" Value="7" />
                        </Items>
                    </XAxis>
                    <YAxis IsLogarithmic="false" Visible="true">
                        <Appearance Color="134, 134, 134" MajorTick-Color="134, 134, 134" MinorTick-Color="134, 134, 134" MinorTick-Width="0">
                            <MajorGridLines Color="209, 222, 227" />
                            <MinorGridLines Color="233, 239, 241" />
                            <TextAppearance TextProperties-Color="51, 51, 51" />
                        </Appearance>
                        <AxisLabel>
                            <TextBlock Text="% of Portfolio" >
                                <Appearance TextProperties-Color="51, 51, 51" Position-AlignedPosition="TopLeft"  />
                            </TextBlock>
                        </AxisLabel>
                        <Items>
                            <telerik:ChartAxisItem TextBlock-Text="0%" Value="0" />
                            <telerik:ChartAxisItem TextBlock-Text="10%" Value="1" />
                            <telerik:ChartAxisItem TextBlock-Text="20%" Value="2" />
                            <telerik:ChartAxisItem TextBlock-Text="30%" Value="3" />
                            <telerik:ChartAxisItem TextBlock-Text="40%" Value="4" />
                            <telerik:ChartAxisItem TextBlock-Text="50%" Value="5" />
                            <telerik:ChartAxisItem TextBlock-Text="60%" Value="6" />
                            <telerik:ChartAxisItem TextBlock-Text="70%" Value="7" />
                            <telerik:ChartAxisItem TextBlock-Text="80%" Value="8" />
                            <telerik:ChartAxisItem TextBlock-Text="90%" Value="9" />
                            <telerik:ChartAxisItem TextBlock-Text="100%" Value="10" />
                        </Items>
                    </YAxis>
                    <Appearance Dimensions-Margins="8%, 6%, 8%, 6%">
                        <FillStyle FillType="Solid" MainColor="White" />
                        <Border Color="134, 134, 134" />
                    </Appearance>
                </PlotArea>
                <ChartTitle>
                    <Appearance Position-AlignedPosition="Top" Dimensions-Margins="1%, 1%, 1%, 1%" >
                        <FillStyle MainColor="">
                        </FillStyle>
                    </Appearance>
                    <TextBlock Text="Remaining Term (mos)">
                        <Appearance TextProperties-Font="Tahoma, 13pt" />
                    </TextBlock>
                </ChartTitle>
            </telerik:RadChart>
        </telerik:RadAjaxPanel>
    </div>
    <div class="dynamic_box" style="width: 95%">
        <telerik:RadAjaxPanel ID="apnlChartPurchasedBalance" runat="server" LoadingPanelID="ajaxLoadingPanel">
            <telerik:RadChart ID="chartPurchasedBalance" runat="server" Skin="Mac" Width="490px" AutoLayout="True" DefaultType="Line" IntelligentLabelsEnabled="True">
                <ClientSettings EnableZoom="false" ScrollMode="None" />
                <Appearance Corners="Round, Round, Round, Round, 6">
                    <FillStyle FillType="Image">
                        <FillSettings BackgroundImage="{chart}" ImageDrawMode="Flip" ImageFlip="FlipX" />
                    </FillStyle>
                    <Border Color="138, 138, 138" />
                </Appearance>
                <Series>
                    <telerik:ChartSeries Type="Line" Name="Full ILS Profolio" DataYColumn="ProfolioPercent1" DefaultLabelValue="#Y{N0}">
                        <Appearance ShowLabels="false" PointShape="Diamond">
                            <FillStyle MainColor="55, 167, 226" SecondColor="22, 85, 161">
                                <FillSettings GradientMode="Vertical" />
                            </FillStyle>
                            <TextAppearance TextProperties-Color="Black" />
                            <LineSeriesAppearance Width="2" PenStyle="Solid" />
                        </Appearance>
                    </telerik:ChartSeries>
                    <telerik:ChartSeries Type="Line" Name="Import Profolio" DataYColumn="ProfolioPercent2" DefaultLabelValue="#Y{N0}">
                        <Appearance ShowLabels="false" PointShape="Triangle">
                            <FillStyle MainColor="223, 87, 60" SecondColor="200, 38, 37">
                                <FillSettings GradientMode="Vertical" />
                            </FillStyle>
                            <TextAppearance TextProperties-Color="Black" />
                            <LineSeriesAppearance Width="2" PenStyle="Solid" />
                        </Appearance>
                    </telerik:ChartSeries>
                    <telerik:ChartSeries Type="Line" Name="Seller's Profolio" DataYColumn="ProfolioPercent3" DefaultLabelValue="#Y{N0}">
                        <Appearance ShowLabels="false" PointShape="Star3">
                            <FillStyle MainColor="118, 203, 76" SecondColor="73, 166, 22">
                                <FillSettings GradientMode="Vertical" />
                            </FillStyle>
                            <TextAppearance TextProperties-Color="Black" />
                            <LineSeriesAppearance Width="2" PenStyle="Solid" />
                        </Appearance>
                    </telerik:ChartSeries>
                </Series>
                <Legend>
                    <Appearance Overflow="Row" Dimensions-Margins="1%, 1%, 1%, 1%" Position-AlignedPosition="Top">
                        <ItemMarkerAppearance Figure="Square">
                            <Border Color="134, 134, 134" />
                        </ItemMarkerAppearance>
                        <FillStyle MainColor="">
                        </FillStyle>
                        <Border Color="Transparent" />
                    </Appearance>
                </Legend>
                <PlotArea>
                    <EmptySeriesMessage TextBlock-Text=" No data available" />
                    <XAxis DataLabelsColumn="Label" Step="1">
                        <Appearance Color="134, 134, 134" MajorTick-Color="134, 134, 134">
                            <MajorGridLines Color="209, 222, 227" PenStyle="Solid" />
                            <TextAppearance TextProperties-Color="51, 51, 51" />
                        </Appearance>
                        <AxisLabel>
                            <TextBlock>
                                <Appearance TextProperties-Color="51, 51, 51" />
                            </TextBlock>
                        </AxisLabel>
                        <Items>
                            <telerik:ChartAxisItem TextBlock-Text="<$5K" Value="0" />
                            <telerik:ChartAxisItem TextBlock-Text="$5K_10K" Value="1" />
                            <telerik:ChartAxisItem TextBlock-Text="$11_15" Value="2" />
                            <telerik:ChartAxisItem TextBlock-Text="$16_20" Value="3" />
                            <telerik:ChartAxisItem TextBlock-Text="$21_25" Value="4" />
                            <telerik:ChartAxisItem TextBlock-Text=">$25" Value="5" />
                        </Items>
                    </XAxis>
                    <YAxis IsLogarithmic="false" Visible="true">
                        <Appearance Color="134, 134, 134" MajorTick-Color="134, 134, 134" MinorTick-Color="134, 134, 134" MinorTick-Width="0">
                            <MajorGridLines Color="209, 222, 227" />
                            <MinorGridLines Color="233, 239, 241" />
                            <TextAppearance TextProperties-Color="51, 51, 51" />
                        </Appearance>
                        <AxisLabel>
                            <TextBlock Text="% of Portfolio" >
                                <Appearance TextProperties-Color="51, 51, 51" Position-AlignedPosition="TopLeft"  />
                            </TextBlock>
                        </AxisLabel>
                        <Items>
                            <telerik:ChartAxisItem TextBlock-Text="0%" Value="0" />
                            <telerik:ChartAxisItem TextBlock-Text="10%" Value="1" />
                            <telerik:ChartAxisItem TextBlock-Text="20%" Value="2" />
                            <telerik:ChartAxisItem TextBlock-Text="30%" Value="3" />
                            <telerik:ChartAxisItem TextBlock-Text="40%" Value="4" />
                            <telerik:ChartAxisItem TextBlock-Text="50%" Value="5" />
                            <telerik:ChartAxisItem TextBlock-Text="60%" Value="6" />
                            <telerik:ChartAxisItem TextBlock-Text="70%" Value="7" />
                            <telerik:ChartAxisItem TextBlock-Text="80%" Value="8" />
                        </Items>
                    </YAxis>
                    <Appearance Dimensions-Margins="8%, 6%, 8%, 6%">
                        <FillStyle FillType="Solid" MainColor="White" />
                        <Border Color="134, 134, 134" />
                    </Appearance>
                </PlotArea>
                <ChartTitle>
                    <Appearance Position-AlignedPosition="Top" Dimensions-Margins="1%, 1%, 1%, 1%" >
                        <FillStyle MainColor="">
                        </FillStyle>
                    </Appearance>
                    <TextBlock Text="Purchased Balance">
                        <Appearance TextProperties-Font="Tahoma, 13pt" />
                    </TextBlock>
                </ChartTitle>
            </telerik:RadChart>
        </telerik:RadAjaxPanel>
    </div>
</asp:Content>

Sayle
Top achievements
Rank 1
 answered on 13 Jun 2012
1 answer
232 views
I understand this is a relatively new product, but I'm running into a pretty odd issue with the chart not formatting decimal values from a Typed List into currency.

Here is what's on the front-end. Note, that for the DataFormatString in the Series' Label and Tooltip Appearance I've tried ${0}, {0:C}, ${0:0.00}, and a multitude of other options. However, it would show the entire decimal value (rather than rounding up on the last two digits) (see attached). What's interesting is that the Y-Axis label comes up perfectly fine.

This is what generates the data for the chart:

var qry = _ctx.VSalesRepCommissionGroupeds
    .Where(s => s.SurgeryDate.Value >= RadCommissionChartBeginOn)
    .OrderBy(s => s.SurgeryDate.Value)
    .Select(r => new
    {
        r.CommissionDue,
        SurgeryDate = r.SurgeryDate.Value.ToString("MMM yyyy")
    }).ToList();
 
radData = qry.GroupBy(r => r.SurgeryDate).Select(r => new RepCommissionChartData
{
    Commissions = r.Sum(x => x.CommissionDue),
    SurgeryDate = r.Key
}).ToList();


Now, if I change the line that generates the sum of CommissionDue to decimal.Round(r.Sum(x => x.CommissionDue), 2, MidpointRounding.AwayFromZero) it obviously rounds up the first two digits, but doesn't show a comma.

Shouldn't the front end format it using either of those formatting options or am I doing something wrong?
Marin Bratanov
Telerik team
 answered on 13 Jun 2012
1 answer
70 views
The series are constructed by the result of a sql. The X-axis has a period of time. The problem is that I have a number to one for Mastercard and Visa. series corresponding to the Visa, the first value in this query is regarding Jul/2011, but the X-axis starts at Jun/2011. What happens is that the plot of this chart, getting in Jun/2011 and not jul/2011. How do I assign the series to the query result?
Evgenia
Telerik team
 answered on 13 Jun 2012
1 answer
104 views

Hi, I’m currently experiencing a problem with the RadDataPager and the Dialog handlers.

My application has a RadListView control with a RadDataPager in the layout. In the RadDataPager, I’m using the Routing functionality. In the Application_Start I have the relevant registration as documented in the forums here.

The problem is, when I register routes it breaks the handlers for the Telerik Dialogs in the RadEditor and other such controls. I will post the code that I think is the source of the problem and where the problem arises.

the aspx file has this section:
<Telerik:RadListView ID="RadListView1" runat="server"
        DataSourceID="SqlSource"
        ItemPlaceholderID="ItemContainer"
        AllowPaging="True"
        InsertItemPosition="FirstItem"
        ClientIDMode="Static">
    <LayoutTemplate>
        <asp:PlaceHolder ID="ItemContainer" runat="server" />
        <Telerik:RadButton ID="InsertButton" runat="server"
                CssClass="InsertButton"
                Text="New Announcement"
                ButtonType="LinkButton"
                CommandName="InitInsert"
                Skin="CustomRad"
                EnableEmbeddedSkins="False"
                EnableAjaxSkinRendering="False"
                Visible='<%# Not Container.IsItemInserted %>'>
                    <Icon PrimaryIconCssClass="rbAdd" PrimaryIconLeft="4" PrimaryIconTop="4" />
        </Telerik:RadButton>
 
        <Telerik:RadDataPager ID="RadDataPager1" runat="server"
                PagedControlID="RadListView1"
                PageSize="5"
                AllowSEOPaging="true"
                SEOPagingQueryPageKey="Page"
                    AllowRouting="true"
                    RouteName="AnouMain"
                    RoutePageIndexParameterName="Page">
            <Fields>
                <Telerik:RadDataPagerButtonField FieldType="FirstPrev" />
                <Telerik:RadDataPagerButtonField FieldType="Numeric"
                        FirstButtonText="First"
                        LastButtonText="Last"
                        NextButtonText="Next"
                        PrevButtonText="Prev" />
                <Telerik:RadDataPagerButtonField FieldType="NextLast" />
            </Fields>
        </Telerik:RadDataPager>
    </LayoutTemplate>
         ... Templates omitted ...
</Telerik:RadListView>

the class i use for the registering of routes is:

Namespace SeoRouting
 
    ''' <summary>
    ''' Route Registering and other SEO Op functions and subs
    ''' </summary>
    ''' <remarks>TODO: Remarks to follow</remarks>
    Public Class Register
 
        Public Shared Sub Routes(ByVal Routes As System.Web.Routing.RouteCollection)
            Dim RouteValueDictionary As New System.Web.Routing.RouteValueDictionary()
            RouteValueDictionary.Add("Page", "1")
            Routes.MapPageRoute("AnouDefa", "en/Anou/{Page}", "~/en/Anou/Default.aspx", True, RouteValueDictionary)
            Routes.MapPageRoute("AnouMain", "announcements/Page{Page}", "~/en/Anou/Main.aspx", True, RouteValueDictionary)
        End Sub
 
    End Class
 
End Namespace

and the app start looks like this:

Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
        SeoRouting.Register.Routes(RouteTable.Routes)
End Sub

the web.config:

<httpHandlers>
    <!--<add verb="*" path="*.psd" type="System.Web.HttpForbiddenHandler" />-->
    <add path="ChartImage.axd"
         type="Telerik.Web.UI.ChartHttpHandler"
         verb="*" validate="false" />
    <add path="Telerik.Web.UI.SpellCheckHandler.axd"
         type="Telerik.Web.UI.SpellCheckHandler"
         verb="*" validate="false" />
    <add path="Telerik.Web.UI.DialogHandler.aspx"
         type="Telerik.Web.UI.DialogHandler"
         verb="*" validate="false" />
    <add path="Telerik.RadUploadProgressHandler.ashx"
         type="Telerik.Web.UI.RadUploadProgressHandler"
         verb="*" validate="false" />
    <add path="Telerik.Web.UI.WebResource.axd"
         type="Telerik.Web.UI.WebResource"
         verb="*" validate="false" />
</httpHandlers>
    <handlers>
        <remove name="ChartImage_axd" />
        <remove name="Telerik_Web_UI_SpellCheckHandler_axd" />
        <remove name="Telerik_Web_UI_DialogHandler_aspx" />
        <remove name="Telerik_RadUploadProgressHandler_ashx" />
        <remove name="Telerik_Web_UI_WebResource_axd" />
        <add name="ChartImage_axd" path="ChartImage.axd"
             type="Telerik.Web.UI.ChartHttpHandler"
             verb="*" preCondition="integratedMode" />
        <add name="Telerik_Web_UI_SpellCheckHandler_axd"
             path="Telerik.Web.UI.SpellCheckHandler.axd"
             type="Telerik.Web.UI.SpellCheckHandler"
             verb="*" preCondition="integratedMode" />
        <add name="Telerik_Web_UI_DialogHandler_aspx"
             path="Telerik.Web.UI.DialogHandler.aspx"
             type="Telerik.Web.UI.DialogHandler"
             verb="*" preCondition="integratedMode" />
        <add name="Telerik_RadUploadProgressHandler_ashx"
             path="Telerik.RadUploadProgressHandler.ashx"
             type="Telerik.Web.UI.RadUploadProgressHandler"
             verb="*" preCondition="integratedMode" />
        <add name="Telerik_Web_UI_WebResource_axd"
             path="Telerik.Web.UI.WebResource.axd"
             type="Telerik.Web.UI.WebResource" verb="*"
             preCondition="integratedMode" />
    </handlers>
</system.webServer>

so to be clear, when i have the routing on in the App_Start the dialogs don’t function throwing an error saying that the handlers are
missing from the Web.config I reviewed This Telerik Document for help but couldn’t see the solution.


Kind Regards.
M Mason.

===========
Q1 2012
Win7-64
ASP.NET 4.0 VB

Pavlina
Telerik team
 answered on 13 Jun 2012
1 answer
117 views
Hi Team,
I am using both radwindow version's "1.9.0.0" and "2009.1.527.20". The problem is the radwindow is not opening in iPhone (tested with iOS 4.2) and iPad's.

Below is the code I am using in my page..
in Javascript
            var oManager = GetRadWindowManager();
            var oWnd = oManager.GetWindowByName("RadWindow1");
            oWnd.Show();
            oWnd.SetSize();
            oWnd.SetUrl("pagename.aspx?Total=" + totalBalance + "&Amount=" + amount);
            return false;

and the design is below
    <radW:RadWindowManager Skin="Office2007" ID="RadWindowManager1" runat="server">
        <Windows>
            <radW:RadWindow ID="RadWindow11" NavigateUrl="pagename.aspx" SkinsPath="~/RadControls/Window/Skins"
                Width="320px" Height="300px" Left="700px" Top="200px" Modal="false" Behavior="move,Resize" />
        </Windows>
    </radW:RadWindowManager>

Please let me know how can I fix this...
Thanks in advance.

Regards,
Babu R
Marin Bratanov
Telerik team
 answered on 13 Jun 2012
5 answers
343 views
Hi guys,
I am new to programming and maybe my enquiries seem funny.
Currently I am using the RadTagCloud Control based on data binding in my prototype system.
Everything works great. I just want to open the resource related to each tag (which is stored in NavigareURL field) in a new window when I click each item in the TagCloud.
Any ideas?

Also, I have a textbox in my web page which I want to clear its content when I click on any tag in the tag cloud, but the RadTagCloud1_ItemClick is not fired to do this.
Any help here?

Cheers,
Hamed
Slav
Telerik team
 answered on 13 Jun 2012
1 answer
114 views
Hi u have 2010 q3 asp.net Ajax rad menu that I data bind to a SQL data source. Which part of the CSS should I change to add more space to the left and right of the separators to try an space the menu options evenly to fill the entire width of the menu?
Princy
Top achievements
Rank 2
 answered on 13 Jun 2012
1 answer
151 views

Hi,

I am using the HeaderContextMenu in my radgrid to show and hide the columns.  I want to save the users preference as to what columns they have visible.  I thought that this would be easy and I could just save the GridColumn.Display value.   But when I hide a column using the HeaderContextMenu the display value for that column is still true.

Where is the information regarding what columns have been hidden by the user using the HeaderContextMenu?

Eyup
Telerik team
 answered on 13 Jun 2012
1 answer
134 views
Hi All,

 I  have RadListView  having some data .I want to do some operation in the code behind when the checkbox in the listview is checked
 I have the code as below

<telerik:RadListView ID="lstViewSelectedContact" runat="server" ItemPlaceholderID="pnlItemholder"
                                    OnSelectedIndexChanged="listView_SelectedIndexChanged"  Width="600px"  OnPreRender = "lstViewSelectedContact_OnPreRender"
                                    AllowMultiItemSelection="true" DataKeyNames="id"  Visible="true"   
                                    OnNeedDataSource="lstViewSelectedContact_NeedDataSource"
                                    onitemcommand="lstViewSelectedContact_ItemCommand"  >
                                    <LayoutTemplate>
                                        <asp:Panel ID="pnlItemholder" runat="server" Height="100px"></asp:Panel>
                                    </LayoutTemplate>
                                    <ItemTemplate>
                                        <span>
                                            <asp:CheckBox ID="chkSelect" runat="server" AutoPostBack="true"   OnCheckedChanged="chkSelect_OnCheckedChanged" BackColor="Transparent" BorderStyle="None" Text='<%#Eval("text") %>'>                                                   
                                            </asp:CheckBox>                                       
                                        </span>                                     
                                    </ItemTemplate>
                                    <SelectedItemTemplate>
                                        <asp:CheckBox ID="chkSelectedItem" runat="server" AutoPostBack="true" BackColor="LightSkyBlue" BorderStyle="None" CommandName="Deselect" Text='<%#Eval("text") %>'>
                                                   
                                        </asp:CheckBox>                                     
                                      
                                    </SelectedItemTemplate>                                   
                                    <ItemSeparatorTemplate>
                                        <span style="color: Black; font-weight: normal;"></span>
                                    </ItemSeparatorTemplate>
                                </telerik:RadListView>


The Problem is that I cant get the checked items(ID and value) in the code behind ie in chkSelect_OnCheckedChanged event.
Thanks
 Kumar
Shinu
Top achievements
Rank 2
 answered on 13 Jun 2012
1 answer
75 views
I have a RadChart and RadGrid populated with items. (The Datasources are different due to the returned data but they have the same DataKey values)

How can I quickly allow the user to select any of the items on the Radchart and make that the SelectedRow for the RadGrid? (the items will share the same DataKey value) 

I want them to be able to click the bar chart item and then have the corresponding record highlighted on the Radgrid below the chart.

I tried attaching an event handler for the Click events which seems to create event behavior I would expect, but I am having trouble linking these two controls together in the manner I would like.  I believe there would be a quick clientside solution for this so I can simply get a reference to the RadGrid, find the row with a DataKey value that matches the one that it was called from, and make that the SelectedRow so it will be highlighted to the user.  Sounds good in theory but I am having trouble with implementation of such a scenario.

Any help is appreciated
Petar Marchev
Telerik team
 answered on 13 Jun 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?