Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
228 views

Hi, we're not using paging on one of our RadGrids and need to reduce the html output as much as possible. We've noticed that the RadGrid puts a unique ID on every row. Is there anyway to turn this off as it creates a lot of extra code over a few thousand rows.

<tr class="rgRow" id="ctl00_ContentPlaceHolder1_rgDocuments_ctl00__0">

 

Thanks

Daniel

Vessy
Telerik team
 answered on 26 Feb 2018
4 answers
501 views
Hi,

I'm experiencing a strange issue with a RadAjaxManager and chrome  (IE10 work fine) :
I've defined my RadAjaxManager like this :

<telerik:RadAjaxManager ID="PageRadAjaxManager" runat="server" OnAjaxRequest="PageRadAjaxManager_AjaxRequest">
   <AjaxSettings>
      <telerik:AjaxSetting AjaxControlID="PageRadAjaxManager">
         <UpdatedControls>
            <telerik:AjaxUpdatedControl ControlID="GalopRadGrid"LoadingPanelID="PageRadAjaxLoadingPanel" />
         </UpdatedControls>
      </telerik:AjaxSetting>
   </AjaxSettings>
</telerik:RadAjaxManager>


And I call a javascript function to refresh my control "GalopRadGrid" :

function DoRefreshGalopGrid() {
   var arguments = 'RefreshGalopGrid';
   var ajaxManager = $find("<%=PageRadAjaxManager.ClientID%>");
   ajaxManager.ajaxRequest(arguments);
}


When calling my function, I get the following error :

Uncaught TypeError: Cannot read property 'caller' of undefined 

I use a RadAjaxManager in the same way in other pages and I don't get any problem. Does any one got a idea to solve this trouble ?

Thanks,
Corentin
Tounsi
Top achievements
Rank 1
 answered on 26 Feb 2018
1 answer
107 views

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.


Rumen
Telerik team
 answered on 26 Feb 2018
1 answer
111 views

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>


 

 

Tri Nguyen
Top achievements
Rank 1
 answered on 23 Feb 2018
3 answers
282 views
I can't seem to find any settings on how to make the shape auto-fit the content text or make the text auto size to fit the shape width.  Can you please explain how this can be done? 
Vessy
Telerik team
 answered on 23 Feb 2018
1 answer
161 views

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>
Attila Antal
Telerik team
 answered on 23 Feb 2018
15 answers
487 views
I have a simple RadCloudUpload control and when uploading a file, I get an error 500.  
  
<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" />

The control is registered as shown here:
 "message" : "RadAsyncUpload handler is registered succesfully, however, it may not be accessed directly." }

The blob contains files uploaded prior to upgrading to Q1 2014 so it was working at one point.  I am not aware of any changes to Azure or my code.  I checked the keys, account name and blob permissions. Any ideas?

Vessy
Telerik team
 answered on 23 Feb 2018
6 answers
291 views

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.

Vessy
Telerik team
 answered on 22 Feb 2018
1 answer
214 views

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;
       }
   }

 

Fábio
Top achievements
Rank 1
Iron
 answered on 22 Feb 2018
0 answers
106 views

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.

Fábio
Top achievements
Rank 1
Iron
 asked on 22 Feb 2018
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?