Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
70 views

Hi,  

i am using your Radgrid_Rowdrop Event to sort some rows in the RadGrid, but it seems like the e.DestDataItem variable is often null under Chrome.                   This Behaviour doesnt appear to happen in Firefox or Internet Explorer. My Browser isnt zoomed in (Standard 100% settings), does anybody know why the Rowdrop Event behaves differently under Chrome?   

 

Thank you in Advance for your Help

 

Additional Information:

Chrome Version 56.0.2924.87 (64-bit)

Ali
Top achievements
Rank 1
 asked on 21 Mar 2017
1 answer
110 views

I have what seems like a simple problem, but I can't seem to come up with the best way to code my grid to the datasource that I require.

 

My application is very simple.  It has a radtextbox prompt for the Customer #.   It has a radbutton for "Find Sales Orders".

In my RadGrid I want to display a list of sales order information for the customer # that the user enters.  When the user clicks on the

radbutton "Find Sales Orders", I want to execute my SQL code and populate the RadGrid with the resulting data table.   My RadGrid will also have a

telerik:GridCleintSelectColumn, because I want the user to be able to select sales orders from the grid, and when they are finished selecting sales orders, I will

have another radbutton to store those selected sales orders into another SQL table (I've already found a telerik radgrid example that shows me how to code the

events for rowselect and rowdeselect and it persists when paging back and forward.  The example also showed me how to loop through the grid and get a list of

selected key values).  This example uses a hard coded sqldatasource with a built in SQL select statement.   The data source that I

need must be driven from the customer # that the user enters and executed when the user clicks the "Find Sales Orders" button.     Does Telerik have any

examples of what I'm describing?    Everything I've found for examples so far has a built in select statement that isn't geared from other controls that a

user would typically enter on to the page.  

Marin Bratanov
Telerik team
 answered on 21 Mar 2017
1 answer
95 views

I have a Scheduler populated with a set of data. It is set to display in day view and defaults to today.

On a button click I wish to jump to a particular appointment whilst remaining in day view and highlight it if possible.

So far I have managed to get an object of the appointment, however cannot find any functions on the scheduler itself to 'Go to' and appointment by either its object or its ID.

//Get correct appointment object.
Appointment appointment = RadScheduler1.Appointments.FindByID(1);
 
//What I want is to go to that appointment on the screen.
RadScheduler1.GoToAppointment(appointment);
Peter Milchev
Telerik team
 answered on 21 Mar 2017
0 answers
92 views

I want to remove the files based on the extensions in entire application.by getting the input type 'file' .for the first time means,if we select either one or multiple files it is fine.after we add some more/ one file to the uploader. then it was not working. means that was not firing for next selection .i tried with basic file selection of html that was working fine.You can see the code that i'm trying .

 

=============================================

<script src="Scripts/jquery-1.9.1.js" type="text/javascript"></script>
    <telerik:RadScriptBlock ID="radSript1" runat="server">
        <script type="text/javascript">
            $(window).load(function () {
                $("input[type=file]").change(function () {
                    var names = [];
                    debugger;
                    for (var i = 0; i < $(this).get(0).files.length; ++i) {
                        names.push($(this).get(0).files[i].name);
                    }
                    $("input[type=text]").val(names);
                });
            });  
               
        </script>
    </telerik:RadScriptBlock>

===============================

$('input[type="file"]').change(function () {
                    var indexes = [];
                    var controlid = this.id;
                    var rename = controlid.replace('file0', '');
                    var upload1 = $find(rename);
                    var count = upload1._selectedFilesCount
                    for (var a = 0; a < count - 1; a++) {
                        var fileName = e.target.files[a].name;
                        var fileextension = '.' + fileName.split('.').pop().toUpperCase();
                        if (fileextension == ".EXE" || fileextension == ".BAT" || fileextension == ".JS") {
                            alert("Please Select Valid Formats...");
                            upload1.deleteFileInputAt(a);
                            var cnd = $find(rename);
                            count--;
                            a = -1;
                        }
                    }
                });

==============================================

<telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager>
    <div>
        <telerik:RadAsyncUpload RenderMode="Lightweight" runat="server" MultipleFileSelection="Automatic"
            ID="rduploadfile" />
        <telerik:RadAsyncUpload RenderMode="Lightweight" runat="server" MultipleFileSelection="Automatic"
            ID="RadAsyncUpload1" />
        
    <input type="file" id="fl1" name="file1" multiple="multiple" />
    <input type="file" id="fl2" name="file" multiple="multiple" />
    <input name="file" type="text" />
    </div>

======================================

SREERAM
Top achievements
Rank 1
 asked on 21 Mar 2017
1 answer
91 views

looking at the client-side filter commandArgument, it has this format: ColumnName|?FilterValue|?FilterFunction

Is the '?' character used so you have two characters as delimiters ('|?').

Or is it used for something else. If the latter, I can strip the first character from the value to use it. But if the former I assume I can just split the commandArgument on '|?'.

If I do the split, I just want make sure you won't be changing this delimiter.

Eyup
Telerik team
 answered on 21 Mar 2017
1 answer
164 views

Hello,
I have pivot grid control and I'm trying to display several charts according to this pivot.
when the data is expanded the charts present correct data but when I start collapsing the columns the data in the charts starts freaking out and some of the data is missing and the other one is incorrect or displaying duplicated values.
I have tried the solutions proposed in the following thread: but seems like it still doesn't work. 

any idea?

Please see the code below. 

 

001.functionloadPivotWWvsBoard() {
002.    $("#divPivot").html("");
003.    $("#divConfigurator").html("");
004.    var collapsed = {
005.        columns: [],
006.        rows: []
007.    };
008.    /*define the data source*/var DataSource;
009. 
010.    jQuery.ajaxSetup({
011.        async: false
012.    });
013. 
014.    $.get("/Report/GetDeliveredReportJSON", { fromWW: $("#FromWW").val(), toWW: $("#ToWW").val() }).done(function (data) {
015.        DataSource = data;
016.    })
017. 
018.    var dataSource = new kendo.data.PivotDataSource({
019.        data: DataSource
020.        , type: "xmla"
021.        , schema: {
022.            model: {
023.                fields: {
024.                    "Project": {
025.                        type: "string"
026.                    }
027.                    , Board: {
028.                        type: "string"
029.                    }
030.                    , WW: {
031.                        type: "string"
032.                    }
033.                    , "ApproveDate": {
034.                        field: "ApproveDate"
035.                        , type: "date"
036.                    }
037.                    , ReceiverName: {
038.                        field: "ReceiverName"
039.                    }
040.                    , RequestorName: {
041.                        field: "RequestorName"
042.                    }
043.                    , ApprovingManager: {
044.                        field: "ApprovingManager"
045.                    }
046.                    , PartTrans: {
047.                        field: "PartTrans"
048.                    }
049.                    , SerialNumber: {
050.                        field: "SerialNumber"
051.                    }
052.                    , OpeningDate: {
053.                        field: "OpeningDate"
054.                    }
055.                    , DeliveredDate: {
056.                        field: "DeliveredDate"
057.                    }
058.                    , ApprovalType: {
059.                        field: "ApprovalType"
060.                    }
061.                    , DateDifference: {
062.                        field: "DateDifference"
063.                    }
064.                    , ReportType: {
065.                        field: "ReportType"
066.                    }
067.                    , BusinessLine: {
068.                        field: "BusinessLine"
069.                    }
070.                    , Branch: {
071.                        field: "Branch"
072.                    }
073.                    , ManagerType: {
074.                        field: "ManagerType"
075.                    }
076.                    , CostCenter: {
077.                        field: "CostCenter"
078.                    }
079.                    , SapOrder: {
080.                        field: "SapOrder"
081.                    }
082.                ,
083.                }
084.            }
085.            , cube: {
086.                dimensions: {
087.                    "Project": {
088.                        caption: "Project"
089.                    }
090.                    , Board: {
091.                        caption: "Board"
092.                    }
093.                    , WW: {
094.                        caption: "WW"
095.                    }
096.                    , "ApproveDate": {
097.                        caption: "Approve Date"
098.                    }
099.                }
100.                , measures: {
101.                    "Delivered Quantity": {
102.                        field: "SerialNumber"
103.                        , aggregate: "count"
104.                    }
105.                }
106.            }
107.        }
108.        , columns: [{
109.            name: "Project", expand: true
110.        },
111.        {
112.            name: "Board", expand: true
113.        }]
114.        , rows: [{
115.            name: "WW"
116.        }]
117.        , measures: ["Delivered Quantity"]
118.    });
119. 
120.    dataSource.filter(loadFiltersForGrid(false))
121.    dataSource.fetch(function () {
122.        console.log("data source created successfuly", dataSource);
123.    });
124. 
125.    /*define the pivot*/var pivotgrid = $("#divPivot")
126.        .kendoPivotGrid({
127.            filterable: true,
128.            sortable: true,
129.            collapseMember: function (e) {
130.                var axis = collapsed[e.axis];
131.                var path = e.path[0];
132. 
133.                if (axis.indexOf(path) === -1) {
134.                    axis.push(path);
135.                }
136.            },
137.            expandMember: function (e) {
138.                var axis = collapsed[e.axis];
139.                var index = axis.indexOf(e.path[0]);
140. 
141.                if (index !== -1) {
142.                    axis.splice(index, 1);
143.                }
144.            },
145.            dataSource: dataSource
146.            , dataBound: function () {
147.                this.dataSource.expandColumn(["Project", "Board"]);
148.                this.dataSource.expandColumn(["Project"]);
149.                this.dataSource.expandRow(["WW"]);
150.                // this.dataSource.filter(filters);
151.                initChart(convertData(this.dataSource, collapsed, "Project"));
152.                initChart2(convertData(this.dataSource, collapsed, "Board"));
153.            }
154.        })
155.        .data("kendoPivotGrid");
156. 
157. 
158.    /*define the chart*/functioninitChart(data) {
159. 
160.        $("#divChart1").kendoChart({
161.            dataSource: {
162.                data: data,
163.                group: "column"
164.            },
165.            title: {
166.                text: "Delivered quantity by project"
167.            },
168.            legend: {
169.                position: "top"
170.            },
171.            seriesDefaults: {
172.                type: "bar"
173.            },
174.            series: [{
175.                type: "column",
176.                field: "measure",
177.            }],
178.            categoryAxis: {
179.                field: "row"
180.                , padding: {
181.                    top: 135
182.                }
183.                 , majorGridLines: {
184.                     visible: true
185.                 }
186.            },
187.            valueAxis: {
188.               majorGridLines: {
189.                    visible: true
190.                }
191.            },
192.            tooltip: {
193.                visible: true,
194.                format: "{0}",
195.                template: "#= series.name #: #= value #"
196.            },
197.            dataBound: function (e) {
198.                // e.sender.options.categoryAxis.categories.sort()
199.            }
200.        });
201.    }
202.    functioninitChart2(data) {
203. 
204.        $("#divChart2").kendoChart({
205.            dataSource: {
206.                data: data,
207.                group: "column"
208.            },
209.            title: {
210.                text: "Delivered quantity by board"
211.            },
212.            legend: {
213.                position: "top"
214.            },
215.            seriesDefaults: {
216.                type: "bar"
217.            },
218.            series: [{
219.                type: "column",
220.                field: "measure",
221.            }],
222.            categoryAxis: {
223.                field: "row"
224.                , padding: {
225.                    top: 135
226.                }
227.                 , majorGridLines: {
228.                     visible: true
229.                 }
230.            },
231.            valueAxis: {
232.                 majorGridLines: {
233.                    visible: true
234.                }
235.            },
236.            tooltip: {
237.                visible: true,
238.                format: "{0}",
239.                template: "#= series.name #: #= value #"
240.            },
241.            dataBound: function (e) {
242.                // e.sender.options.categoryAxis.categories.sort()
243.            }
244.        });
245.    }
246.}
247. 
248.functionflattenTree(tuples) {
249.    tuples = tuples.slice();
250.    var result = [];
251.    var tuple = tuples.shift();
252.    var idx, length, spliceIndex, children, member;
253. 
254.    while (tuple) {
255.        //required for multiple measuresif (tuple.dataIndex !== undefined) {
256.            result.push(tuple);
257.        }
258. 
259.        spliceIndex = 0;
260.        for (idx = 0, length = tuple.members.length; idx < length; idx++) {
261.            member = tuple.members[idx];
262.            children = member.children;
263.            if (member.measure) {
264.                [].splice.apply(tuples, [0, 0].concat(children));
265.            } else {
266.                [].splice.apply(tuples, [spliceIndex, 0].concat(children));
267.            }
268.            spliceIndex += children.length;
269.        }
270. 
271.        tuple = tuples.shift();
272.    }
273. 
274.    return result;
275.}
276. 
277.functionisCollapsed(tuple, collapsed) {
278.    var name = tuple.members[0].parentName;
279. 
280.    for (var idx = 0, length = collapsed.length; idx < length; idx++) {
281.        if (collapsed[idx] === name) {
282.            console.log(name);
283.            returntrue;
284.        }
285.    }
286. 
287.    returnfalse;
288.}
289. 
290.functionconvertData(dataSource, collapsed, type) {
291.    var columnTuples = flattenTree(dataSource.axes().columns.tuples || [], collapsed.columns);
292.    var rowTuples = flattenTree(dataSource.axes().rows.tuples || [], collapsed.rows);
293.    var data = dataSource.data();
294.    var rowTuple, columnTuple;
295. 
296.    var idx = 0;
297.    var result = [];
298.    var columnsLength = columnTuples.length;
299. 
300.    for (var i = 0; i < rowTuples.length; i++) {
301.        rowTuple = rowTuples[i];
302. 
303.        if (!isCollapsed(rowTuple, collapsed.rows)) {
304.            for (var j = 0; j < columnsLength; j++) {
305.                columnTuple = columnTuples[j];
306. 
307.                if (!isCollapsed(columnTuple, collapsed.columns)) {
308.                    if (idx > columnsLength && idx % columnsLength !== 0) {
309. 
310.                        var memebrtype;
311.                        if (type == "Board") {
312.                            memebrtype = 1
313.                        } else {
314.                            memebrtype = 0
315.                        }
316.                        var columninfo =  GetChildren(columnTuple.members[memebrtype], type);
317.                        if (columninfo) {
318.                            result.push({
319.                                measure: Number(data[idx].value),
320.                                column: columninfo,
321.                                row: rowTuple.members[0].caption
322.                            });
323.                        }
324.                       
325.                    }
326.                }
327.                idx += 1;
328.            }
329.        }
330.    }
331. 
332.    return result;
333.}
334. 
335. 
336.functionGetChildren(parent, type) {
337.    var result = undefined;
338. 
339.    if (parent.hasChildren || result != undefined) {
340.        for (var i = 0; i < parent.children.length; i++) {
341.            result = GetChildren(parent.children[i], type);
342.        }
343.    } else {
344.        result = parent.caption;
345.    }
346.    if (result == type) {
347.        result = undefined;
348.    }
349. 
350. 
351.    return result;
352.}

.

 

 
Ziv
Top achievements
Rank 1
 answered on 21 Mar 2017
6 answers
559 views
Telerik Team,

I need to set the ForeColor of all the "Telerik RadControls" in my given form on a specific action. How do I loop through to find out all the Tlerik Controls Exists in my form. Let me know

Thanks

Jai
Rumen
Telerik team
 answered on 21 Mar 2017
1 answer
175 views

Hi,

 

I am currently doing advanced calculations in Pivot grid using calculation expressions.
I would like to use Square root function inside (sqrt). What are available function ? 

aggregateField.CalculationExpression = "(({0}/{1})*({1}-{2})";

 

i would like something like this to be evaluated : 

aggregateField.CalculationExpression = "(({0}/{1})*(Sqrt({1}-{2}))";

 

in my case i would like to avoid using OnItemNeedCalculation event, because all formulas are downloaded from a database dynamically, and it creates dynamically aggregates in pivot grid.

 

Regards,

Maxime LEMARE

Eyup
Telerik team
 answered on 21 Mar 2017
5 answers
520 views
On an export to Excel, I can't seem to find a way to suppress the header row.  I'm creating the grid programmatically.  Here's the relevant code:

RadGrid

exportGrid = new RadGrid();

 

exportGrid.NeedDataSource +=

new GridNeedDataSourceEventHandler( exportGrid_NeedDataSource );

 

exportGrid.Skin =

"Default";
exportGrid.Width =
Unit.Percentage( 100 );
exportGrid.ShowHeader =
false;
exportGrid.AutoGenerateColumns =
true;
exportGrid.ExportSettings.ExportOnlyData =
true;
exportGrid.ExportSettings.Excel.Format =
GridExcelExportFormat.ExcelML;
exportGrid.DataMember =
"ExportData";
PlaceHolder phExport = new PlaceHolder();
currentPage.Controls.Add( phExport );
exportGrid.DataSource = _exportData;
phExport.Controls.Add( exportGrid );
exportGrid.Rebind();

 

 

foreach ( GridHeaderItem headerItem in exportGrid.MasterTableView.GetItems( GridItemType.Header ) )
headerItem.Visible =
false;

 

exportGrid.MasterTableView.ExportToExcel();

I also tried a couple of different variations on this approach, without any luck:

 

protected

void exportGrid_ExcelMLExportRowCreated( object source, Telerik.Web.UI.GridExcelBuilder.GridExportExcelMLRowCreatedArgs e ){
if ( e.RowType == Telerik.Web.UI.GridExcelBuilder.GridExportExcelMLRowType.HeaderRow ){
foreach ( Telerik.Web.UI.GridExcelBuilder.CellElement cell in e.Row.Cells ){
if( cell.Data != null )
cell.Data.DataItem =
null;
}
}
}

Any help is appreciated.

 

Nasir
Top achievements
Rank 1
 answered on 21 Mar 2017
0 answers
49 views
I have a project with many, many grids. I want to add a clear all filters button to every grid in my project. I have a clear all method that works beautifully, but I can't seem to add a button with a successful event handler to all my grids without manually going through and adding the button. I would like it somewhere at the top of my grid. Any help would be appreciated. 
Jessica
Top achievements
Rank 1
 asked on 20 Mar 2017
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?