Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
766 views

I am trying to implement server side custom paging and using https://demos.telerik.com/aspnet-ajax/grid/examples/functionality/paging/custom-paging/defaultcs.aspx as a reference. 

Please refer to your following code

protected void RadGrid1_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
        {
            MyBusinessObjectCollection MyBusinessObjectCollection1 = new MyBusinessObjectCollection();
            int startRowIndex = (ShouldApplySortFilterOrGroup()) ?
                0 : RadGrid1.CurrentPageIndex * RadGrid1.PageSize;
  
            int maximumRows = (ShouldApplySortFilterOrGroup()) ?
                MyBusinessObjectCollection1.SelectCount() : RadGrid1.PageSize;
  
            RadGrid1.AllowCustomPaging = !ShouldApplySortFilterOrGroup();
  
            RadGrid1.DataSource = MyBusinessObjectCollection1.Select(startRowIndex, maximumRows);
        }

 

If the user uses filtering, say in the example, searching for Unit Price 9, in this case, your ShouldApplySortFilterOrGroup() would return a true. That means maximumRows will be count of entire dataset. So, MyBusinessObjectCollection1.Select(0, 100000); would be very expensive.

 

I also noticed, that when filtering, items in pages in the bottom right of the grid doesnt display the correct item count.

 

Do you have another working example of server side paging which allows filtering?

Thank you

Attila Antal
Telerik team
 answered on 30 Jul 2018
2 answers
202 views

I am in the process of adding Time Zone functionality into our existing Scheduler which did not include it.  I am having an issue when I set a TimeZoneId on the Scheduler and then use the Advanced Form with EnableTimeZonesEditing turned on.  The times of the appointment that get stored in UTC reflect the time zone of the Scheduler, not for the appointment.  For example, if I set the TimeZoneId of the Scheduler to "Pacific Standard Time" and add an appointment for July 25, from 1:00 PM to 2:00 PM with a timezone of "Eastern Standard Time", I would expect the stored time of the appointment to be 17:00 to 18:00 UTC.  However, when I view the appointment in the AppointmentInsert event, the start time is 20:00 UTC and then end time is 21:00 UTC, even though the TimeZoneId of the appointment shows as "Eastern Standard Time".

Am I supposed to do the calculation myself when adding an appointment with a different timezone than the Scheduler, or should this be done automatically?  Looking at the code for the Time Zones demo for the Scheduler, I don't see any additional code for this calculation, yet it seems to work as expected.

Peter Milchev
Telerik team
 answered on 30 Jul 2018
1 answer
97 views
how can i Combine Browse and Upload or (submit) into one step, combine them and have one button that says “Browse & Upload”
Rumen
Telerik team
 answered on 30 Jul 2018
4 answers
216 views

Hi everyone !

I have a page with my group of products and my products based on a TreeList (retrieved from database - See : "GroupProduct.png") It's a RadTreeList. Every item should have some parameters that expands once user clicks on the product or group of products based on a table "group_product_ext" in the same way shown in "Mockup.png" (It can be a GridView or whatever). Parameter should be editable with AJAX and user can apply or cancel his changes.

The problem is : How should I use the ascx control ? Which item would go for parameters that can expands ? And how to link the ascx control containing these parameters just under the groups of products and the products?

 

Some help for include a custom ascx control to my page containing a label, a checkbox and a textbox for the parameter would be awesome (it can be filled with basic data just for test)

 

A simple project of the radtreelist : Link removed by Admin because the project violates the UI for ASP.NET AJAX EULA.

A similar result to my expectation is something like this : https://www.telerik.com/clientsfiles/331457_TreeView.png?sfvrsn=9f67e1ee_0

 

 

Hamza
Top achievements
Rank 1
 answered on 30 Jul 2018
6 answers
740 views

I have been banging my head on this for a couple days. I have a simple radgrid in which I am doing batch editing. The problem I have is that when I change the page or sort a column any changes made are lost. I want the changes to automatically be saved via the BatchEditCommand server-side event before the page flip or sort occurs.  I have subscribed to the RadGrid's OnCommand client side event and the function is below. 

The javascript function is being executed properly when I page or sort and everything seems fine at each point when debugging. The server side function--BatchEditcommand--functions properly, but it is simply not being executed from this point.

I know the grid.get_batchEditingManager().saveChanges(grid.get_masterTableView()); is being executed because this function runs again immediately and the args.get_commandName() returns "BatchEdit" as it should.  

The only way I can get the BatchEditCommand server side event to fire is if i put a args.set_cancel(true); after the grid.saveChanges in the javascript, but then that cancels the paging or sorting action which I want to still happen after saving the changed data. I feel like this should work since the paging action and the saving action both cause postback anyway.

 Any ideas?

Thanks.

function UserAction(sender, args) {       
    var grid = $find("<%= grdWaterUses.ClientID %>");     if (args.get_commandName() == "Sort" || args.get_commandName() == "Page") {         if (grid.get_batchEditingManager().hasChanges(grid.get_masterTableView())) {           
          document.getElementById("<%= hiddenPostbackCommand.ClientID %>").value = "ClientSave";           grid.get_batchEditingManager().saveChanges(grid.get_masterTableView());         
        }       
    }     
}

Marcus
Top achievements
Rank 1
 answered on 27 Jul 2018
2 answers
156 views

I'm attempting to use my first RadHtmlChart (pie chart).  The SqlDataSource provides the following:

+---------------------------+--------------------+

|              stat              |    StatCount    |

+---------------------------+--------------------+
|Closed                       |         4067        | 

+---------------------------+--------------------+
|Pending Assignment |           1            |

+---------------------------+--------------------+
|QA Ready                 |       600            | 

+---------------------------+--------------------+
|In QA                        |       400             |

+---------------------------+--------------------+
|Assigned                  |      4946            |

+---------------------------+--------------------+

The RadHtmlChart:

<telerik:RadHtmlChart
     runat="server"
     ID="rhc_assnmtStats" Transitions="true"
     Skin="Default"
     DataSourceID="sdsAssnmtStats" >
          <PlotArea>
                <Series>
                    <telerik:PieSeries StartAngle="90">
                        <LabelsAppearance Position="OutsideEnd"></LabelsAppearance>
                        <SeriesItems>
                            <telerik:PieSeriesItem
                                  Name="stat"
                                  Visible="true"
                                  VisibleInLegend="true"
                                  Y="StatCount" />
                        </SeriesItems>
                    </telerik:PieSeries>
                </Series>
            </PlotArea>
            <Legend>
                <Appearance Position="Right" Visible="true"></Appearance>
            </Legend>
            <ChartTitle Text="Assignment Counts by Status">
                <Appearance Align="Center" Position="Top"></Appearance>
            </ChartTitle>
        </telerik:RadHtmlChart>

 

Error message:

Cannot create an object of type 'System.Nullable`1[[System.Decimal, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]' from its string representation 'StatCount' for the 'Y' property.

What am I doing incorrectly?

Thanks,

J

 

Jerald
Top achievements
Rank 1
 answered on 26 Jul 2018
1 answer
147 views

I create Sharepoint 2013, and deploy it in Sharepoint Farm Enterprise, all running well with Administrator user privileged, but when I access page with my webpart in it, with general user, it come with error

 

"Sorry, this list hasn't been shared with you. "

 

In debug mode (I build with VS 2017 in server environtment) it have same behaviour

 

I use RadAjaxLoadingPanel component, RadTabStrip component, RadMultiPage component, RadPageView component, RadScheduler Component, RadTooltip component

Could you assist me with this permission error? any limitation on Telerik Scheduler in my WebPart?

Peter Milchev
Telerik team
 answered on 26 Jul 2018
1 answer
128 views

I have various different data sets that I get from one of my VB.NET WebAPI's. My WebAPI is a separate project that feeds a lot of JSON to another client-side project with my Grid.

I wanted to be able to have users select which data set they want to see, such as "Due Dates" or "Books" or "Memberships" and have each different option show a different RadGrid, while only ever including one RadGrid in my ASPX. I first thought to try UserControls, each with its own grid and binding logic, but I never got them working.

Is it possible for me to just have one RadGrid defined in my ASPX and then have it be fed data and how to display that data from my WebAPI on-demand? I would somehow need it to know how to size certain columns, how to have different item templates, how to have different sorting, etc. I effectively just don't want 10 different RadGrid controls on one page, and I want them all to be fed via my WebAPI and have as little code-behind in the grid's project as possible.

Peter
Top achievements
Rank 1
 answered on 26 Jul 2018
3 answers
201 views

How set default time like "00:12:00" in RadDateTimePicker?

I have set TimePopupButton-Visible="false" and only want to select the date...

Rumen
Telerik team
 answered on 26 Jul 2018
4 answers
1.7K+ views

Hi,

could somebody help me with my issue ? I have radtextbox with TextMode="SingleLine". This textbox awaits user's scanned barcode with enter key as last char. Then I process input text in OnValueChanged client side event. So far so good. The problem has appeared when input text is longer then radtextbox width. The situation is shown in attachment.

The question is, how to style single line radtexbox so it will look like multiline (increase height and wrap text), but still acts as SingleLine, e.g. on enter key press no new row will be added, just OnValueChanged event should rise...

Thank you

Best regards

Vasssek

Vasssek
Top achievements
Rank 1
 answered on 25 Jul 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?