I'm using a RadEditor inside my own user control (*.ascx) and I have set it's onClientLoad as:
<script type=
"text/javascript"
>
function
OnClientLoad(editor, args) {
debugger;
alert(
'hi'
);
}
</script>
it is rarly fired as I refresh the page.
at times that it isn't fired I can't use $find("...") as it returns null.
how can I fix this?
thanks in advance.
Hello,
I am using version 2017.3.913.40. The code segment to save a file, using the AsyncUpload control, works only the first time. If I upload a different file, I would the get an error message, see attachment, that it tried to look for a file with extension .tmp. I put the following lines in the Web.config, based on a suggestion on a thread I found. But it doesn't seem to fix the problem. Could you help?
<add key="Telerik.AsyncUpload.TemporaryFolder" value="~/RadUploadTemp" />
<location path="RadUploadTemp">
<system.web>
<authorization>
<deny users="*" />
</authorization>
</system.web>
</location>
Hi I am new to programming. My requirement is limited. My radgrid is populated with data using stored procedure. Now when I wants to view the data I am getting out of range exception. The exception is thrown on SelectedIndexChanged event.The code is as follows:
Aspx:
Loading the radgrid
TGRCircularAIBOC.DataSource = Resources.GetCircular(
"AIBOC"
);
TGRCircularAIBOC.DataBind();
<
telerik:RadGrid
ID
=
"TGRCircularAIBOC"
runat
=
"server"
Skin
=
"Office2007"
OnSelectedIndexChanged
=
"TGRCir
protected
void
TGRCircularAIBOC_SelectedIndexChanged(
object
sender, EventArgs e)
{
GridDataItem dataitem = (GridDataItem)TGRCircularAIBOC.SelectedItems[0];
string
CircularNo = dataitem[
"CircularNo"
].ToString();
string
AuthorityCode =
"AIBOC"
;
byte
[] BinaryPDF = Resources.ViewCircular(CircularNo, AuthorityCode);
Response.Clear();
Response.ClearContent();
Response.ClearHeaders();
Response.ContentType =
"application/pdf"
;
Response.AddHeader(
"content-disposition"
,
"attachment; filename = "
+
"Circular"
);
Response.BufferOutput =
true
;
Response.BinaryWrite(BinaryPDF);
Response.Flush();
Response.End();
}
Actually I am trying to display a pdf here which
is
fetched
in
varbinary format...
cularAIBOC_SelectedIndexChanged"
>
<
ClientSettings
Selecting-AllowRowSelect
=
"true"
EnablePostBackOnRowClick
=
"true"
></
ClientSettings
>
</
telerik:RadGrid
>
<
telerik:RadCloudUpload
ID
=
"RadCloudUpload1"
OnFileUploaded
=
"RadCloudUpload1_FileUploaded"
runat
=
"server"
OnClientUploadFailed
=
"onClientUploadFailed"
ProviderType
=
"Azure"
AllowedFileExtensions
=
"jpg"
Skin
=
"Glow"
MaxFileSize
=
"0"
></
telerik:RadCloudUpload
>
<
asp:Button
ID
=
"Save"
OnClick
=
"Save_Click"
runat
=
"server"
Text
=
"Button"
/>
I see the error message below in my console on Chrome. Is this going to be a problem? (I am using version 2016.3.1027). I also see this error on your demo pages.
The SSL certificate used to load resources from https://d2i2wahzwrm1n5.cloudfront.net will be distrusted in M70. Once distrusted, users will be prevented from loading these resources. See https://g.co/chrome/symantecpkicerts for more information.
i have been trying to fix this issue from sometime. i also thread in below library.
appriciate your help on this.
I have used RadHtmlChartGroupDataSource class to group the data and display in report.I am having difficulties when series 0 has few records and another series has more records. in this case xaxis.DataLabelsField shows null here.
this is dynamic series and i use the above line of code in class file.
how can i manage to get the distinct list of all dynamic series and put as a label in chart.
hope the screenshot helps to understand the issue.
please refer the attachment.
originalDatasource.png - original format of data. you will see there is no null values associated
ChartdatainTable.png - sample data in pivot format.originally its not in pivot format and wherever you see null, those rows are not in db.
chartxaxislable_issue - some of the x-axis shows null, also if you notice march data is grouped with Jan/2016
public static class RadHtmlChartGroupDataSource
{
/// <
summary
>
/// Groups the RadHtmlChart's data source.
/// </
summary
>
/// <
param
name
=
"HtmlChart"
>The RadHtmlChart instance.</
param
>
/// <
param
name
=
"DataSource"
>The raw DataTable data source.</
param
>
/// <
param
name
=
"DataGroupColumn"
>The name of the column in the raw data source which will be the criteria for grouping the chart series items into series. There will be as many series as the number of distinct values in this column.</
param
>
/// <
param
name
=
"SeriesType"
>The type of the series. Currently the example supports Area, Bar, Column, Line, Scatter and ScatterLine series. You can, however, expand that list in the AddChartSeriesType() method.</
param
>
/// <
param
name
=
"DataFieldY"
>The name of the column in the raw data source that stores the y-values.</
param
>
/// <
param
name
=
"DataFieldX"
>The name of the column in the raw data source that stores the x-values. </
param
>
public static void GroupDataSource(RadHtmlChart HtmlChart, DataTable DataSource, string DataGroupColumn, string SeriesType, string DataFieldY, string DataFieldX)
{
//Get number of distinct rows by DataGroupColumn (e.g., Year column)
DataTable distinctValuesDT = DataSource.DefaultView.ToTable(true, DataGroupColumn);
int numDistinctValues = distinctValuesDT.Rows.Count;
//Add RadHtmlChart series
ConfigureChartSeries(HtmlChart, numDistinctValues, distinctValuesDT, SeriesType, DataFieldY, DataFieldX);
//Group data source and bind it to the chart
HtmlChart.DataSource = GetGroupedData(DataSource, DataGroupColumn, DataFieldY, numDistinctValues, distinctValuesDT);
HtmlChart.DataBind();
}
/// <
summary
>
/// Configures chart series. For example sets series names, define tooltips/labels template, etc.
/// </
summary
>
private static void ConfigureChartSeries(RadHtmlChart HtmlChart, int NumDistinctValues, DataTable DistinctValuesDT, string SeriesType, string DataFieldY, string DataFieldX)
{
HtmlChart.PlotArea.Series.Clear();
//Detect whether series are of category type
string[] categorySeriesArray = { "AreaSeries", "BarSeries", "ColumnSeries", "LineSeries" };
bool isCategorySeries = Array.IndexOf(categorySeriesArray, SeriesType) > -1 ? true : false;
//Configure x-axis DataLabelsField if series are of category type
if (isCategorySeries)
{
HtmlChart.PlotArea.XAxis.DataLabelsField = DataFieldX + "0";
}
for (int i = 0; i <
NumDistinctValues
; i++)
{
//Construct the series name, tooltips template and labels format string
string
seriesName
=
DistinctValuesDT
.Rows[i][0].ToString();
//string
seriesName
=
DistinctValuesDT
.Columns[0].ColumnName + " : " + DistinctValuesDT.Rows[i][0].ToString();
string
tooltipsTemplate
=
seriesName
+ "<br /> yearMonth: #=dataItem." + DataFieldX + i + "#<
br
/> No of Incidents: #=dataItem." + DataFieldY + i + "#";
string labelsFormatString = "{0:N0}";
// HtmlChart.PlotArea.XAxis.DataLabelsField = DataFieldX + "0";
//Add the corresponding series type to the chart
AddChartSeriesType(HtmlChart, SeriesType, DataFieldY, DataFieldX, i, seriesName, tooltipsTemplate, labelsFormatString);
}
}
/// <
summary
>
/// Adds chart series.Currently the method supports Area, Bar, Column, Line, Scatter and ScatterLine series.You can, however, expand that list here.
/// </
summary
>
private static void AddChartSeriesType(RadHtmlChart HtmlChart, string SeriesType, string DataFieldY, string DataFieldX, int Index, string SeriesName, string TooltipsTemplate, string LabelsFormatString)
{
switch (SeriesType)
{
case "AreaSeries":
AreaSeries areaSeries1 = new AreaSeries();
areaSeries1.Name = SeriesName;
areaSeries1.DataFieldY = DataFieldY + Index;
areaSeries1.TooltipsAppearance.ClientTemplate = TooltipsTemplate;
areaSeries1.LabelsAppearance.DataFormatString = LabelsFormatString;
HtmlChart.PlotArea.Series.Add(areaSeries1);
break;
case "BarSeries":
BarSeries barSeries1 = new BarSeries();
barSeries1.Name = SeriesName;
barSeries1.DataFieldY = DataFieldY + Index;
barSeries1.TooltipsAppearance.ClientTemplate = TooltipsTemplate;
barSeries1.LabelsAppearance.DataFormatString = LabelsFormatString;
HtmlChart.PlotArea.Series.Add(barSeries1);
break;
case "ColumnSeries":
ColumnSeries columnSeries1 = new ColumnSeries();
columnSeries1.Name = SeriesName;
columnSeries1.DataFieldY = DataFieldY + Index;
columnSeries1.TooltipsAppearance.ClientTemplate = TooltipsTemplate;
columnSeries1.LabelsAppearance.DataFormatString = LabelsFormatString;
columnSeries1.LabelsAppearance.Visible = false;
HtmlChart.PlotArea.Series.Add(columnSeries1);
break;
case "LineSeries":
LineSeries lineSeries1 = new LineSeries();
lineSeries1.Name = SeriesName;
lineSeries1.DataFieldY = DataFieldY + Index;
lineSeries1.TooltipsAppearance.ClientTemplate = TooltipsTemplate;
// lineSeries1.LabelsAppearance.DataFormatString = LabelsFormatString;
lineSeries1.LabelsAppearance.Visible = false;
HtmlChart.PlotArea.Series.Add(lineSeries1);
break;
case "ScatterSeries":
ScatterSeries scatterSeries1 = new ScatterSeries();
scatterSeries1.Name = SeriesName;
scatterSeries1.DataFieldY = DataFieldY + Index;
scatterSeries1.DataFieldX = DataFieldX + Index;
scatterSeries1.TooltipsAppearance.ClientTemplate = TooltipsTemplate;
scatterSeries1.LabelsAppearance.DataFormatString = LabelsFormatString;
HtmlChart.PlotArea.Series.Add(scatterSeries1);
break;
case "ScatterLineSeries":
ScatterLineSeries scatterLineSeries1 = new ScatterLineSeries();
scatterLineSeries1.Name = SeriesName;
scatterLineSeries1.DataFieldY = DataFieldY + Index;
scatterLineSeries1.DataFieldX = DataFieldX + Index;
scatterLineSeries1.TooltipsAppearance.ClientTemplate = TooltipsTemplate;
scatterLineSeries1.LabelsAppearance.DataFormatString = LabelsFormatString;
HtmlChart.PlotArea.Series.Add(scatterLineSeries1);
break;
default:
break;
}
}
/// <
summary
>
/// The actual data source grouping manipulations.
/// </
summary
>
private static DataTable GetGroupedData(DataTable RawDataTable, string DataGroupColumn, string DataFieldY, int NumDistinctValues, DataTable DistinctValuesDT)
{
DataTable commonDT = new DataTable();
//Split the raw DataTable by numDistinctValues to an array of temporary DataTables
DataTable[] tempDTarray = new DataTable[NumDistinctValues];
tempDTarray = SplitDataTable(RawDataTable, DataGroupColumn, NumDistinctValues, DistinctValuesDT);
////Add rows to the common DataTable
//for (int i = 0; i <
tempDTarray
[0].Rows.Count; i++)
//{
// commonDT.Rows.Add();
//}
//check get field with the greater number of rows
int
highestRowTablePos
=
HighestRowTablePos
(tempDTarray);
//Add rows to the common DataTable
for (int
i
=
0
; i < tempDTarray[highestRowTablePos].Rows.Count; i++)
{
commonDT.Rows.Add();
}
//Add columns to the common DataTable and fill values from each temp DataTable
for (int
i
=
0
; i < NumDistinctValues; i++)
{
//Loop through the columns of each temp DataTable
for (int
g
=
0
; g < tempDTarray[i].Columns.Count; g++)
{
string
columnName
=
tempDTarray
[i].Columns[g].ColumnName;
//Add columns from the temp DataTables to the common DataTable
commonDT.Columns.Add(columnName, tempDTarray[i].Columns[g].DataType);
//Loop through the rows of the each temp DataTable
for (int
f
=
0
; f < tempDTarray[i].Rows.Count; f++)
{
//Fill values from each temp DataTable to the common DataTable
commonDT.Rows[f][columnName] = tempDTarray[i].Rows[f][columnName];
}
}
}
return commonDT;
}
/// <summary>
/// A helper method for the data source grouping manipulations.
/// </
summary
>
private static DataTable[] SplitDataTable(DataTable RawDataTable, string DataGroupColumn, int NumDistinctValues, DataTable DistinctValuesDT)
{
DataTable[] tempDTarray = new DataTable[NumDistinctValues];
for (int i = 0; i <
NumDistinctValues
; i++)
{
//Split the raw DataTable to multiple temporary DataTables by distinct DataGroupColumn values
tempDTarray[i] = RawDataTable.Select(DataGroupColumn + "='" + DistinctValuesDT.Rows[i][0].ToString() + "'").CopyToDataTable();
for (int
g
=
0
; g < tempDTarray[i].Columns.Count; g++)
{
//Add g-th index to column names for each i-th DataTable from the temporary DataTable array
string
columnName
=
tempDTarray
[i].Columns[g].ColumnName + i;
tempDTarray[i].Columns[g]
.ColumnName
=
columnName
;
}
}
return tempDTarray;
}
private static int HighestRowTablePos(DataTable[] dtList)
{
int
tableNum
=
0
;
int
numOfRows
=
0
;
for (int
i
=
0
; i < dtList.Length; i++)
{
int
count
=
dtList
[i].Rows.Count;
if (count > numOfRows)
{
numOfRows = count;
tableNum = i;
}
}
return tableNum;
}
}
Hi,
I would like an example with data from a datatable, with a chart in columns with two two.
Thank you very much in advance,
Translated automatically.
I am trying to update a RadLabel control that is inside of a RadlistView which is inside of a RadAjaxPanel. I have a user control on my aspx page that calls a public event handler when a modal on the user control closes. I can access the RadLabel, but it doesn't update.
Here is my HTML:
<telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" LoadingPanelID="RadAjaxLoadingPanel1" BackColor="White">
<div class="form-group">
<asp:RadioButtonList ID="radioChoice" runat="server" RepeatDirection="Horizontal" AutoPostBack="true" CssClass="inline-rb" OnSelectedIndexChanged="radioChoice_SelectedIndexChanged">
<asp:ListItem Value="Multiple" Text="Multiple Record Report" Selected="True" />
<asp:ListItem Value="Single" Text="Single Record Report" />
</asp:RadioButtonList>
</div>
<asp:HiddenField runat="server" ID="panelCollapse" ClientIDMode="Static" />
<asp:HiddenField runat="server" ID="SelectedItem" />
<hr />
<telerik:RadListView runat="server" ID="radlistview1" OnItemDataBound="radlistview1_ItemDataBound" EnableViewState="false">
<ItemTemplate>
<div class="panel panel-default">
<div class="panel-heading" style="border:none; padding:0px !important">
<h4 class="panel-title">
<a data-toggle="collapse" href="#pnl<%#Eval("ModuleDataKey") %>" rel="popover" data-placement="top" data-content="Click to expand/collapse report list" data-trigger="hover"><i class="s7-plus"></i></a> <%#Eval("ModuleDataKey") %>
</h4>
</div>
<div id='pnl<%#Eval("ModuleDataKey") %>' class="panel-collapse collapse">
<div class="panel-body" style="padding:0px !important 10px 0px 10px">
<div runat="server" id="divNoResults" style="background-color:#ED4B4B;color:white" visible="false"><asp:PlaceHolder ID="noResults" runat="server"></asp:PlaceHolder> </div>
<div class="panel panel-alt3 panel-transparent" style="padding: 0px !important">
<div class="panel-heading panel-heading-cg" style="overflow:visible">
<div class="input-group">
<span runat="server" class="media" id="spFilter" visible='<%# DataBinder.Eval(Container.DataItem, "ModuleDataKey").ToString().ToLower() == "activity" ? false : true %>'>
<button type="button" data-toggle="dropdown" title="Filter List" class="btn btn-alt3" id="btnFilter" runat="server"><i class="icon icon-left s7-filter"></i><span class="caret"></button>
<ul role="menu" class="dropdown-menu">
<li runat="server" id="btnCustomFilter"><asp:LinkButton runat="server" ID="lnkCustom" OnClick="customFilterLink_ServerClick" OnClientClick="javascript:OpenFilterModal();" >Custom</asp:LinkButton></li>
<li class="divider"></li>
<asp:PlaceHolder runat="server" ID="hldFilters"></asp:PlaceHolder>
</ul>
</span>
<span id="ddlLists" runat="server" visible="false" style="display:inline" >
<span runat="server" id="spJobDropDown" visible='<%# DataBinder.Eval(Container.DataItem, "ModuleDataKey").ToString().ToLower() == "job" ? true : false %>'>
<telerik:RadComboBox DropDownAutoWidth="Enabled" RenderMode="Lightweight" ID="qfTicket_cmbJob" EmptyMessage="Type to Select..." runat="server" Width="500px" EnableLoadOnDemand="true" ShowMoreResultsBox="true" EnableVirtualScrolling="true" OnSelectedIndexChanged="qfTicket_cmbJob_SelectedIndexChanged" >
<WebServiceSettings Method="GetJobs" Path="~/Portal/Ajax/COGS.asmx" />
</telerik:RadComboBox>
</span>
<span runat="server" id="spTicketDropdown" visible='<%# DataBinder.Eval(Container.DataItem, "ModuleDataKey").ToString().ToLower() == "ticket" ? true : false %>'>
<telerik:RadComboBox DropDownAutoWidth="Enabled" RenderMode="Lightweight" ID="cmbTicket" EmptyMessage="Type to Select..." runat="server" Width="333px" ClientIDMode="Static" EnableLoadOnDemand="true" ShowMoreResultsBox="true" EnableVirtualScrolling="true" OnSelectedIndexChanged="cmbTicket_SelectedIndexChanged" AutoPostBack="true" >
<WebServiceSettings Method="GetTickets" Path="~/Portal/Ajax/COGS.asmx" />
</telerik:RadComboBox>
</span>
</span>
<span runat="server" id="spActivity" visible='<%# DataBinder.Eval(Container.DataItem, "ModuleDataKey").ToString().ToLower() == "activity" ? true : false %>'>
Asset  
<asp:DropDownList runat="server" ID="ddlAssets" ForeColor="Black" Font-Size="Small"></asp:DropDownList>
Date <i class="s7-date" style="font-size:x-large;display:inline"></i><asp:TextBox runat="server" ID="txtReportDate" ClientIDMode="Static" Font-Size="Small" ForeColor="Black" CssClass="datepicker" placeholder="m/d/yyyy" ></asp:TextBox>
</span>
</div>
<div runat="server" id="SelectedFilter" style="background-color:#fff2d7; color:black;padding-left:10px" ><telerik:RadLabel runat="server" ID="filterName" Font-Size="Small"></telerik:RadLabel></div>
</div>
<div class="panel-body" style="padding-top:10px">
<br />
<asp:HiddenField ID="hfModule" Value='<%#Eval("ModuleDataKey") %>' runat="server" />
<asp:PlaceHolder ID="phRow" runat="server"></asp:PlaceHolder>
</div>
</div>
</div>
</div>
</div>
</ItemTemplate>
</telerik:RadListView>
</telerik:RadAjaxPanel>
Here is my EventHandler:
private void JobFilterControl_CustomJobFilterSaved(object sender, EventArgs e)
{
foreach (RadListViewItem item in radlistview1.Items)
{
string module = ((HiddenField)item.FindControl("hfModule")).Value;
RadLabel filterName = item.FindControl("filterName") as RadLabel;
switch (module)
{
case "JOB":
filterName.Text = "Selected Filter: " + Session["SavedJobFilterName"].ToString();
break;
case "TICKET":
filterName.Text = "Selected Filter: All";
break;
}
}
}
All of the code works as expected except that the Label Text does not update. Is there anyting I can do to get this to work? Any assistance is greatly appreciated.