i have rad chart with the following sql datasource
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:Cnn_StatisticsSql %>"
SelectCommand="SELECT COUNT(Title) AS Title_Count,
Title AS Account_Type,
LEFT(BankingDate, 7) AS Date
FROM Extracted.Sepordeh_EftetahShodeh
WHERE LEFT(BankingDate, 4) IN ( '1388' )
GROUP BY Title , LEFT(BankingDate, 7) ORDER BY 3 "></asp:SqlDataSource>
<telerik:RadChart ID="RadChart1" runat="server" AutoLayout="True" AutoTextWrap="True"
IntelligentLabelsEnabled="True" Width="945px" Height="285px" Skin="DeepBlue"
DataGroupColumn="Account_Type" DataSourceID="SqlDataSource1">
<Appearance>
<FillStyle FillType="ComplexGradient">
<FillSettings>
<ComplexGradient>
<telerik:GradientElement Color="26, 120, 179" />
<telerik:GradientElement Color="35, 189, 254" Position="0.5" />
<telerik:GradientElement Color="26, 120, 179" Position="1" />
</ComplexGradient>
</FillSettings>
</FillStyle>
<Border Color="0, 66, 110" Width="5" />
</Appearance>
<Series>
</Series>
<Legend Visible="False">
<Appearance Dimensions-Margins="1px, 2%, 12%, 1px" Visible="False">
<ItemTextAppearance TextProperties-Color="White">
</ItemTextAppearance>
<FillStyle GammaCorrection="False" MainColor="37, 255, 255, 255">
</FillStyle>
<Border Color="76, 255, 255, 255" />
</Appearance>
<TextBlock>
<Appearance Position-AlignedPosition="Top" TextProperties-Color="LightSkyBlue">
</Appearance>
</TextBlock>
</Legend>
<PlotArea>
<DataTable>
<Appearance Position-Auto="False" Position-X="0" Position-Y="0">
</Appearance>
</DataTable>
<EmptySeriesMessage Visible="True">
<Appearance Visible="True">
</Appearance>
</EmptySeriesMessage>
<XAxis AutoScale="False" DataLabelsColumn="Date" MaxValue="7" MinValue="1"
Step="1">
<Appearance Color="98, 183, 226" MajorTick-Color="98, 183, 226">
<MajorGridLines Color="98, 183, 226" Width="0" />
<TextAppearance TextProperties-Color="White">
</TextAppearance>
</Appearance>
<AxisLabel>
<Appearance Dimensions-Paddings="1px, 1px, 10%, 1px">
</Appearance>
<TextBlock>
<Appearance TextProperties-Color="LightSkyBlue">
</Appearance>
</TextBlock>
</AxisLabel>
</XAxis>
<YAxis>
<Appearance Color="98, 183, 226" MajorTick-Color="98, 183, 226"
MinorTick-Color="98, 183, 226">
<MajorGridLines Color="120, 209, 248" />
<MinorGridLines Color="120, 209, 248" Width="0" />
<TextAppearance TextProperties-Color="White">
</TextAppearance>
</Appearance>
<AxisLabel>
<TextBlock>
<Appearance TextProperties-Color="LightSkyBlue">
</Appearance>
</TextBlock>
</AxisLabel>
</YAxis>
<Appearance Dimensions-Margins="19%, 90px, 12%, 9%">
<FillStyle MainColor="50, 255, 255, 255" SecondColor="Transparent">
</FillStyle>
<Border Color="97, 180, 223" />
</Appearance>
</PlotArea>
<ChartTitle>
<Appearance Dimensions-Margins="4%, 10px, 14px, 6%">
<FillStyle MainColor="">
</FillStyle>
</Appearance>
<TextBlock>
<Appearance TextProperties-Color="White" TextProperties-Font="Verdana, 14pt">
</Appearance>
</TextBlock>
</ChartTitle>
</telerik:RadChart>
I have sorted the chart by date. the problem is when there is no data for a specific date the bar chart is not left empty but it is filled with the next available data that belongs to the following dates.
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="DepoView.WebForm1" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<
html
xmlns
=
"http://www.w3.org/1999/xhtml"
>
<
head
runat
=
"server"
>
<
title
></
title
>
</
head
>
<
body
>
<
form
id
=
"form1"
runat
=
"server"
>
<
div
>
<
telerik:RadScriptManager
ID
=
"RadScriptManager1"
runat
=
"server"
>
</
telerik:RadScriptManager
>
<
telerik:RadAjaxManager
runat
=
"Server"
ID
=
"RadAjaxManager1"
>
</
telerik:RadAjaxManager
>
<
telerik:RadAjaxLoadingPanel
ID
=
"RadAjaxLoadingPanel1"
runat
=
"server"
/>
<
telerik:RadScheduler
ID
=
"RadScheduler1"
runat
=
"server"
>
</
telerik:RadScheduler
>
</
div
>
</
form
>
</
body
>
</
html
>
DirectoryInfo di =
new
DirectoryInfo(MediaLibPath);
FileSystemInfo[] files = di.GetFiles();
var fileByUploadedDate = files.OrderByDescending(f => f.CreationTime);
ResourceLV.DataSource = files;
ResourceLV.DataBind();
ResourceLV.PageSize += 12;
ReloadResourceListView();
ReloadResourceListView() rebinds the ListView. Very similar to this sample:
http://demos.telerik.com/aspnet-ajax/grid/examples/programming/customizingpager/defaultcs.aspx
What I am trying to avoid is rebind every time as there could be hundreds of images in the folder being
read. Is it possible to have the PageSize increase sort of like google images search results.
What would your suggestion be? What about the PageSize from Grid, could that be emulated too?
Thanks
I'm using an older version of Telerik that doesn't have the ASP 4.0 fix and it's causing my grid control to throw an error when paging. The error is: Microsoft JScript runtime error: Object doesn't support property or method '_destroyTree'
I found a fix on these forums that works very well when used on a normal ASPX page...
<
script
type
=
"text/javascript"
>
$telerik.disposeElement = function (element) {
if (typeof (Sys.WebForms) == "undefined")
return;
var prm = Sys.WebForms.PageRequestManager.getInstance();
if (prm && prm._destroyTree)
prm._destroyTree(element);
else if (Sys.Application.disposeElement)
Sys.Application.disposeElement(element, true);
};
Telerik.Web.UI.RadComboBox.prototype._removeDropDown = function () {
var slide = this.get_dropDownElement().parentNode;
slide.parentNode.removeChild(slide);
if (this._disposeChildElements)
$telerik.disposeElement(slide);
if (!$telerik.isSafari)
slide.outerHTML = null;
this._dropDownElement = null;
};
</
script
>
My problems is that I am using user controls on much of the site. If I place this in the ASCX file, I get the same error as if I didn't have it there. If I place it in the ASPX that the user control is added to, I get this error: Microsoft JScript runtime error: Unable to get value of the property 'prototype': object is null or undefined most likely because the user control with the grid isn't loaded yet.
I can place the script inside an IF statement... if (Telerik.Web.UI.RadComboBox != null) { } and that gets rid of the prototype error, but it acts like the script isn't there because I still get the original _destroyTree error.
Can someone tell me what I need to do in order to make this work inside a user control? Here's the layout of my pages...
So what I need is to include the fix script in each user control that uses a grid so that I can page. If it were possible to include it on the master page so I don't have to put it on every user control, or if I could put it on the ASPX page that is in the first placeholder and have it work even when a new user control is loaded, then that would be great. But I don't mind including it in every user control if that is what's needed for this to work. I can also include a .JS file if that is what's needed. Keep in mind that these are inside an update panel, so the postback will be asynchronous in case that matters.
Any help would be greatly appreciated. It was decided that we wouldn't be updating Telerik, so I'm stuck with trying to make this work with just the script fix. This is really the only issue I'm having with Telerik and 4.0 with our site, so there isn't enough incentive to buy a newer version.
Just as a reminder, the script above works perfectly when used on a normal ASPX page that has the grid right on it rather than the grid being on a user control that is loaded later.
List<KI_Controls.KI_Multimedia> oPrimaryMM = oPrimaryContact.GetAllMultimedia();
BindingList<cKIWebMultiMediaContent> Populatelist = new BindingList<cKIWebMultiMediaContent>();
for (int i = 0; i < oPrimaryMM.Count; i++)
{
cKIWebMultiMediaContent otemp = new cKIWebMultiMediaContent();
otemp.MultiMediaType = oPrimaryMM[i].Multimedia_Type;
otemp.MultiMediaText = oPrimaryMM[i].Value;
Populatelist.Add(otemp);
}
gridMainMultimedia.DataSource = Populatelist;
[ServiceContract(Namespace = "")] |
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)] |
[ServiceBehavior(IncludeExceptionDetailInFaults = true)] |
public class Scheduler |
{ |
private WebServiceAppointmentController _controller; |
private WebServiceAppointmentController Controller |
{ |
get |
{ |
if (_controller == null) |
{ |
_controller = |
new WebServiceAppointmentController( |
new XmlSchedulerProvider(HttpContext.Current.Server.MapPath("~/Content/Schedule.xml"), |
false)); |
} |
return _controller; |
} |
} |
[OperationContract] |
public IEnumerable<AppointmentData> GetAppointments(SchedulerInfo schedulerInfo) |
{ |
return Controller.GetAppointments(schedulerInfo); |
} |
[OperationContract] |
public IEnumerable<AppointmentData> InsertAppointment(SchedulerInfo schedulerInfo, AppointmentData appointmentData) |
{ |
return Controller.InsertAppointment(schedulerInfo, appointmentData); |
} |
[OperationContract] |
public IEnumerable<AppointmentData> UpdateAppointment(SchedulerInfo schedulerInfo, AppointmentData appointmentData) |
{ |
return Controller.UpdateAppointment(schedulerInfo, appointmentData); |
} |
[OperationContract] |
public IEnumerable<AppointmentData> CreateRecurrenceException(SchedulerInfo schedulerInfo, |
AppointmentData recurrenceExceptionData) |
{ |
return Controller.CreateRecurrenceException(schedulerInfo, recurrenceExceptionData); |
} |
[OperationContract] |
public IEnumerable<ResourceData> GetResources(SchedulerInfo schedulerInfo) |
{ |
return Controller.GetResources(schedulerInfo); |
} |
} |
<telerik:RadScheduler ID="RadScheduler1" runat="server" Skin="Black" Visible="true" SelectedDate="2009-02-02" |
Width="1043px"> |
<Localization AdvancedAllDayEvent="All day"></Localization> |
<AdvancedForm DateFormat="dd/MM/yyyy" TimeFormat="HH:mm"></AdvancedForm> |
<WebServiceSettings Path="Service.svc" /> |
</telerik:RadScheduler> |