Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
69 views

So I'm using the RadScheduler control with WebApi and my appointment records come back from the server as iso 8601 strings like "2016-03-01T04:00:00Z". All dates that come from the server are in UTC format, and the RadScheduler control is set to render appointments using UTC time. So essentially if an appointment comes from the server as 8am UTC, then it should render at 8am on the scheduler, regardless of what timezone the client computer is set to.

Now there's an edge case that breaks the rendering of appointments. During the first X hours of the first day of a month, if an appointment starts within the first X hours, the parsing for the start time string fails and the appointment does not show up on the scheduler. The value X is the absolute value of the timezone offset for the client machine. So for instance if the machine is set to -5 hours offset, then appointments within the first 5 hours will not show up.

I've narrowed down the problem to the fact that the Telerik.Web.UI.Scheduler.Rendering.parseISO8601 function does not return a valid Date object in this scenario. You should be able to replicate this easily by executing Telerik.Web.UI.Scheduler.Rendering.parseISO8601("2016-03-01T04:00:00Z") assuming you have the Telerik.Web.UI.Scheduler.Rendering namespace / class loaded. It will return an invalid date if the client timezone offset is -5 or greater (-6, -7, etc..).

Is this a known issue and is there a fix?

Plamen
Telerik team
 answered on 12 May 2016
1 answer
143 views

Hello experts... I need help please.

I have a RadGrid with multiple row edit... I want to open all checked Items in a popup when I click the edit button.

I thought I do it with <NestedViewTemplate> or with another RadGrid2. I have no idea about how do I solve this problem. Can you please give me feedback.

Here is my short code:

<telerik:RadGrid ID="myGrid" Skin="Silk" AutoGenerateColumns="false" AllowAutomaticUpdates="true"
OnNeedDataSource="myGrid_NeedDataSource" AllowPaging="True" PageSize="10" AllowMultiRowSelection="True" AllowMultiRowEdit="True"
ShowStatusBar="true" AllowFilteringByColumn="true" runat="server">    
        <MasterTableView DataKeyNames="Title" Name="myGridView" EnableHeaderContextMenu="true" ItemStyle-Wrap="False" CommandItemDisplay="Top" Width="100%" >
            <Columns>
            <telerik:GridTemplateColumn UniqueName="CheckBoxTemplateColumn" AllowFiltering="false" HeaderStyle-Width="2%" >
                      <ItemTemplate>
                        <asp:CheckBox ID="CheckBox1" runat="server" OnCheckedChanged="ToggleRowSelection"
                          AutoPostBack="True" />
                      </ItemTemplate>
                      <HeaderTemplate>
                        <asp:CheckBox ID="headerChkbox" runat="server" OnCheckedChanged="ToggleSelectedState"
                          AutoPostBack="True" />
                      </HeaderTemplate>
             </telerik:GridTemplateColumn>   
                
            <telerik:GridBoundColumn UniqueName="Title" DataField="Title" HeaderText="Title" HeaderStyle-Width="15%" FilterControlAltText="Title" ReadOnly="true">
                <FilterTemplate>
                    <telerik:RadComboBox ID="RadComboBox1" runat="server" Height="200px" Width="100%"                      
                     AllowCustomText="true" AutoPostBack="true" EnableLoadOnDemand="true" MarkFirstMatch="true"
                     DataValueField="Id" DataTextField="Title" OnSelectedIndexChanged="RadComboBox1_IndexChanged"
                     CheckBoxes="true" AppendDataBoundItems="true" EmptyMessage="Select..." CheckedItemsTexts="DisplayAllInInput"
                      SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("Title").CurrentFilterValue %>' >                      
                    </telerik:RadComboBox>                         
                </FilterTemplate>
            </telerik:GridBoundColumn>

            <telerik:GridBoundColumn DataField="Price" HeaderText="Price" HeaderStyle-Width="65%" AllowFiltering="false">
            </telerik:GridBoundColumn>

            <telerik:GridBoundColumn DataField="Order" HeaderText="Order" AllowFiltering="false">
            </telerik:GridBoundColumn>
        </Columns>             
            <NestedViewTemplate>
                <telerik:RadGrid RenderMode="Lightweight" runat="server" ID="editGrid" ShowFooter="true"
                                AllowSorting="false" EnableLinqExpressions="false">
                                <MasterTableView ShowHeader="true" AutoGenerateColumns="False" AllowPaging="true"
                                    DataKeyNames="Title" PageSize="7" HierarchyLoadMode="ServerOnDemand">
                                    <DetailTables>
                                        <telerik:GridTableView Name="editView" AutoGenerateColumns="false" DataKeyNames="Title" DataSourceID="Title"
                                            Width="100%" CommandItemSettings-ShowRefreshButton="false" >                                            
                                            <Columns>
                                                <telerik:GridBoundColumn SortExpression="Price" HeaderText="Price" HeaderButtonType="TextButton"
                                                    DataField="Price" UniqueName="Price">
                                                </telerik:GridBoundColumn>                                                
                                                <telerik:GridBoundColumn SortExpression="Order" HeaderText="Order" HeaderButtonType="TextButton"
                                                    DataField="Order" UniqueName="Order">
                                                </telerik:GridBoundColumn>                                             
                                            </Columns>
                                           <%-- <SortExpressions>
                                                <telerik:GridSortExpression FieldName="Title" SortOrder="Descending"></telerik:GridSortExpression>
                                            </SortExpressions>--%>
                                        </telerik:GridTableView>
                                    </DetailTables>                                    
                                </MasterTableView>
                                <ClientSettings AllowDragToGroup="true">
                                    <Scrolling AllowScroll="true" ScrollHeight="" />
                                </ClientSettings>
                                <PagerStyle PageButtonCount="3" Mode="NextPrevAndNumeric" ShowPagerText="false" />
                            </telerik:RadGrid>
             </NestedViewTemplate>
        <CommandItemTemplate>
           <asp:LinkButton Style="vertical-align: bottom" ID="btnEditSelected" runat="server" OnClick="EditSelected_Click" CommandName="EditSelected" Visible='<%# myGrid.EditIndexes.Count == 0 %>'><img style="border:0px" alt="" src="/_layouts/images/Telerik/Edit.png" /> Edit Selected</asp:LinkButton>&nbsp;&nbsp;       
           <asp:LinkButton ID="btnUpdateEdited" runat="server" CommandName="UpdateEdited" Visible='<%# myGrid.EditIndexes.Count > 0 %>'><img style="border:0px" alt="" src="/_layouts/images/Telerik/Update.png" /> Update Items</asp:LinkButton>&nbsp;&nbsp;
           <asp:LinkButton ID="btnCancel" runat="server" CommandName="CancelAll" Visible='<%# myGrid.EditIndexes.Count > 0 || myGrid.MasterTableView.IsItemInserted %>'><img style="border:0px" alt="" src="/_layouts/images/Telerik/Cancel.png" /> Cancel editing</asp:LinkButton>&nbsp;&nbsp;                   
           <asp:LinkButton ID="LinkButton6" runat="server" CommandName="RebindGrid"><img style="border:0px" alt="" src="/_layouts/images/Telerik/Refresh.png" /> Refresh table</asp:LinkButton>&nbsp;&nbsp;
               <br />
         </CommandItemTemplate>
    </MasterTableView>
    <ClientSettings EnablePostBackOnRowClick="true" ClientEvents-OnPopUpShowing="PopUpShowing" >
        <Selecting AllowRowSelect="True" EnableDragToSelectRows="True"></Selecting>
    </ClientSettings>
</telerik:RadGrid>

 

 

private void EditSelected_Click(object sender, EventArgs e)
{

????

}

 

when I checked Items it shold come the checked Items in Popup and edit.

 

I would be glad about your help.

Thanks a lot.

 

 

 

 

Maria Ilieva
Telerik team
 answered on 12 May 2016
9 answers
566 views
Hi

I have used OnPupupOpening of RadDatePicker. It's working proper but Calendar does not get pop up. 

My code is 
<telerik:RadDatePicker ID="FromDatePicker" runat="server" Culture="English (United States)">
                                                                                <ClientEvents OnPopupOpening="OnPopupOpening" ></ClientEvents>
                                                                                <dateinput >
                                                                                </dateinput>
                                                                                <calendar showrowheaders="False"
                                                                                    usecolumnheadersasselectors="False" userowheadersasselectors="False"
                                                                                    viewselectortext="x">
                                                                                </calendar>
                                                                                <datepopupbutton />
                                                                            </telerik:RadDatePicker>
<script language="javascript" type="text/javascript">
function OnPopupOpening(sender, args) {
    GetValue();
    }
</script>

here, GetValue() is called properly but i am not able see calendar.

Thanks
Kamini
Maria Ilieva
Telerik team
 answered on 12 May 2016
2 answers
59 views

I'm looking for a way to prevent a task from becoming a summary (by adding tasks, or moving/dropping tasks, as children) if certain conditions exist on that task.  For instance, if a task has had time reported against it, it cannot become a summary.

Can I prevent all the CRUD operations on the Gantt based on checking for a condition on the task that would become a summary?  Can I return the data to check as part of the Gantt query? Or would this have to be outside the control?

Thanks for any help or hints

Ivan Danchev
Telerik team
 answered on 12 May 2016
1 answer
101 views

Hi,

 

I'm quite new to the Telerik framework, but I've found some strange behaviour(s) when using buttons.

 

I've got a RadGrid with an edittemplate that expands when a user clicks the editcolumn of a row he wishes to edit.

In this edittemplate I have a few textfields, dropdowns and buttons (checkboxes).

Strangely enough the buttons are acting somewhat strange; my project manager wants me to use the classic rendertype - but when using the classic rendering I seem to have a checkbox in the checkbox (meaning that I have another box inside the box that is left of the text of said checkbox). 

If I however go for a lightweight rendering it seems fine, until I check the box once which then expands the width of the checkbox. 

 

Here are some snippets of the code:

 

<div style="margin-top:10px;">
                                   <telerik:RadButton ID="RbtnShow" RenderMode="Auto" runat="server" ToggleType="CheckBox" ButtonType="StandardButton" style="margin-right:203px;">
                                       <ToggleStates>
                                           <telerik:RadButtonToggleState Text="Show On Report" PrimaryIconCssClass="rbToggleCheckboxChecked" />
                                           <telerik:RadButtonToggleState Text="Show On Report" PrimaryIconCssClass="rbToggleCheckbox" />
                                       </ToggleStates>
                                   </telerik:RadButton>

                                   </telerik:RadButton>
                                          <telerik:RadLabel runat="server" ID="RlblDate" AssociatedControlID="RtxtDate" Text="State Date:" style="margin-right:38px;" />
                                            <telerik:RadTextBox ID="RtxtDate" runat="server" width="130px">
                                            </telerik:RadTextBox>
                                       </div>

 

                                 <telerik:RadButton ID="RbtnKey" runat="server" ToggleType="CheckBox" ButtonType="StandardButton" width="110px"  

                                                                style="margin-right:200px;">
                                       <ToggleStates>
                                           <telerik:RadButtonToggleState Text="Key Issue" PrimaryIconCssClass="rbToggleCheckboxChecked" />
                                           <telerik:RadButtonToggleState Text="Key Issue" PrimaryIconCssClass="rbToggleCheckbox" />
                                       </ToggleStates>
                                   </telerik:RadButton>

 

 

I'll attach a picture so you might understand it better.

Joana
Telerik team
 answered on 12 May 2016
2 answers
330 views

My Radupload control is not remebmering the value on post back and therefore loosing its value to upload the files.

        <telerik:RadAsyncUpload ID="rdFileUploads" TargetFolder="~\uploads\" MultipleFileSelection="Automatic" runat="server"></telerik:RadAsyncUpload>
                          

01.foreach (UploadedFile file in rdFileUploads.UploadedFiles)
02.          {
03.              tblApertureNetAttachment _attachment = new tblApertureNetAttachment();
04. 
05.              string fullPath = Server.MapPath(@"~\Uploads\");
06.              string fileName = txtRef.Text + "_" + txtFirstname.Text + "_" + txtLastName.Text + "_" + file.FileName;
07.              file.SaveAs(Path.Combine(fullPath, fileName), true);
08. 
09.        
10.          }

 

Veselin Tsvetanov
Telerik team
 answered on 12 May 2016
1 answer
69 views

Hi Telerik Team,
I am using batch edit grid.

My requirement: I want to restrict the user to add new records when the number of records in grid view is more than the Some Quantity (Eg:-2 records).
Below is the code

Note:-Quantity is dynamically Vairing value

ASPX:

<telerik:RadGrid ID="gvSerialNumberTracking" GridLines="None" runat="server" AllowPaging="false"OnBatchEditCommand="gvSerialNumberTracking_BatchEditCommand" OnItemCommand="gvSerialNumberTracking_ItemCommand" CssClass="gvPLC">
  
<MasterTableView DataKeyNames="SerialNumber_ID,SerialNumber_DJ_ID" TableLayout="Auto" EditMode="Batch" AutoGenerateColumns="false"CommandItemDisplay="Top" ClientDataKeyNames="SerialNumber_ID">
 <BatchEditingSettingsEditType="Row" />                                                                     
  <Columns>
<telerik:GridBoundColumn DataField="UnitSN" HeaderText="Unit SN" HeaderStyle-Width="100px" UniqueName="UnitSN"></telerik:GridBoundColumn>
<telerik:GridBoundColumnDataField="Sub1" HeaderText="Sub1" HeaderStyle-Width="100px" UniqueName="Sub1"></telerik:GridBoundColumn
 <telerik:GridBoundColumnDataField="Sub2" HeaderText="Sub2" HeaderStyle-Width="100px" UniqueName="Sub2"></telerik:GridBoundColumn>
</Columns>
</MasterTableView>
<ClientSettings AllowKeyboardNavigation="true">
<ClientEvents  OnRowCreating ="OnRowCreating" />
</ClientSettings>
</telerik:RadGrid>

 

function OnRowCreating(sender, args)
{
var grid = $find("<%=gvSerialNumberTracking.ClientID %>");
var MasterTable = grid.get_masterTableView();
var Rows = MasterTable.get_dataItems();
var Qty = $("#txtJQuantity").val()
  
// txtJQuantity is the quantity (in our case its 2)
if ((Rows.length) > ($("#txtJQuantity").val()))
{
                                                                      
//alert('Wait! You cannot add more than ' + $("#txtJQuantity").val() + ' items');
                                                                      
//args.set_cancel(true);
  
  
}
}

Thanks and Regards,
Sandeep
Eyup
Telerik team
 answered on 12 May 2016
6 answers
538 views

Hi, I have to create a table to monitor a list of streams.
The table, as you can see from the attached, must have the following features:

- The stream description (or name) to be monitored
- The type (input, output or both)
- The results of a particular day (and here is the problem)

It must also be possible:
- Switch the view from one week to another
- Change the type of streams to be displayed (View 1 for example shows the customer streams. The View 2 is for suppliers streams)

The data streams are provided by Web Service, via JSON.

I planned on doing everything with the RadGrid, but I have some difficulties in its implementation.

This is the model to pass:

1.[DataContractFormat]
2.public class StreamOutputDto : BaseDto
3.{
4.    public string Name { get; set; }
5.    public string Type { get; set; }
6.    public List<DetailStream> Details { get; set; }
7.}

 

Where "DetailStream" is:

01.public class DetailStream
02.{
03.    public string Id { get; set; }
04.    public DateTime Date { get; set; }
05.    public int CountInfo { get; set; }
06.    public StateStream StateInput { get; set; }
07.    public StateStream StateOutput { get; set; }
08.    //...
09.}
10. 
11.public enum StateStream
12.{
13.    InProgress,
14.    Received,
15.    Declined,
16.    Inexistent
17.}

 

So DetailStream is the result of a specific stream in a specific day.
Details is a list of DetailStream, ie the results of a specific stream in a specific week.

With Name and Type there are no problems, but I do not know how to manage the list of DetailStream.

 

This is my current implementation:

My Web Service:

01.[ServiceContract]
02.public interface IMyService
03.{
04.    [OperationContract]
05.    [WebInvoke(
06.        Method = "POST",
07.        ResponseFormat = WebMessageFormat.Json)]
08.    StandardResponse<StreamOutputDto> GetStream(string request);
09.}
10. 
11. 
12.[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Required)]
13.[MessageLoggingBehavior]
14.public class MyService : IMyService
15.{
16. 
17.    public StandardResponse<StreamOutputDto> GetStream(string request)
18.    {
19.        // TEST CASE:
20.        StandardResponse<StreamOutputDto> response = new StandardResponse<StreamOutputDto>();
21.        response.Output = new StreamOutputDto();
22.        response.Output.Name = "Hi!";
23.        response.Output.Type = "Input";
24.        response.Output.Details = new List<DetailStream>();
25.         
26.        response.Output.Details.Add(new DetailStream(){
27.                Id = "1",
28.                CountInfo = 100,
29.                Date = DateTime.Today });
30. 
31.            response.Output.Details.Add(new DetailStream(){
32.                Id = "2",
33.                // Date = yesterday,
34.                CountInfo = 200 });
35. 
36.        return response;
37.    }
38. 
39.}

 

My WebForm.aspx:

01.<head>
03.    <script src="RadGridParser.js"></script>
04.</head>
05. 
06.<body>
07. 
08.    <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
09.    <telerik:RadSkinManager ID="RadSkinManager1" runat="server" ShowChooser="true"/>
10.     
11.    <telerik:RadGrid ID="RadGrid1" RenderMode="Lightweight" ClientDataSourceID="RadClientDataSource1"
12.             AllowPaging="false" AllowSorting="false" AllowFilteringByColumn="false" PageSize="5" runat="server">
13. 
14.        <MasterTableView DataKeyNames="Name" ClientDataKeyNames="Name">
15.            <Columns>
16.                <telerik:GridBoundColumn DataField="Name" HeaderText="" DataType="System.String" >
17.                </telerik:GridBoundColumn>
18.                <telerik:GridBoundColumn DataField="Type" HeaderText="Tipologia flusso" DataType="System.String">
19.                </telerik:GridBoundColumn>
20.                <telerik:GridBoundColumn DataField="Day1" HeaderText="Lunedì">
21.                </telerik:GridBoundColumn>
22.                <telerik:GridBoundColumn DataField="Day2" HeaderText="Martedì">
23.                </telerik:GridBoundColumn>
24.                <telerik:GridBoundColumn DataField="Day3" HeaderText="Mercoledì">
25.                </telerik:GridBoundColumn>
26.                <telerik:GridBoundColumn DataField="Day4" HeaderText="Giovedì">
27.                </telerik:GridBoundColumn>
28.                <telerik:GridBoundColumn DataField="Day5" HeaderText="Venerdì">
29.                </telerik:GridBoundColumn>
30.            </Columns>
31.        </MasterTableView>
32. 
33.    </telerik:RadGrid>
34. 
35.    <telerik:RadClientDataSource ID="RadClientDataSource1" runat="server" AllowBatchOperations="true">
36.        <ClientEvents OnCustomParameter="ParameterMap" OnDataParse="Parse" />
37.        <DataSource>
38.            <WebServiceDataSourceSettings>
39.                <Select Url="http://soldev/Axa.Sol.Web/ws/Ivass/IvassService.svc/GetFlusso3" DataType="JSON" RequestType="Post" />
40.            </WebServiceDataSourceSettings>
41.        </DataSource>
42.        <Schema ResponseType="JSON">
43.            <Model ID="StreamModel">
44.                <telerik:ClientDataSourceModelField FieldName="Name" DataType="String" />
45.                <telerik:ClientDataSourceModelField FieldName="Type" DataType="String" />
46.                <telerik:ClientDataSourceModelField FieldName="Day1" DataType="String" />
47.                <telerik:ClientDataSourceModelField FieldName="Day2" DataType="String" />
48.                <telerik:ClientDataSourceModelField FieldName="Day3" DataType="String" />
49.                <telerik:ClientDataSourceModelField FieldName="Day4" DataType="String" />
50.                <telerik:ClientDataSourceModelField FieldName="Day5" DataType="String" />
51.            </Model>
52.        </Schema>
53.    </telerik:RadClientDataSource>
54. 
55.</body>

 

My RadGridParser.js :

01.//<![CDATA[
02.function ParameterMap(sender, args) {
03.    //If you want to send a parameter to the select call you can modify the if
04.    //statement to check whether the request type is 'read':
05.    //if (args.get_type() == "read" && args.get_data()) {
06.    if (args.get_type() != "read" && args.get_data()) {
07.        args.set_parameterFormat({ request: kendo.stringify(args.get_data().models) });
08.    }
09.}
10. 
11.function Parse(sender, args) {
12.    var response = args.get_response();
13.    if (response) {
14.        args.set_parsedData(response.Output);
15.    }
16.}
17. 
18.function UserAction(sender, args) {
19.    if (sender.get_batchEditingManager().hasChanges(sender.get_masterTableView()) &&
20.                !confirm("Any changes will be cleared. Are you sure you want to perform this action?")) {
21.        args.set_cancel(true);
22.    }
23.}
24. 
25.//]]>

 

 

 

Marin
Telerik team
 answered on 11 May 2016
25 answers
608 views
hi

is there any way of pre - populating the search text from server side , ive looked through the parameters and i cant find anything refering to text or search text.

ive seen a way to do it from client side , but is there any way to set it on server side , i.e after a postback or page refresh ?

Peter.
Mickael
Top achievements
Rank 1
 answered on 11 May 2016
1 answer
103 views

I've been exploring use of the Spreadsheet control. I followed an example which shows me how to define the provider and read from an XLS file in App_Data folder of ASP.NET application. Uses latest versions of UI/AJAX, VS2015, Azure, etc.

I am finding that simple spreadsheets load reliably.

Medium size ones take a few seconds to load, and then show a blank sheet, no error message.

See attachment for this error.

Large size ones take a long time and timeout.

I am wondering whether there are severe capacity and/or performance issues with the Spreadsheet control, or this behavior is a side-effect of reading a file within my app's directory.

 

Nencho
Telerik team
 answered on 11 May 2016
Narrow your results
Selected tags
Tags
+? more
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Andrey
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Andrey
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?