Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
164 views
Hi All

Have a radgrid with 3 columns.

There are 25 records.

It woks fine.

The grid height is only 200px;

So only 2 recods can be viewed. scrolling is there.

But while scolling the header (title bar) also scrolls up.

Is there any option to stop this.

Thank You

-Anto

Princy
Top achievements
Rank 2
 answered on 03 Nov 2009
1 answer
104 views
Hi All,
Whatever I do, I cant seem to bind RadToolTipManager with RadPanelBar controls.
I am creating the RadPanelBar controls in the Serverside and binding to the page. That part is working fine. But I need a popup on mouseover to the RadPanelBar.
If I use the RadPanelBar.ToolTip that works fine, but I cant control the length it should stay visible.
Some help in figuring out would be nice.
Thanks
Paul
Telerik team
 answered on 03 Nov 2009
1 answer
171 views
i have this on the front end
<telerik:RadPanelBar ID="RadPanelBar1" runat="server" Width="150px" Height="800px" ExpandMode="FullExpandedItem"   
                        OnItemClick="RadPanelBar1_ItemClick" Skin="Vista">  
                        <Items> 
                            <telerik:RadPanelItem  Value="RadPanelBar_ThumbNail" Text="Pictures" Expanded="true">  
                                <Items> 
                                    <telerik:RadPanelItem Value="ThumbNail_Child" /> 
                                </Items>                              
                            </telerik:RadPanelItem> 
                        </Items> 
                    </telerik:RadPanelBar> 
and in the server i have
Dim PanelItem As RadPanelItem = DirectCast(RadPanelBar1.Items(0), RadPanelItem)  
            For Each sFile As String In System.IO.Directory.GetFiles(Server.MapPath("images/thumbnail"))  
                Dim sJustFile As String = New System.IO.FileInfo(sFile).Name  
                Dim ChildItem As New RadPanelItem  
                ChildItem.Text = " " 
                ChildItem.ImageUrl = "images/thumbnail/" & sJustFile.ToString  
                ChildItem.Value = Replace(sJustFile.ToString, "-thumb.jpg", "")  
                PanelItem.Items.Add(ChildItem)  
            Next 
this will make my image clickable but if i take out CHILDITEM.TEXT = " " then my items are not clickable anymore. is there any other way to do this? please help thank you very much.
Paul
Telerik team
 answered on 03 Nov 2009
2 answers
122 views
Hi All

I have a radgrid with some 25 records it works fine.

In the right bottom of the grid in the status bar, there is   Displaying page 1 of 2, items 1 to 10 of 12.

Is there any option to customize it, or to remove it,

Because my grid width is just 200px, So I need to cut-short it or remove it.

<telerik:RadGrid Height = "245px" ID = "rgDept" AllowPaging = "true" Skin = "Vista" AllowMultiRowSelection = "false" runat = "server" DataSourceID = "sdsDept" AutoGenerateColumns = "false">  
                    <PagerStyle PagerTextFormat=" "/>    
                        <MasterTableView PagerStyle-Mode = "NextPrevAndNumeric" PageSize = "8" ClientDataKeyNames = "DepartmentCode" AutoGenerateColumns = "false" DataSourceID = "sdsDept" DataKeyNames = "DepartmentCode">  
                            <Columns>  
                                <telerik:GridBoundColumn HeaderText = "Code" Visible = "false" ReadOnly = "true" DataField = "DepartmentCode" UniqueName = "DepartmentCode"></telerik:GridBoundColumn>  
                                <telerik:GridBoundColumn HeaderText = "Department" DataField = "DepartmentName" UniqueName = "DepartmentName"></telerik:GridBoundColumn>  
                            </Columns>  
                        </MasterTableView>  
                        <ClientSettings>  
                        <Selecting AllowRowSelect = "true"/>  
                        </ClientSettings>  
                    </telerik:RadGrid> 


I have aleady posted this one. And I got reply too. But it does't work. And I am not able to reply on that thread, so i have created a new one.

-Anto
Anto (DLL Version : 2008.3.1314.35)
Top achievements
Rank 2
 answered on 03 Nov 2009
2 answers
80 views
Hi All,

Have a grid with datas and a label with text "WELCOME".

When I select a row in the grid need to change the label to "In THE GRID".

Is there any option like gotfocus to solve this.

Thanking You

-Anto
Anto (DLL Version : 2008.3.1314.35)
Top achievements
Rank 2
 answered on 03 Nov 2009
1 answer
165 views
If you type somthing like 1/x into the edit box, it appears that some client javascript automatically changes this into something like 10/1/2009 when you tab out of the edit box.

Is there a way to disable the automatic conversion?

I would like the edit box to leave the value the user entered so I can do validation when the form is submitted.

Thanks!
Shinu
Top achievements
Rank 2
 answered on 03 Nov 2009
3 answers
956 views
I have two RadGrids (RadGrid1 and RadGrid2)

In radgrid1 I have a list of jobs with a field called "JobID", on a button click, it inserts JobID and current username into another table which RadGrid2 is based on.

I would like to add a test/check to my button click event, that checks RadGrid2 to see if the JobID that is being inserted already exist in radgrid2, and if so pop-up a radalert saying that tells the user they already have that JobID in radgrid2.

I will inclide my current working code, so you can see where I am at, thnks for any help you can provide.
<%@ Page Title="" Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" 
    CodeFile="view.aspx.vb" Inherits="jobs_view" %> 
 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">  
</asp:Content> 
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">  
    <span class="hdrtext">Available Jobs</span> 
    <telerik:RadGrid ID="RadGrid1" runat="server" DataSourceID="dsViewJobs" GridLines="None" 
        Skin="Default">  
        <MasterTableView AutoGenerateColumns="False" DataKeyNames="JobID" DataSourceID="dsViewJobs">  
            <RowIndicatorColumn> 
                <HeaderStyle Width="20px"></HeaderStyle> 
            </RowIndicatorColumn> 
            <ExpandCollapseColumn> 
                <HeaderStyle Width="20px"></HeaderStyle> 
            </ExpandCollapseColumn> 
            <Columns> 
                <telerik:GridBoundColumn DataField="JobID" DataType="System.Int32" HeaderText="JobID" 
                    ReadOnly="True" SortExpression="JobID" UniqueName="JobID" Visible="False">  
                </telerik:GridBoundColumn> 
                <telerik:GridBoundColumn DataField="JobTitle" HeaderText="JobTitle" SortExpression="JobTitle" 
                    UniqueName="JobTitle" Visible="False">  
                </telerik:GridBoundColumn> 
                <telerik:GridBoundColumn DataField="JobFile" HeaderText="JobFile" SortExpression="JobFile" 
                    UniqueName="JobFile" Visible="False">  
                </telerik:GridBoundColumn> 
                <telerik:GridBoundColumn DataField="PositionQty" DataType="System.Int32" HeaderText="PositionQty" 
                    SortExpression="PositionQty" UniqueName="PositionQty" Visible="False">  
                </telerik:GridBoundColumn> 
                <telerik:GridHyperLinkColumn DataNavigateUrlFields="JobFile" DataTextField="JobTitle" 
                    HeaderText="Job Title" UniqueName="JobFileHyperLink">  
                </telerik:GridHyperLinkColumn> 
                <telerik:GridTemplateColumn HeaderText="Apply" UniqueName="Apply">  
                    <ItemTemplate> 
                        <asp:Button ID="btnApply" runat="server" Text="Apply" OnClick="btnApply_Click" /> 
                    </ItemTemplate> 
                </telerik:GridTemplateColumn> 
            </Columns> 
        </MasterTableView> 
    </telerik:RadGrid> 
    <asp:SqlDataSource ID="dsViewJobs" runat="server" ConnectionString="<%$ ConnectionStrings:csSSEA %>" 
        SelectCommand="SELECT * FROM [Jobs] ORDER BY [JobTitle], [PositionQty]" ConflictDetection="CompareAllValues" 
        DeleteCommand="DELETE FROM [Jobs] WHERE [JobID] = @original_JobID AND (([JobTitle] = @original_JobTitle) OR ([JobTitle] IS NULL AND @original_JobTitle IS NULL)) AND (([JobFile] = @original_JobFile) OR ([JobFile] IS NULL AND @original_JobFile IS NULL)) AND [PositionQty] = @original_PositionQty" 
        InsertCommand="INSERT INTO [UserJobs] ([Username], [JobID]) VALUES (@Username, @JobID)" 
        OldValuesParameterFormatString="original_{0}" UpdateCommand="UPDATE [Jobs] SET [JobTitle] = @JobTitle, [JobFile] = @JobFile, [PositionQty] = @PositionQty WHERE [JobID] = @original_JobID AND (([JobTitle] = @original_JobTitle) OR ([JobTitle] IS NULL AND @original_JobTitle IS NULL)) AND (([JobFile] = @original_JobFile) OR ([JobFile] IS NULL AND @original_JobFile IS NULL)) AND [PositionQty] = @original_PositionQty">  
        <DeleteParameters> 
            <asp:Parameter Name="original_JobID" Type="Int32" /> 
            <asp:Parameter Name="original_JobTitle" Type="String" /> 
            <asp:Parameter Name="original_JobFile" Type="String" /> 
            <asp:Parameter Name="original_PositionQty" Type="Int32" /> 
        </DeleteParameters> 
        <UpdateParameters> 
            <asp:Parameter Name="JobTitle" Type="String" /> 
            <asp:Parameter Name="JobFile" Type="String" /> 
            <asp:Parameter Name="PositionQty" Type="Int32" /> 
            <asp:Parameter Name="original_JobID" Type="Int32" /> 
            <asp:Parameter Name="original_JobTitle" Type="String" /> 
            <asp:Parameter Name="original_JobFile" Type="String" /> 
            <asp:Parameter Name="original_PositionQty" Type="Int32" /> 
        </UpdateParameters> 
        <InsertParameters> 
            <asp:ProfileParameter Name="Username" PropertyName="UserName" Type="String" /> 
            <asp:Parameter Name="JobID" DefaultValue="1" Type="Int32" /> 
        </InsertParameters> 
    </asp:SqlDataSource> 
    <br /> 
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server" IconUrl="/img/icons/error.png" 
                Skin="Forest" Title="Error">  
                <Windows> 
                <telerik:RadWindow ID="radconfirm" IconUrl="/img/icons/help.png"></telerik:RadWindow>   
                </Windows> 
    </telerik:RadWindowManager> 
    <span class="hdrtext">Jobs You Have Applied For</span> 
 
    <script type="text/javascript">  
        var oldConfirm = radconfirm;  
 
        window.radconfirm = function(text, mozEvent) {  
            var ev = mozEvent ? mozEvent : window.event; //Moz support requires passing the event argument manually        
            //Cancel the event        
            ev.cancelBubble = true;  
            ev.returnValue = false;  
            if (ev.stopPropagation) ev.stopPropagation();  
            if (ev.preventDefault) ev.preventDefault();  
 
            //Determine who is the caller        
            var callerObj = ev.srcElement ? ev.srcElement : ev.target;  
 
            //Call the original radconfirm and pass it all necessary parameters        
            if (callerObj) {  
                //Show the confirm, then when it is closing, if returned value was true, automatically call the caller's click method again.        
                var callBackFn = function(arg) {  
                    if (arg) {  
                        callerObj["onclick"] = "";  
                        if (callerObj.click) callerObj.click(); //Works fine every time in IE, but does not work for links in Moz        
                        else if (callerObj.tagName == "A") //We assume it is a link button!        
                        {  
                            try {  
                                eval(callerObj.href)  
                            }  
                            catch (e) { }  
                        }  
                    }  
                }  
                oldConfirm('Are you sure you want to delete this job from your application?', callBackFn, 300, 100, null,'Delete Confirmation');  
            }  
            return false;  
        }       
    
    </script> 
 
    <telerik:RadGrid ID="RadGrid2" runat="server" DataSourceID="dsViewJobsAppliedFor" 
        GridLines="None" Skin="Default">  
        <MasterTableView AutoGenerateColumns="False" DataKeyNames="UserJobID" DataSourceID="dsViewJobsAppliedFor" 
            AllowAutomaticDeletes="True">  
            <RowIndicatorColumn> 
                <HeaderStyle Width="20px"></HeaderStyle> 
            </RowIndicatorColumn> 
            <ExpandCollapseColumn> 
                <HeaderStyle Width="20px"></HeaderStyle> 
            </ExpandCollapseColumn> 
            <Columns> 
                <telerik:GridBoundColumn DataField="username" HeaderText="username" SortExpression="username" 
                    UniqueName="username" Visible="False">  
                </telerik:GridBoundColumn> 
                <telerik:GridBoundColumn DataField="UserJobID" DataType="System.Int32" HeaderText="UserJobID" 
                    SortExpression="UserJobID" UniqueName="UserJobID" ReadOnly="True" Visible="False">  
                </telerik:GridBoundColumn> 
                <telerik:GridBoundColumn DataField="JobID" DataType="System.Int32" HeaderText="JobID" 
                    SortExpression="JobID" UniqueName="JobID" Visible="False">  
                </telerik:GridBoundColumn> 
                <telerik:GridBoundColumn DataField="JobTitle" HeaderText="JobTitle" SortExpression="JobTitle" 
                    UniqueName="JobTitle" Visible="False">  
                </telerik:GridBoundColumn> 
                <telerik:GridBoundColumn DataField="JobFile" HeaderText="JobFile" SortExpression="JobFile" 
                    UniqueName="JobFile" Visible="False">  
                </telerik:GridBoundColumn> 
                <telerik:GridHyperLinkColumn DataNavigateUrlFields="JobFile" DataTextField="JobTitle" 
                    HeaderText="Job Title" UniqueName="column">  
                </telerik:GridHyperLinkColumn> 
                <%--<telerik:GridButtonColumn ButtonType="PushButton" CommandName="Delete"   
            Text="Delete" UniqueName="Delete" HeaderText="Delete"   
            ConfirmText="Are you sure you want to delete this job from your application?" > 
        </telerik:GridButtonColumn>--%> 
                <telerik:GridTemplateColumn UniqueName="DeleteColumn" HeaderText="Delete">  
                    <%-- <HeaderTemplate>    
                                <table width="100%">     
                                    <tr>    
                                        <td style="width:50%">     
                                            RadConfirm</td>    
                                        <td style="width:50%">     
                                            Default confirm</td>    
                                    </tr>    
                                </table>    
                            </HeaderTemplate>--%> 
                    <ItemTemplate> 
                        <asp:Button ID="btnDelete" ToolTip="Delete Record" runat="server" CausesValidation="False" 
                            Text="Delete" CommandName="Delete" OnClientClick="return radconfirm('Are you sure you want to delete this record?', event);" /> 
                        <%--<table width="100%">     
                                    <tr>    
                                        <td>    
                                            </td>     
                                        <td>    
                                            <asp:ImageButton ID="ImageButton1" ToolTip="Delete Record" runat="server" CausesValidation="False"    
                                                CommandName="Delete" OnClientClick="return confirm('Are you sure you want to delete this record?');"    
                                                ImageUrl="~/RadControls/Grid/Skins/Default/Delete.gif" />    
                                        </td>    
                                    </tr>    
                                </table>--%> 
                    </ItemTemplate> 
                </telerik:GridTemplateColumn> 
            </Columns> 
            <EditFormSettings> 
                <EditColumn ButtonType="ImageButton">  
                </EditColumn> 
            </EditFormSettings> 
        </MasterTableView> 
    </telerik:RadGrid> 
    <asp:SqlDataSource ID="dsViewJobsAppliedFor" runat="server" ConflictDetection="CompareAllValues" 
        ConnectionString="<%$ ConnectionStrings:csSSEA %>" DeleteCommand="DELETE FROM [UserJobs] WHERE [userjobid] = @original_userjobid" 
        InsertCommand="INSERT INTO [UserJobs] ([Username], [JobID]) VALUES (@Username, @JobID)" 
        OldValuesParameterFormatString="original_{0}" SelectCommand="SELECT uj.username, uj.UserJobID, uj.JobID, j.JobTitle, j.JobFile FROM UserJobs uj, Jobs j WHERE ([Username] = @UserName) and uj.jobid = j.jobid" 
        UpdateCommand="UPDATE [UserJobs] SET [Username] = @Username, [JobID] = @JobID WHERE [id] = @original_id AND [Username] = @original_Username AND [JobID] = @original_JobID">  
        <SelectParameters> 
            <asp:ProfileParameter Name="Username" PropertyName="UserName" Type="String" /> 
        </SelectParameters> 
        <DeleteParameters> 
            <asp:Parameter Name="original_userjobid" Type="Int32" /> 
            <asp:Parameter Name="original_Username" Type="String" /> 
            <asp:Parameter Name="original_JobID" Type="Int32" /> 
        </DeleteParameters> 
        <UpdateParameters> 
            <asp:Parameter Name="Username" Type="String" /> 
            <asp:Parameter Name="JobID" Type="Int32" /> 
            <asp:Parameter Name="original_id" Type="Int32" /> 
            <asp:Parameter Name="original_Username" Type="String" /> 
            <asp:Parameter Name="original_JobID" Type="Int32" /> 
        </UpdateParameters> 
        <InsertParameters> 
            <asp:Parameter Name="Username" Type="String" /> 
            <asp:Parameter Name="JobID" Type="Int32" /> 
        </InsertParameters> 
    </asp:SqlDataSource> 
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">  
        <AjaxSettings> 
            <telerik:AjaxSetting AjaxControlID="RadGrid1">  
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="RadGrid2" /> 
                    <telerik:AjaxUpdatedControl ControlID="RadWindowManager1" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
        </AjaxSettings> 
    </telerik:RadAjaxManager> 
</asp:Content> 
 

Imports Telerik.Web.UI  
Imports System.Configuration  
Imports System.Data.SqlClient  
Imports System.Data  
Imports ProfileCommon  
 
Partial Class jobs_view  
    Inherits System.Web.UI.Page  
    Protected Sub btnApply_Click(ByVal sender As Object, ByVal e As System.EventArgs)  
 
        Dim rowCount As Integer = RadGrid2.MasterTableView.GetItems(New GridItemType() {GridItemType.Item, GridItemType.AlternatingItem}).Length  
        If rowCount >= 5 Then 
 
            RadAjaxManager1.ResponseScripts.Add("radalert('Sorry, you can only apply for five (5) jobs.  Please remove a job from your list and try agian.', 330, 210);")  
 
        Else 
 
 
            'Configure SQL Connection  
            Dim cn As SqlConnection = New SqlConnection  
            Dim cmd As SqlCommand = New SqlCommand  
            Dim connString As String = ConfigurationManager.ConnectionStrings("csSSEA").ConnectionString  
            cn.ConnectionString = connString  
            cmd.CommandText = "[usp_UserJobsInsert]" 
            cmd.CommandType = System.Data.CommandType.StoredProcedure  
            cmd.Connection = cn  
 
            'Gets the name if authenticated.  
            Dim CurrentUserName As String 
            If User.Identity.IsAuthenticated Then 
                CurrentUserName = User.Identity.Name  
            Else 
                CurrentUserName = "N/A" 
            End If 
 
            'Get Datagrid Values and declare as sql param      
            Dim btn As Button = DirectCast(sender, Button)  
            Dim dataItem As GridDataItem = DirectCast(btn.NamingContainer, GridDataItem)  
            Dim strJobID As String = dataItem("JobID").Text  
            Dim dataItemKeys As Telerik.Web.UI.GridDataItem = DirectCast(btn.NamingContainer, Telerik.Web.UI.GridDataItem)  
            Dim JobID As String = dataItemKeys("JobId").Text  
 
            cmd.Parameters.Add("@UserName", SqlDbType.VarChar).Value = CurrentUserName  
            cmd.Parameters.Add("@JobID", SqlDbType.Int).Value = JobID  
 
            Try 
                If cn.State = ConnectionState.Closed Then 
                    cn.Open()  
                End If 
                cmd.ExecuteNonQuery()  
                cn.Close()  
                cn.Dispose()  
            Catch ex As Exception  
            End Try 
            RadGrid2.Rebind()  
        End If 
    End Sub 
 
 
End Class 
 

Brett
Top achievements
Rank 2
 answered on 03 Nov 2009
2 answers
108 views
I have a RadGrid which I bind it to a table of dataset. All the filters work apart from BETWEEN which I get the following error:
"Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: Operator '>=' incompatible with operand types 'Object' and 'Double'"

This error happens for all the data tyeps. Does anybody know what is the problem? Thanks for your help.
bobTc
Top achievements
Rank 1
 answered on 03 Nov 2009
2 answers
192 views
Hi,

First off .. fantastic components.  We love em.

We recently upgraded to Ajax Q3 2008, and get this error in our log:

/WebResource.axd?d=vI7TvXstQkUlGOkffVYeiVH4oLo4xHYRyAN623_y6fyo6Bi_iDlXR_gHntoUm6ZjweHp_GF5UCroszHCDApuGZG4NC3OcFpX7hlk236bqRE1&t=633052519160000000 
Mozilla/5.0 
(Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.0 (KHTML, like 
Gecko) Chrome/3.0.195.27 Safari/532.0, System.IO.FileNotFoundException: 
Could not load file or assembly 'RadTabStrip.Net2' or one of its 
dependencies. The system cannot find the file specified. 
File name: 'RadTabStrip.Net2' 
 at System.Reflection.Assembly._nLoad(AssemblyName fileName, String 
codeBase, Evidence assemblySecurity, Assembly locationHint, 
StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean 
forIntrospection) 
 at System.Reflection.Assembly.nLoad(AssemblyName fileName, String 
codeBase, Evidence assemblySecurity, Assembly locationHint, 
StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean 
forIntrospection) 
 at System.Reflection.Assembly.InternalLoad(AssemblyName 
assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, 
Boolean forIntrospection) 
 at System.Reflection.Assembly.InternalLoad(String assemblyString, 
Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean 
forIntrospection) 
   at System.Reflection.Assembly.Load(String assemblyString) 
   at System.Web.Handlers.AssemblyResourceLoader.System.Web.IHttpHandler.ProcessRequest(HttpContext context) 
   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() 
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) 
 
WRN: Assembly binding logging is turned OFF. 
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1. 
Note: There is some performance penalty associated with assembly bind failure logging. 
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog]. 
 

From what I understand, this file belonged to the old installation?

We've installed the new Telerik.Web.UI.DLL in the GAC, and have done a plain text search of all files (i.e. *.* ) and cannot find a single reference to the previous version RadTabStrip.Net2 ... (new version all in the one Web.UI.DLL), or the actual file.

Must be searching for the wrong thing or something?    

Are you able to help get rid of this error?   The actual TabStrips are appearing fine .. seems an intermittent error...

:-)

Thanks for your help.
vtech
Top achievements
Rank 1
 answered on 03 Nov 2009
1 answer
256 views
Hi, I have telerik ver 2009.02.0817.20

I have an area chart where my x-axis labels are dates using .ToOADate().
I found the code example on your site and it was working at one point early on.
I can't figure out for the life of me now what is wrong.
No matter what I do, the x-axis date lables are all showing up as the .ToOADate():  i.e. the label is "40096" instead of "10/10/2009".
The chartDay.Date, this.ChartStartDate, & this.ChartEndDate are all valid dates and all set to exactly midnight.
Here is my code, where am I going wrong????

<RadControl:RadChart ID="RadChartControl" SeriesOrientation="Vertical" runat="server" Skin="Web20" Height="225px" Width="777px" Visible="true" ChartTitle-Visible="false"></RadControl:RadChart> 

        private void PlotChart(System.Collections.Generic.List<LoanEventResponseTimeChartItem> chartData)  
        {  
            this.RadChartControl.Appearance.TextQuality = Telerik.Charting.Styles.TextQuality.AntiAlias;  
            this.RadChartControl.ChartTitle.TextBlock.Text = "Loan Event Average Response Time by Day";  
            this.RadChartControl.Series.Clear();  
 
            if (chartData != null && chartData.Count > 0)  
            {  
                Telerik.Charting.ChartSeries chartSeries = new Telerik.Charting.ChartSeries();  
                chartSeries.Name = "Loan Event Average Response Time";  
                chartSeries.Type = Telerik.Charting.ChartSeriesType.Area;  
                chartSeries.Appearance.ShowLabels = true;  
                chartSeries.Appearance.TextAppearance.TextProperties.Color = System.Drawing.Color.Black;  
                chartSeries.Appearance.PointMark.Visible = true;// To enable tooltips  
                this.RadChartControl.Series.Add(chartSeries);  
 
                foreach (LoanEventResponseTimeChartItem chartDay in chartData)  
                {  
                    Telerik.Charting.ChartSeriesItem chartItem = new Telerik.Charting.ChartSeriesItem();  
                    chartItem.XValue = chartDay.Date.ToOADate();  
                    chartItem.YValue = chartDay.AvgResponseTimeSecs;  
                    if (chartDay.AvgResponseTimeSecs > 0)  
                    {  
                        chartItem.Label.TextBlock.Appearance.AutoTextWrap = Telerik.Charting.Styles.AutoTextWrap.True;  
                        chartItem.Label.TextBlock.Appearance.Position.Auto = true;  
                        chartItem.Label.TextBlock.Text = chartDay.AvgResponseTimeSecs.ToString();  
                        // Tooltip  
                        chartItem.PointAppearance.Visible = true;// To enable tooltips  
                        chartItem.PointAppearance.Border.Width = (float)1;  
                        chartItem.PointAppearance.Border.Color = System.Drawing.Color.White;  
                        chartItem.PointAppearance.Dimensions.AutoSize = false;  
                        chartItem.ActiveRegion.Tooltip = "Average of " + chartDay.TotalLoanEventCount.ToString("#,###,####,###") + " Loan Events";  
                    }  
                    else 
                    {  
                        chartItem.Label.TextBlock.Text = "";  
                        chartItem.Label.Visible = false;  
                        chartItem.PointAppearance.Visible = false;  
                    }  
                    this.RadChartControl.Series[0].Items.Add(chartItem);  
                }  
 
                this.RadChartControl.Series[0].Appearance.LegendDisplayMode = Telerik.Charting.ChartSeriesLegendDisplayMode.Nothing;  
 
                const double dayStep = 1;  
                //const double hourStep = 1 / 24.0;  
                //const double minuteStep = hourStep / 60;  
                //const double fiveMinuteStep = minuteStep * 5;  
                this.RadChartControl.PlotArea.XAxis.AddRange(this.ChartStartDate.ToOADate(), this.ChartEndDate.ToOADate(), dayStep);  
 
            }  
 
            this.RadChartControl.PlotArea.XAxis.LayoutMode = Telerik.Charting.Styles.ChartAxisLayoutMode.Inside;  
            this.RadChartControl.PlotArea.XAxis.AutoScale = false;  
            this.RadChartControl.PlotArea.XAxis.IsZeroBased = false;  
            this.RadChartControl.PlotArea.XAxis.Appearance.ValueFormat = Telerik.Charting.Styles.ChartValueFormat.ShortDate;  
            this.RadChartControl.PlotArea.XAxis.Appearance.CustomFormat = "MM/dd/yyyy";  
            this.RadChartControl.PlotArea.XAxis.Appearance.MajorGridLines.Visible = false;  
            this.RadChartControl.PlotArea.XAxis.Appearance.LabelAppearance.RotationAngle = (float)45;  
            this.RadChartControl.PlotArea.XAxis.Appearance.LabelAppearance.Position.AlignedPosition = Telerik.Charting.Styles.AlignedPositions.Top;  
            this.RadChartControl.PlotArea.XAxis.Appearance.TextAppearance.TextProperties.Font = new System.Drawing.Font("Ariel", 8);  
            this.RadChartControl.PlotArea.YAxis.IsZeroBased = false;  
 
            this.RadChartControl.PlotArea.EmptySeriesMessage.TextBlock.Text = "No data is available for the given criteria";  
            this.RadChartControl.PlotArea.Appearance.Dimensions.Margins.Top = Telerik.Charting.Styles.Unit.Pixel(0);  
            this.RadChartControl.PlotArea.Appearance.Dimensions.Margins.Bottom = Telerik.Charting.Styles.Unit.Pixel(68);  
            this.RadChartControl.PlotArea.Appearance.Dimensions.Margins.Left = Telerik.Charting.Styles.Unit.Pixel(55);  
            this.RadChartControl.PlotArea.Appearance.Dimensions.Margins.Right = Telerik.Charting.Styles.Unit.Pixel(0);  
 
            if (chartData == null || chartData.Count < 1)  
            {  
                this.RadChartControl.PlotArea.YAxis.AutoScale = false;  
                this.RadChartControl.PlotArea.YAxis.MaxValue = 0;  
                this.RadChartControl.PlotArea.YAxis.MinValue = 0;  
            }  
 
            this.RadChartControl.DataBind();  
        }  
 


Thanks,
Ray
Sir
Top achievements
Rank 1
 answered on 03 Nov 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?