Quantcast
Channel: Telerik Blogs
Viewing all 5210 articles
Browse latest View live

5 Things Apache Cordova Developers Need to Know When Switching to Xamarin

$
0
0

If you've decided to make a switch to Xamarin from Cordova for your cross-platform mobile app development, here are the top five tips you need to know.

While there is debate over whether the web-based programming model of PhoneGap/Cordova or the more native approach of Xamarin is the best "Hybrid" development model for mobile apps, this article will assume you've settled that debate for yourself and you're ready to make the leap to Xamarin. Here are some things you should know.

1. Xamarin and Cordova Solve Different Problems

To understand the differences and the similarities between Xamarin and Cordova, it helps to start with an understanding of the how the architectures relate to the mobile environments themselves.

Cordova based apps are built to run in a special wrapper around the HTML Rendering engine contained in the UIWebView (for iOS, WebView for Android) control. Think of it as a programmable web browser. Your HTML/CSS/JavaScript are all executed in that browser control. Cordova Plugins provide JavaScript wrappers around the native APIs exposed via the Objective-C Runtime or the Android Runtime. The Cordova Core plugins attempt to unify the features and functionality of all operating systems into a consistent API for your apps. Platform specific plugins are available for when you need to call OS or device specific APIs.

Xamarin apps are built to run in a version of the Common Language Runtime called Mono. Unlike Cordova Core libraries that attempt to hide the differences in the various OS APIs in a unified but often limited way, Xamarin exposes the native APIs directly with all features available to the developer. This also allows for Xamarin apps to be written against nearly any existing libraries for the OS platforms no matter what technology was used to create them.

For iOS apps running on an iPhone, the code is compiled into native binary libraries. This has some advantages and disadvantages and is described in detail here.

For example, here is Xamarin.iOS code used to initialize an app in iOS.

public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.UIApplicationDelegate
{
  public override bool FinishedLaunching(UIApplication app, NSDictionary options)
  {
    return base.FinishedLaunching(app, options);
  }
}

And here is the same code in Swift:

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
  func application(_ application: UIApplication,
    didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
    return true
}

Notice that the Xamarin app uses the NSDictionary object to hold the options. In this case, the NSDictionary object is a reference to an actual NSDictionary object from the Foundation APIs of iOS.

This is truly the core difference between Xamarin and Cordova. Cordova attempts to provide a unified JavaScript programming model for any mobile device while Xamarin is a programming model built to expose the features of the mobile platform in a way consistent for .NET developers.

2. Xamarin isn't Hybrid, Xamarin.Forms Is

You're right, it's not. At its core, Xamarin is a development environment built to allow .NET development on mobile devices with as little abstraction away from the platform as possible. You get the advantages of the .NET BCL libraries and Mono runtime along with the features of the underlying OS. If however you want to create apps that can run in multiple platforms, you would use a Xamarin Extension called Xamarin.Forms.

In a Xamarin.iOS or Xamarin.Android app, the UI elements are built using the same models as native development. That means iOS uses storyboards and views and Android uses .AXML files. Both Xamarin Studio and Visual Studio have great design time tooling for building user interfaces. Those files are then compiled into the app packages in much the same way as native apps, usually as embedded resources.

Xamarin.Forms is based on the XAML user interface programming model that has been around the .NET world for building Windows apps for quite a few years. As a matter of fact, Xamarin.Forms also works for building Universal Windows Platform apps as well which includes Windows 10, Xbox, HoloLens, Surface Hub, and others. XAML is a declarative model of building user interfaces, similar to HTML, but using well formed XML tags specific to the user interface controls for Xamarin.Forms. Here's an example of a basic UI defined in XAML.

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
                xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
                xmlns:local="clr-namespace:App2"
                x:Class="App2.MainPage">
  <StackLayout Orientation="Horizontal" HorizontalOptions="Center" VerticalOptions="Center">
    <!-- Place new controls here -->
    <Label Text="Welcome to Xamarin.Forms!"
              HorizontalOptions="Center"
              VerticalOptions="CenterAndExpand" />
    <Switch />
  </StackLayout>
</ContentPage>

This specification defines a simple page with a label in the center of the screen saying "Welcome to Xamarin.Forms" and a Switch control next to it.

While Xamarin.Forms controls are different from HTML controls, you'll find many of the same features are available and can roughly be grouped into the following categories.

  • Pages: These controls represent the basic page types and include ContentPage, NavigationPage, TabPage, MasterDetailPage, and others.
  • Layout: These controls manage the layout of other controls on the page and include things like StackLayout, ScrollView, and Grid.
  • Views: These are the individual controls on a page such as Label, Button, Image, etc.
  • Cells: These controls are used in ListView and TableView controls and are used to format the content of those controls.

We don't have time to cover all of these controls in this article, but you can read more about the various controls available and how to use them here. More importantly, these controls directly relate to UI controls on each of the mobile platforms.

Here is what the earlier example looks like in each platform:

Notice that each switch looks subtly different. This is because the platform itself determines how the control looks. This ensures that apps written for iOS look like other apps written for iOS, Android apps look like other Android apps, etc.

Xamarin.Forms pages and UI code is compiled into a library that is then included in a project for each platform, typically [App].iOS, [App].Android, [App].UWP. If you need to write platform specific code, you can add it to the platform specific projects. Xamarin.Forms also has ways to specify platform specific values, but mostly you'll want to keep your platform code in the platform projects.

3. Working with Images is More Complex

In web technologies, images are easily incorporated into applications with the WebView control doing most of the heavy lifting to translate the image to the screen resolution of the device. In native mobile apps and Xamarin, things are a bit trickier. Images are embedded into the app as resources and depending on the platform can require you to create multiple versions to allow for the differences in screen resolution.

For iOS, images are organized into Asset Catalog Image Sets and require a version of the image in different sizes to support the various resolutions and scaling of iOS devices. You then use a JSON file to specify which images work with which devices and resolutions.

For more information about using images with Xamarin you can read more here.

In Android, images are resources that are embedded into the application. While Android will attempt to scale the images to the device resolution, you can assist that by providing varying density bitmaps. You can use the Android Asset Studio to generate these images for use in your Xamarin apps. Resources are organized into folders and images are placed in folders that start with "drawable." Here's an example of the folder structure:

For more information on using images in Xamarin Android you can look at the documentation here.

4. C# and JavaScript Aren't that Different

If you're used to coding in JavaScript, you'll find C# a relatively easy transition. JavaScript is based on the Java language which itself is based on C which is also the basis for C#. So many of the same structural concepts such as control, branching, etc. are all very similar. What's more if you've been writing your JavaScript using the latest Angular framework then you are familiar with TypeScript. TypeScript is a strongly typed language that generates JavaScript.

C# and TypeScript were both designed by Anders Hejlsberg at Microsoft

Angular components and C# classes are actually quite similar. Take for example, these two classes:

Angular/TypeScript

import { Component } from '@angular/core';
import { NavController } from 'ionic-angular';

@Component({
  selector: 'page-contact',
  templateUrl: 'contact.html'
})

export class ContactPage {
  constructor(public navCtrl: NavController) {
  }
}

C#/Xamarin.Forms

using Xamarin.Forms;
using Xamarin.Forms.Xaml;

namespace HelloXamarin<
{
  [XamlCompilation(XamlCompilationOptions.Compile)]
  public partial class ContactPage : ContentPage
  {
    public ContactPage ()
    {
      InitializeComponent ();
    }
  }
}

Each class accesses code from other libraries via Imports or using, each has a constructor, both use the standard curly brace and semicolon that derive from the root C language. The biggest difference is that JavaScript allows you to swap variable types at will including assigning functions to variables. C# is a typed language and so you generally specify the specific types you want to use. For example:

var x = "1";
var y = x * 2;

In JavaScript this code will run fine and y will be assigned the value of 2. The JavaScript interpreter converts the string value of x to an integer at runtime and then multiplies by 2 and assigns the result to the variable y.

In C# this code won't even compile as you will get a compiler error saying "Operator * cannot be applied to operands of type 'string' and 'int'." This may seem like a limitation but what is happening is the compiler is forcing you to be explicit so that you can avoid errors at runtime. Bugs are always easier to kill before they get into production.

This specificity also means that more complex concepts in JavaScript such as Promises require a slightly different approach in C#. Variables that reference a function (or method in C#) are a specific type called delegates. The C# language has the ability to use anonymous delegates (aka Lambdas) so you can write your code in much the same way as you would in JavaScript. For example, this code is executed when the user clicks on the Switch control:

Switch.Toggled += (sender, e) => {
  // Switch Button Toggled
};

However, to truly implement JavaScript Promises, you'll need to use the .NET Task library in System.Threading.Tasks namespace. Here is an example taken from an excellent post on the subject by Matt Mazzola.

JavaScript

const GetNumberPromise = async (): Promise<number> =>
new Promise<number>((resolve, reject) => resolve(util.SimulateSynchronousApi()))

C#

public static Task<int> GenerateNumberAsyncTaskRun()
{
  return Task.Run(() => SimulateSynchronousApi());
}

5. Building Your App in Xamarin is Just Like Building it in Cordova

Xamarin and Cordova both rely on the native platforms to build the application for deployment. If you use the command-line "cordova build ios" or "cordova build android", it will launch a series of batch commands that will call the corresponding platform SDK to compile and package your app. This means for example that in order to build an iOS app, you need to be running in iOS because you need XCode. Many Cordova developers have worked around this requirement by using Adobe PhoneGap Build, an online tool that allows you to upload a ZIP of your project and they will compile it against the platforms of your choice.

Xamarin works in much the same way, locally you can build your apps against the various SDKs. Xamarin does allow for you to build your iOS apps from Windows if you have an iOS machine it can connect to. But Microsoft also has the Visual Studio App Center which will allow you to build your apps for any platform along with a ton of other features like automated testing on real hardware devices, beta test your apps without having to go through the respective App Stores, and also debugging and analytics.

If you have decided to make a switch from Cordova to Xamarin, these tips should help make the process easier for you. But of course, everything can't be covered in one post. If you've already switched, what other tips did you wish you knew? Feel free to share in the comments below.

And for those of you developing Xamarin apps looking for a comprehensive, modern set of UI components, don't forget to check out Telerik UI for Xamarin - download a free trial and build professional Xamarin apps fast.


Building Beautiful Conversational UI with Telerik UI for WPF

$
0
0

Learn how to use the Conversational UI control in Telerik UI for WPF to style the UI of your chatbot, easily aligning it with the rest of your application's user interface.

Chatbots are a very convenient way to handle a limited amount of specialized processes that replace the need to talk to an expert over the phone, or to use complicated UIs such as long forms or processes. If you are looking for a way to implement one in your WPF application, then you should look no further, because Progress has got your back:

IntroductionGif

Telerik UI for WPF has a Conversational UI component (or RadChat, the name of the control), which is our answer to the increasing demand for an easy way to create a chatbot UI that fits the style of the rest of your desktop application. In general, RadChat is designed to be used with any of the chatbot services available today. It is also suitable for creation of peer to peer chats. You can check the available QSF demos, which demonstrate possible integrations with Azure and DialogFlow.

Here are some of the main features of the control:

Messages

What is a chat without messages . The RadChat provides a range of them which can be used for a variety of different scenarios. You can add anything from basic text messages and GIF messages, to more complex carousel messages containing a list of other image messages. You can check them all out in our documentation.

GifMessage

CarouselMessage

Cards

Some messages need to display more information and here is where all the available cards come in to play. Currently there are specialized cards for displaying images, products, weather and flight information. However, you can easily extend them or create a new one if you need.

WeatherCard

FlightCard

ToolBar

If you would like to provide additional functionality, you can do that by adding a command to the ToolBarCommands collection of the RadChat. A button will be created for each command and you can customize its look by providing a ToolBarCommandTemplateSelector.

ToolBar

Suggested Actions

The RadChat gives you the ability to easily interact with users by adding items to its SuggestedActions collection. You also have the option to control what happens when an action is chosen by handling the SuggestedActionReported event.

Suggested Actions

Typing Indicator

You have the option to include a typing indicator to indicate that a user/bot is typing. You can control its visibility, text and add an icon. This is done though the TypeIndicatorVisibility, TypeIndicatorText and TypeIndicatorIcon properties of the RadChat.

TypingIndicator

Check It Out and Share Your Feedback

So, what are you waiting for? Go ahead and try Conversational UI yourself. There isn’t any better way of getting a feel for it. If you have any questions or suggestions, don’t hesitate to contact us. You can post on our forum, propose improvements in our feedback portal, or just reach out in the comments below.

If this is the first time you are hearing about Telerik UI for WPF, it's a comprehensive suite of over 120 UI controls for building high-performance office-inspired WPF business applications. You can learn more about the toolkit at our website and take it out for a spin with a free 30-day trial.

How to Use a jQuery Splitter UI Component in Your Web App - Part 2

$
0
0

Learn how to build the UI of your very own IDE with just three Kendo UI components: Splitter, TreeView and TabStrip.

In the first post on the Splitter component, we were introduced to the Kendo UI Splitter. Here, we will build upon what we have learned by using multiple components together.

Our goal is to build an IDE with Kendo UI. Kendo UI warriors work on very secret coding missions and have developed their own programming language to keep their work hidden. Consequently, they need their own editor that is capable of compiling this proprietary language. For this assignment, we will focus on building the UI of the IDE which will utilize the Splitter, TreeView, and TabStrip components.

Getting Started

The container for the IDE will be a splitter with two horizontal panes. The left pane will contain a TreeView component to show the files and directories in the project. The right pane will be divided into a top and bottom pane. The top pane will contain a TabStrip to navigate between the files. The bottom pane will serve as the console. Before we begin, we will need a skeleton of the code. This example will use the Bootstrap theme. Let’s start by copying the following to practice in the Kendo UI Dojo:

<!DOCTYPE html>
<html>
<head>
  <link rel="stylesheet" href="https://kendo.cdn.telerik.com/2018.2.620/styles/kendo.common-bootstrap.min.css" />
  <link rel="stylesheet" href="https://kendo.cdn.telerik.com/2018.2.620/styles/kendo.bootstrap-v4.min.css" />
  <script src="https://kendo.cdn.telerik.com/2018.2.620/js/jquery.min.js"></script>
  <script src="https://kendo.cdn.telerik.com/2018.2.620/js/kendo.all.min.js"></script>
  <style>
    body { font-family: helvetica; }
  </style>
</head>
<body>
</body>
</html>

The Splitter Component

Next, let’s include the code for the Splitter component. Our app will actually use two Splitter components. One Splitter component will be used to create the left and right panes, with the other Splitter component located within the right pane to divide it into two horizontal panes.

Let’s add the following markup and JavaScript to the document’s <body>:

<div id="splitter">
  <div id="left-pane"></div>
  <div id="right-pane">
    <div id="top-pane"></div>
    <div id="bottom-pane"></div>
  </div>
</div>
<script>
  $(document).ready(function() {
    $('#splitter').kendoSplitter({
      panes: [ { size: '30%', collapsible: true }, {} ]
    });

    $('#right-pane').kendoSplitter({
      orientation: 'vertical',
      panes: [ {}, { size: '30%', collapsible: true } ]
    });
  });
</script>

Here is what the app should look like so far:

Kendo UI Splitter example

The TreeView Component

To create the TreeView component, another element needs to be placed within the left pane. Normally, in an IDE, the files and folders vary from project-to-project. So we will use the dataSource field to build the view instead of hard-coding them in the HTML. For this exercise, we will initialize the TreeView component with a few nodes. In practice, you may want to use methods on the TreeView component to dynamically insert items.

Here is the updated markup:

<div id="left-pane">
  <div id="treeview"></div>
</div>

This code is added to the bottom of your JavaScript to initialize the TreeView component:

$('#treeview').kendoTreeView({
  dataSource: [
    { text: 'Project', items: [
      { text: 'src', items: [
        { text: 'index.html' },
        { text: 'styles.css' },
        { text: 'scripts.al' }
      ]}
    ]}
  ]
});

This is what our updated app looks like:

Kendo UI Splitter example

The TabStrip Component

Ideally, when we click on any item in the TreeView component, we want a tab to appear in the top right pane. This involves using the TreeView component API to get the selected item and using the TabStrip component API to append the tab. The details on how to do this are beyond the scope of this article. However, you can find instructions on how to do so from previous posts on the TreeView component and TabStrip component.

Here, we will be initializing a TabStrip with all of the tabs open. To get started, we’ll add a <div> element within the top pane <div> element:

<div id="top-pane">
  <div id="tabstrip"></div>
</div>

Next, we’ll initialize the TabStrip with three tabs which represent the files we have in our TreeView:

$('#tabstrip').kendoTabStrip({
  dataTextField: 'label',
  dataSource: [
    { label: 'index.html' },
    { label: 'styles.html' },
    { label: 'scripts.al' }
  ]
});

This is what the final project looks like with the `TabStrip` component added:

Kendo UI Splitter example

Conclusion

In this article, we used the Splitter, TreeView, and TabStrip components to build an IDE. By no means should you stop here; continue experimenting with other components! You may want to wrap the Splitter component inside a Window component and add a Toolbar component. There is also much more you can do with the functionality, such as dynamically adding panes to the Splitter component to show additional views like documentation. Or, add close icons to the tabs so that they can be removed. In the upcoming articles, we’ll work on different components that are used for editing. Stay sharp because there will be more tests like these throughout your training!

Try Out the Splitter for Yourself

Want to start taking advantage of the Splitter component in Kendo UI, or any of the other 70+ ready-made Kendo UI components, like jQuery Grid or Scheduler? You can begin a free trial of Kendo UI today and start developing your apps faster.

Start My Kendo UI Trial

Angular and Vue Versions

Looking for UI component to support specific frameworks? Check out the Splitter component in Kendo UI for Angular, or the Splitter component in Kendo UI for Vue.

Resources

Accelerate Your Test Automation with Test Studio—Webinar Recap

$
0
0

Have questions about Telerik Test Studio and how you can use it to accelerate your test automation? We answer them in this recap of our Test Studio Webinar.

Telerik Test Studio is an ultimate test automation solution for web, mobile and desktop applications that can be used by both developers and QAs. It can be applied for Functional, Performance, Load and API testing needs and integrated with today's latest technologies including Angular, React, WPF, MVC, AJAX, RESTful, etc. 

Relive the Content

On August 2nd 2018, we hosted a webinar that answered the following questions:

  • How to quickly get up to speed with test automation
  • Why Test Studio is the best tool for Kendo UI application test automation
  • How to easily integrate API calls in your web functional tests to decrease the risk of script/environment failure and to speed up automation.

Your hosts were Andrew Wieland (Senior Sales Engineer working with Test Studio for more than 5 years) and Iliyan Panchev (Product Manager for Telerik Testing solutions with extensive experience in QA). 

It was an awesome hour. We started with Telerik Test Studio basics, but quickly moved into deep dive discussions and showed off some practical demos. If you could not make it for the live webinar, you can relive the webinar in its entirety—high definition recording available now!

Additional Questions and Answers

One of the most enjoyable aspects of our webinars is the audience interaction and Q/A all throughout. We appreciate developers and QAs bringing up real-world questions and concerns on their latest needs and pain points.

While we tried to answer as many questions as we could on air, here’s an excerpt of some short Q/A topics that were important to resurface:

Q: What are the basic prerequisites for test automation?

A: See our System Requirements Page for recommended and minimum technical requirements to be able to use Test Studio. Beyond this, it depends on what type of application you are trying to test and the will of the tester to start automating. Test Studio takes a lot of the engineering out of automation, but it is also very important to choose the right tool for technology that you are going to test and the expertise of the team. Our recommendation would be to kick off a 30-day trial and try Test Studio out. This tool is known for having a very low learning curve, but we also give you access to our engineering-level support and pre-sales consultation.

 

Q: When we build our tests should we use the record button in the top left or should we be building them manually?

A: Most teams will start by recording their tests by either clicking on the record button, or right-clicking on the test name and selecting recording. Test Studio will capture most actions (clicks, drag and drop, dialog handling, text input, etc.), while the highlight element feature will enable you to add many more custom steps/verifications/etc. Once recorded, you can easily modify your tests, record new steps in the middle of an existing test, and add more customization from the toolbars, all without code OR you can do all that plus editing steps in code, add anything in C# or VisualBasic code if needed, even adding a third party libraries.

 

Q: Does Test Studio work the same with a WPF Desktop application?

A: Yes, the difference is just in pointing the WPF test to the application .exe instead of a browser and url. Check this out for more information.

 

Q: Is it possible to use a Test Studio test as a part of Visual Studio Online Build and Release process?

A: Yes, you can find more detailed information on this topic here. Our command line runner allows you to plug Test Studio right into any build/CI process, so your tests will kick off automatically once a build is compiled and a batch command is sent to the test runner.

 

Q: How do you create API tests?

A:The API tests can be recorded, created manually, or imported from Fiddler. If you want to learn more about API testing you can check out this blog post.

 

Q: How is the CSRF token handled?

A: As soon as you can retrieve the CSRF token from the server e.g. as a part of html or cookie, you can extract it as a variable and include it in any of the following http request with a variable reference.

 

Q: Can Telerik Test Studio work for Telerik Xamarin Forms?

A: In general, yes, but it depends on the implementation. We have a free 30-day full featured trial, so you can try Test Studio for Mobile and see how it works with your application.

 

Q: Can Test Studio be integrated with Atlassian Jira or any other incident management tool?

A: Yes, Test Studio integrates with Jira and TFS out-of-the-box, but also features extensibility APIs that allow you to customize integrations with most file-based systems.

 

Q: Does Test Studio support Nativescript?

A: Yes, it supports testing on NativeScript mobile applications, and even offers built-in configuration for making your app ready to test.

 

Q: Can we get the trial version of this tool ?

A: Yes, you can download a free 30-day full featured trial with a single click. Please feel free to contact our sales team for customized assistance, technical consultation, and even a live demo (Telerik-sales@progress.com).

 

Q: Is there Git integration with Test Studio or any way to save tests in source control?

A: Yes, Git is supported out of the box, along with TFS/VSTS. Check this out for more information. Similar to bug tracking, the Telerik Testing Framework can be customized to integrate with most file-based systems, including SVN, etc.

 

Q: Is there any way to pause a test list that is currently executing?

A: For Test Lists, you can abort a test from within Test Studio, but if you are running the test in quick execution mode, usually when crafting a test, you can pause a test at a current step from the visual debugger that runs with the test.

 

Q: I often have to create Web Test automation for third party Webs. That's Web pages that I don't own the code, neither I know the Technology. Can I use Test Studio?

A: Certainly! You don’t need to have access to the program’s source code for web-based applications. If it produces a DOM-based website, it can be automated with Test Studio. Knowing the type of technology that the app was built with can always help, but we provide lots of tips and samples for configuring the element find logic to work with different technology types (Angular, JQuery, Ajax, etc.).

 

Q: To use the API test as step would we need the API testing module for Test Studio?

A: Yes, since this is how you will be able to create an API test to be referenced as a step in your web test. All of which are included as part of Test Studio Ultimate.

 

Q: As my old knowledge, to start using API testing, we testers must depend on the product supporting API calls, e.g. via HTTP post. Can Test Studio API testing avoid this product support?

A: Yes, it can, Test Studio for APIs supports API calls, you can examine requests and build API tests without the need of other product.

Q: How did you add Data Driven find logic to an element?

A: While editing the element logic (either through the edit-in-live mode or from the step failure details), you can click on the drop-down arrow next to any variable field and a drop-down menu should appear with the names of all columns from a data source that is already bound to that test. See Data-driven find logic.

 

Q: The company I work for does not have "testers". Each developer is expected to write all necessary tests for the code they develop. The price per seat for Test Studio is reasonable for someone who uses it every day. It is too high for devs who might use it 3 or 4 times per year. Could you offer it under some flexible licensing structure where 3 licensed copies could be available for a pool of 15 developers? (Only 3 copies in use at any time.)

A: Test Studio’s full licenses are floating, allowing you to deactivate/reactivate the license machine key from machine-to-machine, without having to uninstall anything. You can easily store your test projects in source control and pick up the latest version of any project, no matter where the license may be active. Thus, you only need to purchase the number of licenses based off how many simultaneous users will need them. We also have Runtime licenses for machines that only need to execute tests, schedule test lists, integrate into your CI/Build process, monitor performance, distribute load, etc. at a much cheaper price-point.

 

Resources

That’s a Wrap

Thanks to Telerik Test Studio, this may be one of the best times to accelerate your test automation. If you are not still our customer and want to learn more about Test Studio, you can download a free trial and dive deeper into the solution. If you are our customer stay tuned about the forthcoming features in the October release this year. If you have a special issue or need a targeted demo for your specific case, you can contact us.

Adios and happy testing!

Plan Your Holidays with Telerik UI for WinForms Scheduler

$
0
0

In this blog post, you will learn more about the Scheduler control in Telerik UI for WinForms and how to use the new holiday support functionality that was added with the latest R2'18 Release.

The Scheduler (a.k.a. RadScheduler) in Telerik UI for WinForms is a highly customizable component for presenting a variety of schedules with appointments in different views such as Day, Week, Month and more. As of R2 2018, we have also introduced support for holidays in RadScheduler, where you are able to set specific dates as non-business days or block them from booking appointments.

Adding Holidays to the Scheduler Control

The Holidays collection stores all special days. It is publicly accessible and with the following API you can add holidays programmatically: 

Telerik.WinControls.UI.Holiday holiday = newTelerik.WinControls.UI.Holiday();
holiday.Date = newDateTime(2018, 5, 24);
holiday.HolidayName = "Saints Cyril and Methodius Day";
holiday.Location = "Bulgaria";
boolgenerateAppointment = true;
this.radScheduler1.Holidays.AddHoliday(holiday, generateAppointment);

In the UI, it will be represented as an all-day appointment which is shown below:

SchedulerHolidays01

Importing from an Outlook Holidays File

The .hol (Outlook Holiday) file extension was developed by Microsoft to store relevant non-working days in Outlook. We have added support for importing Outlook.hol files, so you can easily load holidays for different countries. Here's how you load a .hol file: 

stringfileName = @".hol file location";
boolcreateAppointment = true;
this.radScheduler1.Holidays.ReadHolidays(fileName, createAppointment);

 SchedulerHolidays02

And here is how to load holidays for a specific country from the .hol file:

stringfileName = @".hol file location";
boolcreateAppointment = true;
this.radScheduler1.Holidays.ReadHolidays(fileName, createAppointment, newList<string>() { "Bulgaria"});

SchedulerHolidays03

Highlighting Holidays

Once the Holidays collection is populated (either via the API or by importing a .hol file) we can take advantage of the formatting event to differentiate these dates. Here we have marked all days that contain US holidays with orange and the ones with Bulgarian holidays in green:

privatevoidradScheduler1_CellFormatting(objectsender, Telerik.WinControls.UI.SchedulerCellEventArgs e)
{
    if(!(e.CellElement isSchedulerHeaderCellElement))
    {
        if(this.radScheduler1.Holidays.IsHoliday(e.CellElement.Date))
        {
            strings = string.Empty;
            foreach(var item inthis.radScheduler1.Holidays.GetHolidays(e.CellElement.Date).OrderBy(ae => ae.HolidayName))
            {
                if(!s.Contains(item.HolidayName))
                    s += item.HolidayName + Environment.NewLine;
            }
            e.CellElement.DrawText = true;
            e.CellElement.Text = s.ToString();
            e.CellElement.TextWrap = true;
            e.CellElement.TextAlignment = ContentAlignment.BottomCenter;
            Padding padding = e.CellElement.Padding;
            if(this.radScheduler1.ActiveViewType == SchedulerViewType.Month)
                padding.Bottom = 22;
            e.CellElement.Padding = padding;
            if(this.radScheduler1.Holidays.GetHolidays(e.CellElement.Date).Where(l => l.Location == "Bulgaria").Any())
                e.CellElement.BackColor = Color.LightGreen;
            else
                e.CellElement.BackColor = Color.Orange;
        }
        else
        {
            e.CellElement.DrawText = false;
            e.CellElement.ResetValue(RadItem.BackColorProperty, ValueResetFlags.Local);
        }
    }
}

SchedulerHolidays04

Blocking Dates

In order to block the creation or editing of new appointments, you should remove the dialog for inserting a new appointment and disable the resizing or moving of an existing event to a holiday. To do this, cancel the AppointmentEditDialogShowing, AppointmentResizing and AppointmentMoving events for holidays:

privatevoidradScheduler1_AppointmentMoving(objectsender, AppointmentMovingEventArgs e)
{
    if(this.radScheduler1.Holidays.IsHoliday(e.NewDate) || this.radScheduler1.Holidays.IsHoliday(e.NewDate.Add(e.Appointment.Duration)))
    {
        e.Cancel = true;
        RadMessageBox.Show("You can't add appointments for holidays!");
    }
}
 
privatevoidradScheduler1_AppointmentResizing(objectsender, AppointmentResizingEventArgs e)
{
    if(this.radScheduler1.Holidays.IsHoliday(e.NewStartDate) || this.radScheduler1.Holidays.IsHoliday(e.NewStartDate.Add(e.NewDuration)))
    {
        e.Cancel = true;
        RadMessageBox.Show("You can't add appointments for holidays!");
    }
}
 
privatevoidradScheduler1_AppointmentEditDialogShowing(objectsender, AppointmentEditDialogShowingEventArgs e)
{
    if(this.radScheduler1.Holidays.IsHoliday(e.Appointment.Start))
    {
        e.Cancel = true;
        RadMessageBox.Show("You can't add appointments for holidays!");
    }
}
 

SchedulerHolidays05

Try It Out and Share Your Feedback

RadScheduler is a part of the Telerik UI for WinForms suite, which you can learn more about via the product page and comes with a 30-day free trial giving you some time to explore the toolkit and consider using it for your current or upcoming WinForms development.

Lastly, we would love to hear what you think, so should you have any questions and/or comments, please share them to our Feedback Portal or in the comment section below.

The Modern Web Tour: A Recap

$
0
0

We recently hit the road on our Modern Web Tour in Berlin, Zurich and Munich. Learn about the speakers, what we covered and help us choose where to go next time!

In late July, I packed my bags and made my way across the pond for The Modern Web Tour. This whirlwind trip had three stops in three days – Berlin, Zurich and Munich. In each city, some of the brightest minds in the modern web space – Christian Weyer, Laurent Bugnion, Jessica Engstrom, Jimmy Engstrom, Sam Basu, and Richard Campbell– entertained and educated attendees of the free events.

Richard, the master storyteller that he is, started each event with a talk that covered the History of the Web, including the story of the World Wide Web and the web development tools and techniques that made it all possible. He chronicled the early versions of HTML where you laid out web pages with tables (GeoCities anyone?) and simple scripting languages to CSS, JavaScript and HTML 5, leading to Single Page Applications, Progressive Web Apps and Web Assembly. While most of the people in the audience lived the history he shared, they were engaged and captivated by the narrative.

In Berlin, Christian detailed new ways to build real cross-platform, native-like web-based client applications together with lightweight Cloud architectures. He gave a practical introduction to the WebAssembly and Serverless computing in Azure.

In Zurich and Munich, Laurent gave a technical tour of the new Microsoft by detailing ASP.NET Core, Serverless, Linux on Azure, Web Assembly and more.

Sam closed out the technical presentations with a talk entitled “Modern Web Development with Polished UI.” His talk is built on the premise that .NET developers have always had rich tooling to build web apps, but as the success of the modern web impacts the ASP.NET technology stack, maybe it is time to revisit our options – WebForms, MVC, Razor, .NET Core – paired with JS. He then demonstrated how Progress, with its Telerik .NET and Kendo UI JavaScript tools, can help build modern apps with a polished UI.

Modern Web Tour Collage

And if all that wasn’t enough, we closed out each day with a live recording of .NET Rocks! In Berlin, Richard interviewed Jessica Engstrom. In Zurich he chatted with Laurent Bugnion, and in Munich, he talked with Jimmy Engstrom. The audience not only got to hear the interviews live (recordings will hit the airwaves this month), but they got to see how the shows are made and be part of the studio audience.

As with any trip that finds you in three distinct cities in three days, we did our best to have some fun while not in the conference centers. We all flew together from Berlin to Zurich but opted for a more scenic route from Zurich to Munich. We couldn’t have asked for a more beautiful day as we piled into two cars and one motorcycle and drove from Switzerland to Germany. We made a stop in Liechtenstein for ice cream, coffee, and passport stamps, and then cut through Austria before speeding down the autobahn into Munich.

If you missed the events – either because you live nowhere near the three cities we visited or because the weather was absolutely gorgeous in Germany and Switzerland the week we were there and you went on an impromptu holiday – let us know where you would like us to bring the tour next time around. We’d love to meet as many of you in person as we can and share our thoughts and experience around the Modern Web.

And, as always, if you are interested in UI tools for your modern web applications, make sure you check out the Progress Telerik .NET and Kendo UI JavaScript libraries. We offer a free 30-day trial, complete with support.

Hope to see you on a future Modern Web Tour stop!

How to Bind the Kendo UI Grid to a GraphQL API

$
0
0

Learn how to configure the Kendo UI Grid Component to easily consume data through GraphQL queries and mutations.

By now you have almost certainly heard of GraphQL, the runtime query language for APIs. With rapidly growing popularity, it is becoming an increasingly adopted standard for API development. This has generated demand for frameworks and UI tools that can easily consume the data from a GraphQL API – just like the Kendo UI Components can do, as we provide seamless integration through the DataSource component.

This blog provides a comprehensive guide on how to setup the Kendo UI Grid component to perform CRUD operations through GraphQL queries and mutations. It includes a sample application, code snippets and documentation resources to get you up and running with Kendo UI and GraphQL.

Why are Kendo UI Widgets Easy To Integrate with a GraphQL API?

The backbone of every data-driven Kendo UI Component is the DataSource. It possesses the agility to adapt to any data/service scenario and fully supports CRUD data operations. It is also highly configurable and provides tons of features for fine-tuning its behavior. This is also the main reason why consuming a GraphQL API is so easy with the DataSource abstraction.

Setup a GraphQL Service

First things first – we need to create a GraphQL service that can receive queries and mutations to validate and execute:

  1. Start by defining a type which describes the possible data that can be queried on the service:
    import {
        GraphQLObjectType,
        GraphQLString,
        GraphQLID,
        GraphQLFloat,
    } from'graphql';
      
    module.exports = new GraphQLObjectType({
        name: 'Product',
        fields: () => ({
            ProductID: { type: GraphQLID },
            ProductName: { type: GraphQLString },
            UnitPrice: { type: GraphQLFloat },
            UnitsInStock: { type: GraphQLFloat }
        })
    });

  2. Create queries for fetching the data and mutations for modifying the data server-side:
    const RootQuery = new GraphQLObjectType({
        name: 'RootQueryType',
        fields: {
            products: {
                type: new GraphQLList(Product),
                resolve(parent, args){
                    returnproducts;
                }
            }
        }
    });
      
    const Mutation = new GraphQLObjectType({
        name: 'Mutation',
        fields: {
            AddProduct: {
                type: Product,
                args:{
                    ProductName: { type: new GraphQLNonNull(GraphQLString) },
                    UnitPrice: { type: new GraphQLNonNull(GraphQLFloat) },
                    UnitsInStock: { type: new GraphQLNonNull(GraphQLFloat) }
                },
                resolve(parent, args) {
                    let newProduct = {
                        ProductID: uuidv1(),
                        ProductName: args.ProductName,
                        UnitsInStock: args.UnitsInStock,
                        UnitPrice: args.UnitPrice
                    }
                    products.unshift(newProduct);
      
                    returnnewProduct;
                }
            },
            UpdateProduct: {
                type: Product,
                args:{
                    ProductID: { type: new GraphQLNonNull(GraphQLID) },
                    ProductName: { type: new GraphQLNonNull(GraphQLString) },
                    UnitPrice: { type: new GraphQLNonNull(GraphQLFloat) },
                    UnitsInStock: { type: new GraphQLNonNull(GraphQLFloat) }
                },
                resolve(parent, args) {
                    let index= products.findIndex(product => product.ProductID == args.ProductID);
                    let product = products[index];
      
                    product.ProductName = args.ProductName;
                    product.UnitsInStock = args.UnitsInStock;
                    product.UnitPrice = args.UnitPrice;
      
                    returnproduct;
                }
            },
            DeleteProduct: {
                type: Product,
                args:{
                    ProductID: { type: new GraphQLNonNull(GraphQLID) }
                },
                resolve(parent, args) {
                    let index= products.findIndex(product => product.ProductID == args.ProductID);
                    products.splice(index, 1);
      
                    return{ ProductID: args.ProductID };
                }
            }
        }
    });
      
    module.exports = new GraphQLSchema({
        query: RootQuery,
        mutation: Mutation
    });

     

  3. Serve the GraphQL service over HTTP via a single endpoint which expresses the full set of its capabilities:

    import express from'express';
    import cors from'cors';
    import graphqlHTTP from'express-graphql';
    import schemafrom'./schema';
    import { createServer } from'http';
      
    const PORT = 3021;
      
    var app = express();
      
    app.use(cors());
      
    app.use('/graphql', graphqlHTTP({
        schema
    }));
      
    const server = createServer(app);
      
    server.listen(PORT, () => {
        console.log(`API Server isnow running onhttp://localhost:${PORT}/graphql`)
    });

For additional information on how to setup the server, required packages and the full GraphQL schema, refer to the source code of the sample application.

Configuring the Grid

To be able to use the Kendo UI Grid Component, just reference the required client-side resources of the framework:

Once you have the right setup, adding the Grid is as simple as placing a container element on the page and then initializing the widget with JavaScript:

<div id="content">
  <div id="grid"></div>
</div>
  
$(document).ready(function() {             
  $("#grid").kendoGrid({
    dataSource: dataSource,
    height: 550,
    groupable: true,
    sortable: true,
    pageable: true,
    toolbar: ["create"],
    editable: "inline",
    columns: [{
      field: "ProductID",
      title: "Product ID"
    },
    {
      field: "ProductName",
      title: "Product Name"
    },
    {
      field: "UnitPrice",
      title: "Unit Price"
    },
    {
      field: "UnitsInStock",
      title: "Units in stock"
    },
    {
      command: ["edit", "destroy"],
      title: "Options ",
      width: "250px"
    }]
  });
});
</script>

Using GraphQL on the Client

The wealth of configuration options that the DataSource offers allows you to easily integrate it to work with a GraphQL API and bind the Grid Component to it.

Compose Queries and Mutations

GraphQL is all about asking for specific fields on objects. To populate the Grid initially with records, we need to issue a query against the API to return the object types:

<script>
  varREAD_PRODUCTS_QUERY = "query {"+
    "products { ProductID, ProductName, UnitPrice, UnitsInStock }"+
  "}";
</script>

And then create the mutations for adding, updating and deleting the object type:

<script>       
  varADD_PRODUCT_QUERY = "mutation AddProduct($ProductName: String!, $UnitPrice: Float!, $UnitsInStock: Float!){"+
    "AddProduct(ProductName: $ProductName, UnitPrice: $UnitPrice, UnitsInStock: $UnitsInStock ){"+
      "ProductID,"+
      "ProductName,"+
      "UnitPrice,"+
      "UnitsInStock"+
    "}"+
  "}";
  
  varUPDATE_PRODUCT_QUERY = "mutation UpdateProduct($ProductID: ID!, $ProductName: String! ,$UnitPrice: Float!, $UnitsInStock: Float!){"+
    "UpdateProduct(ProductID: $ProductID, ProductName: $ProductName, UnitPrice: $UnitPrice, UnitsInStock: $UnitsInStock){"+
      "ProductID,"+
      "ProductName,"+
      "UnitPrice,"+
      "UnitsInStock"+
    "}"+
  "}";
  
  varDELETE_PRODUCT_QUERY = "mutation DeleteProduct($ProductID: ID!){"+
    "DeleteProduct(ProductID: $ProductID){"+
      "ProductID"+
    "}"+
  "}";
</script>

Consume the API

To request or modify data through a GraphQL query or mutation, all you have to do is to configure the transport.read method of the DataSource:

  • Set the content-type to “application/json.”
  • Set the request type to “POST.”
  • Pass the composed GraphQL query/mutation as “query” and the model data as “variables” parameters along with the requests to the remote service when performing CRUD operations. This is achieved through the transport.read’s data() method
<script>
    vardataSource = newkendo.data.DataSource({
        pageSize: 20,
        transport: {
            read: {
                contentType: "application/json",
                url: "http://localhost:3021/graphql",
                type: "POST",
                data: function() {
                    return{ query: READ_PRODUCTS_QUERY };
                }
            },
            update: {
                contentType: "application/json",
                url: "http://localhost:3021/graphql",
                type: "POST",
                data: function(model) {
                    return{
                        query: UPDATE_PRODUCT_QUERY,
                        variables: model
                    };
                }
            },
            destroy: {
                contentType: "application/json",
                url: "http://localhost:3021/graphql",
                type: "POST",
                data: function(model) {
                    return{
                        query: DELETE_PRODUCT_QUERY,
                        variables: model
                    };
                }
            },
            create: {
                contentType: "application/json",
                url: "http://localhost:3021/graphql",
                type: "POST",
                data: function(model) {
                    return{
                        query: ADD_PRODUCT_QUERY,
                        variables: model
                    };
                }
            },
            parameterMap: function(options, operation) {
                return  kendo.stringify(options);
            }
        },
        schema: {
            data: function(response) {
                vardata = response.data;
  
                if(data.products) {
                    returndata.products;
                } elseif(data.AddProduct) {
                    returndata.AddProduct;
                } elseif(data.UpdateProduct) {
                    returndata.UpdateProduct;
                } elseif(data.DeleteProduct){
                    returndata.DeleteProduct;
                }
            },
            model: {
                id: "ProductID",
                fields: {
                    ProductID: { type: "string", editable: false},
                    ProductName: { type: "string"},
                    UnitPrice: { type: "number"},
                    UnitsInStock: { type: "number"}
                }
            }
        }
    });
</script>

Format Request Parameters and Parse the Response

Beyond configuring the transports, there are also other features of the DataSource, like the parameterMap() and the schema options, that are useful for encoding the request parameters and parsing the API response:

Start Exploring the Grid

There you go – by simply setting up the DataSource we got the Grid up and running with a GraphQL API. From here on, you can start exploring the vast options of the Grid and also take advantage of the other 70+ ready-to-use Kendo UI components and easily bind them to a GraphQL service.

Additional Resources

Meet Shiva Prasad, Developer Expert for NativeScript

$
0
0
Shiva Prasad, Developer Expert for NativeScript, talks about how he feels at home with NativeScript.

Shiva is a a well-known NativeScript expert who is also mentoring the current cohort of NativeScript Core Ambassadors

This post is part a series featuring our Developer Experts, community members who represent the best of our products. Read about other featured experts here and meet more DEs here.


shiva

What’s your background, professionally?

I started working when I was still a student. During my bachelor's degree in Computer Science and Engineering at Acharya Institute of Technology, Bangalore, I did an internship at Wipro Technovation Center working with Unity, Google Cardboard and Leap motion. After that I interned at a startup called JyoPal technologies that specialized in carpooling where I teamed with an Android developer to build a hybrid app for carpooling. Later I was employed in the same company as a Technology and Product lead. I worked there for 2 years. By then I had graduated (July 2017) and subsequently joined Bfit Technologies in July 2017, where I work as a Lead Software Developer currently for the project named AnyGo Fitness.

Here, I work with a team of 3 skilled backend developers to make mobile and web apps that are focused on the fitness space. In Feb 2018, I became a partner at nStudio.io which is a team of NativeScript Developer Experts. At nStudio, I got to work with many enterprise grade applications like Portable North Pole, TriviaSpar and Sweet.io. Even before I became a Developer Expert for NativeScript, I had been contributing as much as I could for the community, by helping other developers on Slack, Discourse and StackOverflow. I have also contributed several NativeScript plugins to the marketplace and built several NativeScriptSnacks and Code samples. I also write some NativeScript articles in my free time.

Where are you based and why?

I'm currently based in Bangalore. I first came to this city to pursue my Engineering degree. After that, I chose to stay here, because Bangalore is India's largest IT hub, and there are so many opportunities here. Besides, the startup that I work for also operates in Bangalore.

With whom are you working?

I work as a Lead Software Developer at Bfit Technologies, Bangalore and as a Partner at nStudio LLC, US-CA. Apart from that I love to contribute as much as I can for NativeScript! Not only because it boosted my career, but also because of how awesome it is!

What project are you working on now?

Currently I'm working on a few major projects, namely AnyGo Fitness, TriviaSpar, Sweet.io, and some side projects, which I do while taking some online courses. And of course, when I get any cool idea which uses NativeScript that is worth sharing, I switch to that to take a break from my major projects, and then share it with the community.

What’s the most interesting project you’ve done recently?

The most recent interesting or rather challenging part that I worked on was to build a WhatsApp status like implementation for the AnyGo app. That even made me create the nativescript-rad-imagepicker plugin ;). Implementing that really forced me to think out of the box in some situations for things like how "read status" of the status message has to be managed, and how the status creating UI can be represented.

What are some challenges you are encountering now in your work?

One thing that I really wish NativeScript gets soon is support for shared element transitions, because many modern apps have such features these days. I'm aware that NativeScript Android is migrating to use appcompat-support-api. And I hope that this move will enable developers to build more appealing Material UI apps with NativeScript.

Which of our products do you use and why?

NativeScript, of course. The day I first found NativeScript, I fell in love with it. For real! Because it just let me use everything that I already knew to create native mobile apps. If you are a web developer, with NativeScript, you are already a mobile developer too, as long as you adapt your mindset a bit. I have tried all the major competitors of NativeScript, but let me tell you, nothing else feels like home. With NativeScript, I get complete control of when I want to use Native APIs and when I want to use the abstract APIs.

What’s the biggest software pain point, in your opinion, in the mind of your partners or clients?

To me, the biggest software pain point is the requirement collection phase. That reminds me of that tweet, "Who are we? CLIENTS!, What do we want? WE DON'T KNOW!, When do we want it? RIGHT NOW!". Sometimes clients don't know what they want until you show it to them. Jokes aside, my advice is to solidify the requirements and the designs whenever possible, before jumping into code. Iterative development is a safer bet.


ASP.NET Intersections 2018: Developers Share their Platform Choice

$
0
0

Developers today have many options when choosing a technology for ASP.NET application development. So we surveyed 1300+ developers to see their plans for the future.

Developers have an increasingly wide range of technologies from which to choose when building an ASP.NET application. These choices vary on the server-side (i.e. ASP.NET Web Forms versus ASP.NET MVC). These choices also vary on the client-side (i.e. Angular versus React). And with the advent of ASP.NET Core they now have more opportunities to use these technologies in both Windows and Linux.

Recently, we conducted a survey that asked a series of questions relating to development with ASP.NET. We learned that, while Blazor awareness is still relatively low (understandable, considering how new it is) that ASP.NET Core is quickly becoming mainstream, that ASP.NET Web Forms is still a popular framework, but Angular and WebAPI is a suitable alternative, and more.

Read on to learn more about which frameworks your colleagues around the world are using and/or targeting in the next 12 months. And, if you're curious, check out what the state of affairs was in 2017.

Survey Highlights

  • Blazor awareness is behind the adoption curve of ASP.NET Core after six months with 81% of respondents saying they know nothing about Blazor compared to 36% for ASP.NET Core.
  • The familiarity of ASP.NET Core has increased significantly with respondents who know the benefits of the technology, have tried it out, or are using the technology increasing by a total of 15%.
  • There has been a substantial increase in the future use of ASP.NET Core since our previous survey (November 2017)
  • ASP.NET MVC will continue to be the leading .NET Web technology with 57% of respondents who will develop .NET applications choosing that as either their primary or secondary technology.
  • ASP.NET WebForms will continue to reduce in use with only 26% of respondents who will develop .NET applications choosing that technology as their primary or secondary development choice.
  • ASP.NET Core adoption will increase at the expense of all of the other technologies with 49% of respondents who will develop .NET applications choosing that as their primary or secondary technology for the next 12 months.
  • ReactJS is now more popular than AngularJS, while Angular2 adoption remains stable with only a 1% reduction from our survey last year. Other JavaScript frameworks adoption will also decrease among our respondents in the next 12 months.

Survey Analysis

Future Development with ASP.NET

ASP.NET Core familiarity has increased and now fewer than 50% of respondents are unfamiliar with ASP.NET Core and its benefits (n=1365). Furthermore, we see an increase in the number of respondents who are currently using ASP.NET Core, tried the technology but had technical issues, and those who understand the technology but chose not to use it. We conducted a similar survey in November 2017 (n=1143) that asked the same question. Here is the comparison of those results:

Blazor was announced in February 2018 but seems to be having a slower uptake in understanding than ASP.NET Core did at the same time after its initial launch. This could be because it’s still in an experimental phase of course. The following table shows the survey results for ASP.NET Core in September 2016 (a few months after its launch), and for Blazor from June 2018.

September 2016 (ASP.NET Core)

June 2018 (Blazor)

ASP.NET Technologies Targeted in the Year to Come

This next chart shows which ASP.NET technologies being targeted (as a whole) over the next 12 months, excluding respondents who won’t develop any .NET web projects in that time:

As you can see, while ASP.NET MVC still leads the way as the technology of choice among respondents (57%) planned over the next 12 months, ASP.NET Core has had a surge of adoption (+10%) at the cost to all other ASP.NET technologies.  ASP.NET Core is clearly a point of focus for the ASP.NET development community.

If you are using ASP.NET MVC or ASP.NET Core and prefer not to spend time writing UI from scratch, take a look at Telerik UI for ASP.NET Core (the only toolset on the market with a complete set of Tag Helpers) and Telerik UI for ASP.NET MVC.

The combination of Angular and WebAPI provides a suitable alternative to technologies like ASP.NET Web Forms and ASP.NET MVC. It is able to achieve many of the same goals as these technologies by relying more heavily on the client-side. This eliminates much of the need for the server-side “plumbing.” That stated, there is still a role to be played by ASP.NET in a solution that employs Angular. For an overview of what this looks like, check out Ed Charbeneau’s appearance on Visual Studio Toolbox, where he discusses how to use Angular with ASP.NET Core. If you choose ASP.NET Web API + Angular, you can save time developing the UI using Kendo UI for Angular.

ASP.NET Web Forms continues to be used by a significant portion of respondents. In fact, it’s one of Microsoft’s most mature and popular development environments. ASP.NET Web Forms remains a part of the .NET Framework and is still worked on with new features being added in each release. Because of the maturity of the framework, there are feature-filled and rich component libraries available. For example, Telerik UI for ASP.NET AJAX contains more than 100 components, from PivotGrid with OLAP support to rich DataViz to versatile controls such as Grid, Scheduler and Charts.

When it comes to ASP.NET, the best, long-term bet is target ASP.NET Core. This is where most of the innovation is occurring in terms of features and overall performance. For most information about ASP.NET Core, check out the documentation from Microsoft.

Future Development with JavaScript Frameworks

It’s not surprising to see Angular and React near the top of the results from the survey. They are two of the popular frameworks in the developer community and will likely remain popular for the next 2–3 years. For more information about the framework ecosystem surrounding JavaScript, check out the whitepaper, The Future of JavaScript: 2018 and Beyond.

Examining the details of the survey a little further, JavaScript frameworks being targeted (as a whole) over the next 12 months can be determined through the combination of questions 5 and 6, excluding respondents who won’t develop any JavaScript web projects:

These results reflect the opinions of developers surveyed for the Stack Overflow Developer Survey for 2018, which revealed Angular and React to be the most popular JavaScript frameworks. However, the Stack Overflow survey puts React significantly higher in the Loved and Wanted categories at 69.5% wanted over Angular (54.6%).  Paradoxically, in the same survey, Angular is the 4th most dreaded framework among respondents. 

Thank You

Thank you to everyone who participated in our survey and we hope you find these survey results as interesting as we do. How do these results compare to your own expectations for ASP.NET development? Let us know what you think in the comments.

About the Survey

This survey was conducted online through a pop-up poll on telerik.com. The survey comprised of 6 questions; 4 with a single choice and 2 with multiple choice. It was conducted on June 26-27, 2018. The varying number of answers was due to respondents dropping the poll. The maximum statistical error for this survey is determined to be in the range ±2.7% to ±3.5%. No incentive was provided to respondents to complete the survey.

How to Use a jQuery Grid UI Component - Part 2

$
0
0

Learn how to use the editing features of the Kendo UI grid component including incell, inline, and popup editing modes.

In my previous article on the Grid, you learned how to create a Grid in Kendo UI from an existing table and how to build one from a data source. We will continue where we left off and explore other features of the Grid component. Specifically, we will review how to edit data.

The ability to manipulate the data in a grid is a major way this component differs from table components found in other themes. If you have users that need to manage your data, using a Grid provides a user-friendly interface to your database. Instead of querying the database directly, changes can be made with a point and a click. It’s possible to build entire web apps based on this functionality alone. If you have ever used a hosted database service, chances are they provided a data grid for you to manage your data. In this article, you will see how to customize the different editing modes and methods of the Grid component.

Editing Incell

There are three editing modes you can configure to edit data in the Grid. The default mode is incell. This allows users to enable editing by tapping on a table cell. This is the least restrictive means to update your data. You might use this option when the field doesn’t contain critical information like a comment field. To enable this mode you set the editable option to true or incell. This is a grid in incell editing mode:

Kendo UI Grid Example

<!DOCTYPE html>
<html>
<head>
  <title>Grid</title>
  <link rel="stylesheet" href="https://kendo.cdn.telerik.com/2018.2.620/styles/kendo.common-material.min.css">
  <link rel="stylesheet" href="https://kendo.cdn.telerik.com/2018.2.620/styles/kendo.material.min.css">
  <script src="https://code.jquery.com/jquery-1.12.3.min.js"></script>
  <script src="https://kendo.cdn.telerik.com/2018.2.620/js/kendo.all.min.js"></script>
  <style>
    body { font-family: Helvetica; }
  </style>
</head>
<body>
  <div id="grid"></div>
  <script>
    $(document).ready(function() {
      $('#grid').kendoGrid({
        editable: 'incell',
        columns: [
          { field: 'first', title: 'First Name' },
          { field: 'last',  title: 'Last Name' },
          { field: 'city',  title: 'City' }
        ],
        dataSource: {
        data: [
          { id: '0', first: 'Jane',  last: 'Doe', city: 'New York' },
          { id: '1', first: 'John',  last: 'Doe', city: 'Boston' },
          { id: '2', first: 'Peter', last: 'Pan', city: 'Neverland' }
        ]
        }
      });
    });
  </script>
</body>
</html>

Using the edit() event listener you can capture when changes are made to the table cell. You can use this to access the data model or the container element of the cell.

$('#grid').kendoGrid({
  edit: function(e) {
    console.log(e.model);
  }
});

Editing Inline

If you do not want to make it this easy for users to change the data, you can use inline mode. In this mode, users have to click a button to enable editing and to confirm the changes. You also can choose to cancel the changes and none of the edits will be saved. This ensures that the changes made are intentional and not by accident. If you are going to use the inline mode, you have to also set the command option in the parameters. The command option is a column like your other columns. Except instead of binding to your data fields, it holds the commands to manipulate your table.

Kendo UI Grid Example

$('#grid').kendoGrid({
  editable: 'inline',
  columns: [
    { command: 'edit' },
    { field: 'first', title: 'First Name' },
    { field: 'last',  title: 'Last Name' }, 
    { field: 'city',  title: 'City' }
  ] 
});

Notice that there is now an update and cancel button in place of the edit button. The event data will also return the entire table row. To handle the event when you click update, use the save() event listener. This can be used when you want to display a confirmation message to the user.

When creating a Grid that is editable, it is important to define the schema to prevent any errors when changes are made. At a minimum, you will need to define the id field in the schema’s model. Here is an example of the configuration for the schema:

dataSource: {
  data: [
    // removed for brevity
  ],
  schema: {
    model: {
      id: 'id',
      fields: {
        id: { type: 'number' },
        first: { validation: { required: true } },
        last:  { validation: { required: true } },
        city:  { validation: { required: true } }
      }
    }
  }
}

Other parameters you can add to fields include a default value, if it is editable, or nullable.

Editing in Popup

The last mode, popup, also requires the user to click on an edit button except the changes are made in a modal window. Using a popup focuses the user’s attention strictly on the form and prevents them from doing anything else on the page. A popup may also be easier for your users to update data because you have better use of the space. When there are many fields, the information is better organized as a form. This is the table in popup mode:

Kendo UI Grid Example

$('#grid').kendoGrid({
  editable: 'popup' 
});

If you want to do something to your grid other than creating, updating, reading, or destroying data, you can create a custom command. Options for configuring a command include setting the text, icon class and template. This example adds a copy icon to the command column that when clicked prints the data item it belongs to:

columns: [{
  command:[{
    name: 'copy',
    template: '<a class="k-grid-copy k-icon k-i-copy"></a>',
    click: function(e) {
      e.preventDefault();
      var tr = $(e.target).closest("tr");
      var data = this.dataItem(tr);
      console.log(data);
    }
  }]
}]

For the click handler to work, a class with the name k-grid-[command] has to be included in the template where [command] is replaced with the value of the commands’ name field.

Final Thoughts

In the examples shown, we used a local data source to build our grid. However, that is not much of an improvement over creating a grid from an HTML table. To really get the most out of this component, you should try binding the grid to a remote data service. You can perform CRUD operations on your data just by adding a URL to the dataSourcetransport object. Not only does this save you from having to write your own custom request handlers, it makes it possible to build large-scale applications. Web apps like customer relationship management and inventory management software, email clients and media playlists can all be created using the Grid component. In the next post, you will learn how.

Try out the Grid for Yourself

Want to start taking advantage of the Kendo UI jQuery Grid, or any of the other 70+ ready-made Kendo UI components, like the Charts or Scheduler? You can begin a free trial of Kendo UI today and start developing your apps faster.

Start My Kendo UI Trial

Angular, React, and Vue Versions

Looking for UI components to support specific frameworks? Check out the Grid in Kendo UI for Angular, the Grid in Kendo UI for React, or the Grid in Kendo UI for Vue.

Resources

How Test Studio Makes Tester-Developer Collaboration a Reality

$
0
0

Testers and developers both bring tremendous skills and experience to a team. When the two collaborate effectively, quality of work improves, and waste and rework decreases notably. Collaboration improves the effectiveness of team communication, shortens feedback cycles dramatically and ensures testing activities run in parallel with development.

Let’s begin with a simple question – who is responsible for the product quality? Is it the quality assurance engineer?

Quality

The answer is simple: everyone on the team. Everybody is responsible for the quality – PM, designer, developer, QA, Sales, etc. even the customer - from requirements, design, development and testing to sales, marketing and user feedback! When everyone looks after product quality in a collaborative way the chance for success increases tremendously.

So, one request from me - please, forget this one once and for all:

worksonmymachine

It is important to work on the customer's machine. That's the only machine that matters.

Early collaboration eliminates the gap between “dev complete” and “ready to test,” saving a lot of time and boosting team morale. It helps to:

Raise Awareness of Feature Value

An early, in-depth understanding of business owners’ requirements helps developers build better software and testers write better acceptance criteria, enabling the team to focus on getting the right tests in place.

Encourage Testable UI Design

A team that knows what major functional tests will be written can create usable locators and helper methods. This enables automation testers to write stable and maintainable tests to cover the feature.

Garner Faster Feedback

Parallel test development eliminates time between feature completion and test execution, delivering immediate feedback to developers.

Deliver Better Value Faster

Smooth team collaboration helps work pass through the delivery pipeline in a timely and transparent manner, ensuring a sleek continuous delivery process.

Collaboration has two aspects:

Aspects

Here's a few pieces of advice on the first one:

  • Build friendly relationships
  • Keep your issue reporting style positive
  • Listen to each other’s feedback

Since we all know how personal relationships can be improved – going out for a beer, facilitating teambuilding and bonding within the team, etc. – I am going to spend some more time helping you with the second one. In order to make technical aspect of things work, you need the proper tools.

Test Studio supports tester-developer collaboration, enabling both roles to play to their strengths. Testers can focus on writing high-value tests and extending them with features like data driving. Developers come into play in situations where more complex code is needed to solve challenging find logic, or asynchronous situations. Both testers and developers can work together to create helper APIs for system configuration, data setup and so on.

How Test Studio Can Help

First of all, Test Studio has a standalone application for the QA and a Visual Studio Plugin (Test Studio Dev Edition) for the developer. Any Test Studio project can be shared between those two through TFS or Git.

sc

Any third-party libraries or even standalone code files can be imported into the test project. C# or Visual Basic code can be used in the rich coding IDE of the standalone application or in Visual Studio to enhance your tests.

code

Another useful functionality is Element Mapping, where you can create your tests even before the application under test is available through empty elements and the offline step builder. Once the application is live the elements should be mapped to the real ones with a few clicks, and the test is ready to run.

When you have the first set of automated tests it is very important to be able to add them to the team’s Continuous Integration/Continuous Delivery process. This is easy with the Jenkins plugin and the command line runner which integrates with any CI/CD system.

All the results can be reviewed directly into the CI/CD tool or with Test Studio’s reporting feature, which can export them into HTML, XML, Word, Excel and Visual Studio results file formats.

reports1

In this blog post I just barely scratched the surface of Test Studio’s capabilities when it comes to test automation and tester-developer collaboration. If you want to see for yourself, you can download a free, full-featured 30-day trial.

Try Test Studio

Happy testing!

This Week’s Comic: A Brief History of JavaScript

Create a Cross-Platform Desktop and Mobile Chat Application in 30 Minutes

$
0
0

You can easily create a cross-platform desktop and mobile chat application for your project or business by leveraging the Telerik UI for WPF & Telerik UI for Xamarin toolkits and the powerful Chat control.

We recently debuted our Conversational UI (check out our blog post on the matter) and were curious how easy it would be to build a real-time chat application not only between two or more users, but also across multiple platforms. As it turns out, it is very easy due to the consistent API of RadChat controls for WPF, Xamarin and SignalR. To make your own chatbot development easier, we then wanted to share our solution with you.

The solution that we are going to create is separated into three projects.

First is our server project, which is used to transfer messages to the users. It is built with SignalR, which is the .NET library that allows bi-directional communication between a server and a client. 

Second we'll build a WPF application with our Telerik UI for WPF suite. The main control used in the application is the RadChat component. It allows developers to integrate chat UX with consistent look and feel with the existing UI.

Finally we'll create a Xamarin project which consisting of three mobile applications–for UWP, iOS and for Android, built with the great help of Telerik UI for Xamarin.

Creating the Server Application

First of all, as usual we need to create a new blank ASP.NET Web application:

  1. File -> New Project -> ASP.NET Web Application

    1

  2. Select the Empty template and click OK:

    22

  3. Now you have to install the SignalR library. This happens automatically after adding a new SignalR Hub class to your project. This class will be used at a later stage in the application for implementing the communication between the different clients.

    3

    If you don’t have the SignalR Hub template in VisualStudio, you can install it manually by using the NuGet package:

  4. Replace the generated code with the following:

    public class SampleHub : Hub
        {
            private static Dictionary<string, string> userNames = new Dictionary<string, string>();
     
            public void Send(string name, string message)
            {
                Clients.AllExcept(userNames[name]).broadcastMessage(name, message);
            }
     
            public void Register(string userName)
            {
                if (!userNames.ContainsKey(userName))
                {
                    userNames.Add(userName, Context.ConnectionId);
                }
                else
                {
                    userNames[userName] = Context.ConnectionId;
                }
     
                Clients.All.usersLoggedIn(userName);
            }
     
            public override Task OnDisconnected(bool stopCalled)
            {
                var userName = string.Empty;
     
                foreach (var key in userNames.Keys)
                {
                    if (userNames[key] == Context.ConnectionId)
                    {
                        userName = key;
                    }
                }
     
                userNames.Remove(userName);
                Clients.All.usersLoggedOut(userName);
     
                return base.OnDisconnected(stopCalled);
            }
        }

    As you can see the SampleHub class derives from the Microsoft.AspNet.SignalR.Hub, which allows you to define methods which will be called from the client applications (WPF & Xamarin). We added some custom logic for handling the users that are connected to the service – the Register() and OnDisconnected() methods. The client applications should call the Send() method in order to send a new chat message. The Hub’s Send() method in its turn calls the broadcastMessage method which sends a message to all subscribed clients.

  5. Add a new OWIN Startup class to the same project:

    4

    And put the following code in it to set up the SignalR:

    using Microsoft.Owin;
    using Owin;
     
    [assembly: OwinStartup(typeof(SignalRHub.Startup))]
     
    namespace SignalRHub
    {
        public class Startup
        {
            public void Configuration(IAppBuilder app)
            {
                var config = new Microsoft.AspNet.SignalR.HubConfiguration();
                config.EnableJSONP = true;
     
                app.MapSignalR(config);
            }
        }
    }
  6. That’s it. You can run the server application.

Creating the WPF Application

  1. Create a new blank WPF application File -> New Project -> WPF App

    6
  2. Add reference to the following libraries from your Telerik UI for WPF installation:

    7

    You can check the Installing UI for WPF from MSI File help article for more information on how to install the controls.

  3. Install Microsoft.AspNet.SignalR.Client to the WPF application:
    1. Open Tools -> NuGet Package Manager -> Package Manager Console
    2. Run the following command: Install-Package Microsoft.AspNet.SignalR.Client
  4. Now we are going to create a few very basic ViewModel classes which will serve to manage the connection between our RadChat component and the SimpleHub server application. Let’s start with a HubViewModel:

    using Microsoft.AspNet.SignalR.Client;
    using Telerik.Windows.Controls;
     
    namespace ClientWPF.ViewModels
    {
        public class HubViewModel : ViewModelBase
        {
            protected IHubProxy Proxy { get; set; }
     
            protected string url = " http://localhost:59842/";
           
            protected HubConnection Connection { get; set; }
     
            public HubViewModel()
            {
                {
                    this.Connection = new HubConnection(url);
     
                    this.Proxy = Connection.CreateHubProxy("SampleHub");
     
                    this.Connection.Start().Wait();
                }
            }
        }
    }

    The important thing to note here is the creation of a HubConnection object by using the URL which is generated after running the server application in IIS.

    Here is the other needed ChatViewModel:

    public class ChatViewModel : HubViewModel
        {
            private TextMessage currentMessage;
            public TextMessage CurrentMessage
            {
                get { return currentMessage; }
                set
                {
                    if (value != null || value != currentMessage)
                    {
                        currentMessage = value;
                        OnPropertyChanged("CurrentMessage");
                    }
                }
            }
     
            private string userName;
            public string UserName
            {
                get { return userName; }
                set
                {
                    if (value != null || value != userName)
                    {
                        userName = value;
                        OnPropertyChanged("UserName");
                    }
                }
            }
     
            private Author currentAuthor;
            public Author CurrentAuthor
            {
                get { return currentAuthor; }
                set
                {
                    if (value != null || value != currentAuthor)
                    {
                        currentAuthor = value;
                        OnPropertyChanged("CurrentAuthor");
                    }
                }
            }
     
            private ObservableCollection<TextMessage> allMessages;
            public ObservableCollection<TextMessage> AllMessages
            {
                get { return allMessages; }
                set
                {
                    if (value != null || value != allMessages)
                    {
                        allMessages = value;
                        OnPropertyChanged("AllMessages");
                    }
                }
            }
     
            public ChatViewModel(string userName)
            {
                this.UserName = userName;
                this.CurrentAuthor = new Author(this.UserName);
     
                this.AllMessages = new ObservableCollection<TextMessage>();
     
                // Invokes the Register method on the server
                this.Proxy.Invoke("Register", this.UserName);
     
                // Subscribes to the broadcastMessage method on the server.
                // The OnBroadCastMessage method will be raised everytime the Send method on the server is invoked.
                this.Proxy.On("broadcastMessage", (string from, string message) => this.OnBroadCastMessage(from, message));          
            }
     
            internal void OnBroadCastMessage(string from, string message)
            {
                App.Current.Dispatcher.BeginInvoke((Action)(() =>
                {
                    this.AllMessages.Add(new TextMessage(new Author(from), message));
                }));
            }
     
            internal void SendCurrentMessage()
            {
                if (!string.IsNullOrEmpty((this.CurrentMessage as TextMessage).Text))
                {
                    // Invokes the Send method on the server, which in turn invokes the broadcastMessage of all clients.
                    this.Proxy.Invoke("Send", this.UserName, this.CurrentMessage.Text);
                }
            }
        }
  5. Define the RadChat component in the MainWindow:

    <Windowx:Class="ClientWPF.MainWindow"
            xmlns:local="clr-namespace:ClientWPF"
            mc:Ignorable="d"
            Title="MainWindow"Height="450"Width="800">
        <Grid>
            <telerik:RadChatx:Name="myChat"
                                 SendMessage="RadChat_SendMessage"
                                 DataSource="{Binding AllMessages}"/>
        </Grid>
    </Window>
  6. At the startup of our WPF application we would like to open a new Prompt Window in which we can enter the user name. Then, we will create our ChatViewModel class which is the DataContext of our RadChat:

    public partial class MainWindow : Window
        {
            public ChatViewModel ViewModel { get; set; }
     
            public MainWindow()
            {
                InitializeComponent();
     
                RadWindow.Prompt(new DialogParameters
                {
                    Content = "Enter an UserName:",
                    Closed = new EventHandler<WindowClosedEventArgs>(OnPromptClosed)
                });
     
            }
     
            private void OnPromptClosed(object sender, WindowClosedEventArgs e)
            {
                if (e.PromptResult != null && e.PromptResult != string.Empty)
                {
                    this.ViewModel = new ChatViewModel(e.PromptResult);
                    this.DataContext = this.ViewModel;
                    this.myChat.CurrentAuthor = this.ViewModel.CurrentAuthor;
                }
     
            }    }

    After the users has already specified their name, they can send messages. To implement the logic for sending the messages to the server, we would need to handle the RadChat’s SendMessage event:

    private void RadChat_SendMessage(object sender, Telerik.Windows.Controls.ConversationalUI.SendMessageEventArgs e)
            {
                this.ViewModel.CurrentMessage = e.Message as TextMessage;
     
                this.ViewModel.SendCurrentMessage();
            }

    The ViewModel’s SendCurrentMessage() method invokes the Send() method from the server app. In this way, our message is being sent to all clients attached to the server.

    With that, our WPF application is ready.

Creating the Xamarin Mobile Application

  1. Create a Xamarin application using the Telerik Xamarin UI Visual Studio template:

    12

    Using the template, you get all the setup you need to start your application.

    After rebuilding the solution, all packages and binaries will be updated and users will be ready to choose a startup project and deploy it to the targeted platform. For the purpose of this example we are creating Android, iOS and UWP applications. You can check the Getting Started help article which describes in detail how to install Telerik UI for Xamarin.

  2. Again, we will have to add the SignalR Client package to the portable project. This can be done through the NuGet Package Manager:

    222

  3. Now the application has the needed set up and we can modify it by adding some ViewModels to the portable project. We are going to add ViewModels which are very similar to the ones from the WPFClinet application, so I will not describe each method in detail. The code for the view model classes can be reused but this is not the topic of the current blog post, so I won’t dig into that.

  4. Let’s add the HubViewModel:

    public class HubViewModel : ViewModelBase
        {
            protected IHubProxy Proxy { get; set; }
     
            protected string url = "http://localhost:59842/";
     
            protected HubConnection Connection { get; set; }
     
            public HubViewModel()
            {
                {
                    this.Connection = new HubConnection(url);
     
                    this.Proxy = Connection.CreateHubProxy("SampleHub");
     
                    this.Connection.Start().Wait();
     
                }
            }       
        }
  5. It’s just like the one from the ClientWPF application, except that it derives from ViewModelBase:

    public class ViewModelBase : INotifyPropertyChanged
        {
            public event PropertyChangedEventHandler PropertyChanged;
     
            public void OnPropertyChanged([CallerMemberName] string propertyName = null)
            {
                var handler = PropertyChanged;
                if (handler != null)
                {
                    handler(this, new PropertyChangedEventArgs(propertyName));
                }
            }
        }
  6. Now add the ChatViewModel:

    public class ChatViewModel : HubViewModel
        {
            private string mCurrentMessage;
            public string CurrentMessage
            {
                get { return mCurrentMessage; }
                set
                {
                    if (value != null || value != mCurrentMessage)
                    {
                        mCurrentMessage = value;
                        OnPropertyChanged();
                    }
                }
            }
     
            private string mUserName;
            public string UserName
            {
                get { return mUserName; }
                set
                {
                    if (value != null || value != mUserName)
                    {
                        mUserName = value;
                        OnPropertyChanged();
                    }
                }
            }
     
            private ObservableCollection<TextMessage> allMessages;
            public ObservableCollection<TextMessage> AllMessages
            {
                get { return allMessages; }
                set
                {
                    if (value != null || value != allMessages)
                    {
                        allMessages = value;
                        OnPropertyChanged();
                    }
                }
            }
     
            public ChatViewModel(string userName)
            {
                this.UserName = userName;
                this.AllMessages = new ObservableCollection<TextMessage>();
     
                // Invokes the Register method on the server
                this.Proxy.Invoke("Register", this.UserName);
     
                // Subscribes to the broadcastMessage method on the server.
                // The OnBroadCastMessage method will be raised everytime the Send method on the server is invoked.
                this.Proxy.On("broadcastMessage", (string from, string message) => this.OnBroadCastMessage(from, message));
            }
     
            internal void OnBroadCastMessage(string from, string message)
            {
                Device.BeginInvokeOnMainThread((Action)(() =>
                {
                      this.AllMessages.Add(new TextMessage() { Author = new Author() { Name = from, Avatar = string.Empty }, Text = message });
                }));
            }
     
            internal void SendCurrentMessage()
            {
                if (!string.IsNullOrEmpty(this.CurrentMessage))
                {
                    this.Proxy.Invoke("Send", this.UserName, this.CurrentMessage);
                }
            }
        }

    Again, the ChatViewModel looks the same as the one from the WPF app. The only difference is that there is no Dispatcher in Xamarin.Forms. Instead of using a Dispatcher.BeginInvoke(), we can use Xamarin.Forms.Device’s BeginInvokeOnMainThread() method.

  7. We continue creating the views. Add the following XAML markup at ClientXamarin.Portable’s StartPage:

    <?xmlversion="1.0"encoding="utf-8"?>
                 xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"           
                 x:Class="ClientXamarin.Portable.StartPage">
        <StackLayoutVerticalOptions="CenterAndExpand">
            <LabelText="Welcome to Conversational UI demo!"
                   HorizontalOptions="Center"
                   VerticalOptions="CenterAndExpand"/>
     
            <LabelText="Please enter your name:"
                    VerticalOptions="Center"
                    HorizontalOptions="CenterAndExpand"/>
     
            <EntryText="{Binding UserName, Mode=TwoWay}"
                   Margin="5"
                   Completed="Entry_Completed"/>
     
            <StackLayoutOrientation="Horizontal"    
                             VerticalOptions="Center"
                             HorizontalOptions="CenterAndExpand">
     
                <ButtonText="Login"Clicked="Login_Button_Click"Margin="5"/>
     
            </StackLayout>
        </StackLayout>
    </ContentPage>
  8. Add a new class named LoginViewModel. It will be used to pass the entered by the user value for UserName from the StartPage to the page that will be created later:

    internal class LoginViewModel : ViewModelBase
        {
            private string mUserName;
            public string UserName
            {
                get { return mUserName; }
                set
                {
                    if (value != null || value != mUserName)
                    {
                        mUserName = value;
                        OnPropertyChanged();
                    }
                }
            }
     
            public LoginViewModel()
            {
            }
        }
  9. The StartPage.cs file looks as follows:

    public partial class StartPage : ContentPage
        {
            internal LoginViewModel ViewModel { get; }
     
            public StartPage()
            {
                InitializeComponent();
                this.ViewModel = new LoginViewModel();
                this.BindingContext = this.ViewModel;        }
     
     
            private async void Login_Button_Click(object sender, EventArgs e)
            {
                this.NavigateToChatPage();
            }
     
            private void Entry_Completed(object sender, EventArgs e)
            {
                this.NavigateToChatPage();
            }
     
            private async void NavigateToChatPage()
            {
                if (!string.IsNullOrEmpty(this.ViewModel.UserName))
                {
                    var chatPage = new ChatPage(this.ViewModel.UserName);
                    await Navigation.PushModalAsync(chatPage);
                }
            }
        }
  10. Add a new ContentPage named ChatPage to the solution with the following content:

                 xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
                 xmlns:local="clr-namespace:ClientXamarin.Portable"
                 xmlns:telerikConversationalUI="clr-namespace:Telerik.XamarinForms.ConversationalUI;assembly=Telerik.XamarinForms.ConversationalUI"
                 x:Class="ClientXamarin.Portable.ChatPage">
        <ContentPage.Resources>
            <ResourceDictionary>
                <local:SimpleChatItemConverterx:Key="SimpleChatItemConverter"/>
            </ResourceDictionary>
        </ContentPage.Resources>
        <telerikConversationalUI:RadChatx:Name="chat"
                                 ItemsSource="{Binding AllMessages}"
                                 SendMessage="chat_SendMessage"
                                 ItemConverter="{StaticResource SimpleChatItemConverter}">
        </telerikConversationalUI:RadChat>
    </ContentPage>
  11. The code behind of the ChatPage is:

    [XamlCompilation(XamlCompilationOptions.Compile)]
        public partial class ChatPage : ContentPage
        {
            public ChatViewModel ViewModel { get; }
     
            public ChatPage ()
            {      
            }
     
            public ChatPage( string UserName)
            {
                InitializeComponent();
                this.ViewModel = new ChatViewModel(UserName);
                this.BindingContext = this.ViewModel;
            }
     
            private void chat_SendMessage(object sender, EventArgs e)
            {
                this.ViewModel.CurrentMessage = chat.Message.ToString();
     
                this.ViewModel.SendCurrentMessage();
            }
        }

    Similar to the WPF app, we are using the SendMessage event in order to notify the other clients for a new message.

  12. The next step is to create a Converter class of the type IChatItemConverter so we can convert the data items into chat messages and vice versa:

    public class SimpleChatItemConverter : IChatItemConverter
       {
           public ChatItem ConvertToChatItem(object dataItem, ChatItemConverterContext context)
           {
               return (TextMessage)dataItem;
           }
     
           public object ConvertToDataItem(object message, ChatItemConverterContext context)
           {
               TextMessage item = new TextMessage();
               item.Text = message.ToString();
               item.Author = context.Chat.Author;
               item.Author.Avatar = string.Empty;
               return item;
           }
       }

    That’s it! Now, we have a real-time chat application which is working on iPhones, Androids and Desktops. 

    RadChat_WPF&amp;Xamarin3

Closing Words and Next Steps

I hope you found this blog post informative, and that it will help you create a chat application for your business or project. The SampleHub application is deployed to Azure, so feel free to download the app and drop us a line with your feedback. We will be more than happy to see you there, so feel free to share your thoughts!

You can find the source code under our GitHub repository

Lastly, if you are building WPF or Xamarin apps, but prefer to focus on the business logic, while also styling your applications with performant and beautiful UI, you might want to check out Telerik UI for WPF and/or Telerik UI for Xamarin. Both suites offer a free 30-day trial to try them out.

Thanks and happy coding!

How to Choose an ASP.NET Toolkit in Five Easy Steps

$
0
0

In this 5-step guide, Jeff Hadfield helps you select and implement the right commercial ASP.NET controls as efficiently as possible so you can get back to coding. 

You’re a development professional, which you’d think means you get to spend all day developing software. Instead, your time is often hijacked by meetings, coordination, communication, and choosing the right development tools.

I’ve created this guide to help you select and implement the right commercial ASP.NET controls in the most efficient way possible. I’ve created this guide to help you get back to developing software as soon as possible, confident in your controls choice.

That’s the challenge, isn’t it? Your job is to get the project done. You need to deliver reliable, secure, user-friendly sites on time. You know that using commercial controls and tools can speed that process, but sometimes having to choose those tools makes it seem overwhelming and not worth the time.

While it’s posted on the Progress Telerik blog, that’s not what this guide is about. (Go ahead and put them to the test: you decide.) Instead, I’ll share a framework for making a solid, defensible choice for your ASP.NET controls vendor and products.

Let’s get started.

Your Decision Framework

Before we dig into the details, it’s important to understand the process. Many guides suggest that you start with a list of potential vendors. We don’t. Here’s why.

If you know what you need before you shop for vendors and products, your process of searching and selecting will go much more easily. It’s like going to the hardware store and wanting to build a shed before you decide what you’re going to use it for, how big it’s going to be, what kind of weather it needs to withstand, what kinds of features it should have (windows, power, etc.), and how much you’ll need to customize it.

It’s the same with your ASP.NET controls: when you know what you’re planning to build, you can better define your needs, and thereby better know what tools you need.

So our decision framework looks like this:

Descision Framework

 

We’ll discuss each of these steps in the following sections.

Step 1. Determine Needs

Before we search for products and vendors, we need to know what we need those products and vendors to do for us. It’s essential to start with this needs analysis: by doing it first in the process, you’re less likely to make a critical error when you’re in the final selection, or, worse, after adoption.

If you’re addressing a specific need for a specific project, list those needs first. Then, be practical: how might you use the tools in the future, and for other projects you see coming down the pipeline? Do you need flexibility for use in other projects?

Now, here’s where the time spent early in the process pays dividends later. Here’s a list of questions you should ask yourself while listing needs. All may not apply to you, but many will, and hopefully will help you consider all aspects of your upcoming controls purchase.

  • What languages do you need your controls to support? What IDEs and platforms do you need it to work with? For example, if your team has standardized on Visual Studio, you may give higher precedence to a vendor and toolset designed to work with VS.
  • Who’s planning to use the tools? Just you? A team? Your whole company? Who will need to be involved in licensing and the purchase, and do they have any guidelines or recommendations you need to consider?
  • We’re listing this early in the list because in today’s world, it’s essential. What security considerations do you need? Is it to be used internally or externally, and are there company policies or technologies you need to ensure compatibility with?
  • What’s your policy about source code? Do you just prefer, or does your company require access to the source code of any control you purchase? Does the customization you have in mind require access to the source code itself? In some cases, source code escrow is sufficient: where you don’t have direct access to the source code, but were anything to happen to the vendor, you’d receive the source code for your licensed products to ensure business continuity.
  • Consider vendor reliability. Is this a small, one-off project you don’t plan to maintain, so it’s OK if you just get some code from GitHub and call it good? In most businesses, the answer to that is no. Instead, ask yourself: would you prefer an ongoing relationship with support, updates, and so on? And if something happens to the vendor, what happens to your code? Is there, as discussed above, source code escrow so your controls continue to work, or are alternate controls relatively easy to swap in?
  • What kinds of pricing models are you comfortable with? Do you prefer a one-time price or a subscription? (Most commercial controls operate on a subscription basis.) What happens if you let your subscription expire? Do the controls stop working when your subscription ends, or do updates and support simply cease? Does the licensing agreement require royalties if you are reselling software that uses the controls?
  • What’s your expectation for the controls’ general features? Do you need a grid control now and perhaps others in the future? What are the absolute must-haves for functionality? Do the controls support mobile, responsive, and touch UIs? Similarly, do the controls include accessibility and localization capabilities?
  • How frequently do you update your app, and how frequently are the controls updated? Since no software project is ever “done,” thanks to bug fixes and feature requests, does the vendor’s update cadence match that of your projects sufficiently well? Is the vendor responsive to security and feature concerns, regularly updating its controls, and providing an easy way for you to implement those updates?
  • What versions do you need the controls to be compatible with? Are you maintaining or updating a legacy app? Which versions of ASP.NET do you need to be supported?

Whew! That should give you the scope of what you should consider as you evaluate your needs. The aim was not to cover everything you could possibly consider, but instead to help you work through the process of asking crucial questions. Notice that many were business-related: those have a tendency to torpedo even technically valid products, so it’s better to know what to consider early on.

Once you’ve made that list, we recommend you take a moment before we move on to the next step and prioritize it by essential, nice to have, and nice but not essential, or whatever variation of those works best for you. It’ll be useful as we hit future steps.

Step 2: Find Vendors and Products

In this step, you’ll make a big list of potential products and vendors. It’s easy to spend too much time on this step because there’s always one more link to look at… but resist the temptation. Instead, allocate a finite amount of time to spend on this step: say, no more than three hours.

For your search, consider these sources:

  • General web searches
  • Yours and colleagues’ experience
  • Friends recommendations
  • Reviews and publications
  • Partner listings

A spreadsheet is helpful: you may want to create one that includes data like product, vendor, website, source (as listed above), and any notes that occur to you during this first pass.

List all the products that look even a little viable: you’re making the big, comprehensive list, not evaluating. Keep this step as short as possible, since in the next step you’ll be narrowing this list dramatically.

Step 3: Create Your Shortlist

Now that you’ve created your master list of potential products, it’s time to narrow that list to something manageable. Our goal here: a list of no more than three products.

We recommend you work your way methodically through the list, with an initial pass through the list to eliminate products and vendors who don’t fit these critical characteristics:

  • Microsoft partners (they’re getting early access to technology and have direct support from Microsoft)
  • Established vendors (they’re more likely to be around when you need them - and in a few years)
  • Those with active community support (on their site or on sites like Stack Overflow)
  • Full trial or evaluation software with full support before buying
  • Any product or vendor who otherwise raises a “caution” flag in your mind - like hidden pricing, unprofessional sites, unclear features, and so on.

That should knock off a major chunk of the list. Now, compare the remaining products and vendors to the priority list you made in Step 1. Of course, the essential characteristics are showstoppers: if the products don’t have those, you eliminate them from the list.

The goal of this more detailed review is to get your list down to no more than three products for your final evaluation, so go as deep as you need to to achieve that. Why three? First, that’s why we laid out the detailed needs analysis in the first step: so you wouldn’t waste time deeply evaluating products that wouldn’t match your needs. Also, if your project is of any decent size, you won’t be wanting to build a proof of concept for more than three. And, practically speaking, anyone reviewing or approving your recommendations won’t really want to deal with an in-depth review of more than three, either.

Thus, do all the research you need to to narrow the longer list to your shortlist of no more than three products to take to the next step. We’re getting there!

Step 4: Evaluate

Before we begin this step, just a reminder: take good notes during your evaluations. In most situations, you’ll be sharing your observations and assessments with others for feedback or purchase approval, so the better your assessment, the more likely you are to get buy-in.

For each of your no-more-than-three final candidates, you’ll want to download the free trial or evaluation software and register for support. In each case, if possible, try implementing the controls in your same sample app (even a fork of your current codebase). If that’s impractical, you can find sample code from the vendors that approximates what you’re trying to do.

Be sure to reach out to each vendor to gauge the responsiveness and helpfulness of support, including online knowledgebase, any community forums, and, of course, human support via chat, phone, etc.

Since you likely had to register for support, if not also to download the trial software, odds are that a member of the software vendor’s sales team has also reached out to you. You’re at the stage of your evaluation that talking with one of the technical sales folks is a good idea, so go ahead and have a conversation with them. The quality of that conversation should be factored into your final assessment.

Consider how those customization capabilities are implemented. Are the straightforward? Do they use configuration wizards? Is the API straightforward? As mentioned before, be sure to test and use documentation, samples, and support.

And since we’re talking about ASP.NET controls, we can’t overlook one of the most critical factors for Web sites and apps: performance. Make sure the controls are not unnecessarily slowing down your pages and are as lightweight as possible. Especially for e-commerce sites, every millisecond delay in page load represents lost revenue.

For each of your final three candidates, be sure to note less objective things, too. Those might include how easy to use the products seemed to be, how intuitive it seemed, and even how attractive the controls were and if they were complementary to your UI design. Consider how each products’ conventions and nomenclature line up with with what you’re used to using, or are easily parsable. Note how much customization you need to do with each to make it do what you want. While it’s nice to have unlimited customization capabilities, by the same token, you don’t want to have to customize everything every time.

In your summary spreadsheet, if it works for you, add point values, color codes, emojis, or whatever makes it easiest for you to do a final tabulation and summary.

Summarize your findings, recommend the best, and get sign off from any stakeholders: your team, manager, etc.

Step 5: Buy and Go

Since this guide covers how to choose the best ASP.NET controls for you, not how to implement them, this section will be brief. Remember to rely on your vendor, however, and get the support you paid for, especially with the initial implementation. Your vendor, too, wants you to be successful.

Good luck and happy coding.

Meet the Kendo UI and PWA Experts at jsMobileConf

$
0
0

Join us at jsMobileConf - a two-day event focused on the cutting edge JavaScript ecosystem. Find sessions on PWAs, serverless, machine learning, AI, blockchain, AR/VR and more.

Even though our summer vacations are winding down, it's important to look at the bright side: the kids are headed back to school!

But more importantly, it's almost the fall tech conference season! If you've been following Progress and Telerik closely over the years, you know we only go big on conference season. DevReach is a massively popular event we host in Sofia, Bulgaria. ProgressNEXT is our flagship customer conference. We've also hosted NativeScript Developer Day events in Boston and New York the past two years.

While we are still hosting DevReach and ProgressNEXT, we are doing something a little different on the JavaScript mobility front this year. Building on the JavaScript theme, we are putting on an even bigger show that encompasses even more of the JavaScript ecosystem.

We are happy to be bringing you jsMobileConf - a two-day, two-track event focused on all things JavaScript (including Kendo UI and PWAs!).

jsMobileConf will be held on October 25th and 26th in Boston, MA. Skip the details and check out jsMobileConf.com for speakers, sessions, and early bird pricing.

Come and meet some of the very best speakers from the broader Kendo UI community. You'll find folks from the Progress Developer Relations team and a variety of community experts ready to engage you on all things JavaScript (view the full speaker list).

JavaScript FTW

Why jsMobileConf? The fact of the matter is there is very little you can't do with JavaScript these days. We've evolved quite a bit from the embedded <script> tag days with some jQuery animations sprinkled in (not that there is anything wrong with that!).

Today JavaScript means more. It means more to developers and reaches more technologies than ever before. So it's time to bring together some of the experts in a variety of cutting-edge fields to talk about how you can leverage JavaScript to hack on:

  • Progressive Web Apps
  • AR and VR
  • Internet of Things (IoT)
  • Blockchain
  • Serverless
  • Native Mobile Apps
  • Artificial Intelligence

Who is Speaking?

Ah, great question! We've already lined up some amazing speakers for you from Microsoft, Adobe, Progress, a variety of Google Developer Experts, and more.

Here is but a small sample of the topics that may interest you most:

burke hollandBurke Holland

VS Code Can Do That!?
tara manicsicTara Manicsic

Service Workers
stanimira vlaevaStanimira Vlaeva

Webpack and Debugging
michael solatiMichael Solati

Progressive Web Apps

For a full session list, be sure to check out jsMobileConf.com

See You in Boston

jsMobileConf will be hosted at the magnificent Aloft Boston Seaport District hotel. Due to space restrictions we do anticipate selling out, so grab your early bird tickets today and we will see you in Boston this October!

jsmobileconf at aloft boston seaport district hotel


Did You Know? 10 Useful Telerik UI for ASP.NET AJAX Tips

$
0
0

We've put together a list of top tips and tricks to help you develop your ASP.NET AJAX applications with Telerik UI for ASP.NET AJAX.

With a toolset as mature and feature-rich as Telerik UI for ASP.NET AJAX, there are bound to be some features or functionality you are not aware of, so we’ve pulled together 10 Telerik UI for ASP.NET AJAX tips we think you’ll find useful. While it's far from an exhaustive list, hopefully it will give you a good start if you are new to the suite, or show you something you didn't know. 

Happy Coding!

  1. Leverage RadGrid’s Rich Server APIs for Inserting, Updating and Deleting Data
    RadGrid provides a rich server API for inserting new data, updating existing data and deleting data directly from the specified data source (AccessDataSource, SqlDataSource or ObjectDataSource). The ASP.NET AJAX framework enables you to use these features entirely declaratively, except the error-handling logic. RadGrid supports automatic extraction of values from the form template, thus the automatic data-editing does not require any extra coding—you merely declare two-way binding expressions for each input control. Read More

  2. Learn to Use .RESX Files to Localize RadGrid

    RadGrid supports built-in localization through Global resources. Similar to RadEditor and RadScheduler, you can use .resx files to localize the control with minimal effort. The resource files should be placed within the App_GlobalResources folder in your application. You can either create your own language pack or use an existing one. The Telerik controls installation wizard automatically copies the built-in resources to the App_GlobalResources in your local installation. Read More

  3. Turn Filtering Up to 11—Learn to Create Custom Filter Functions

    You can use the "Custom" filter function to introduce a filter function that is not included in the default list, or to allow multiple columns with the same data type to have different filtering menus. The RadGrid filtering menu is implemented using a single object server-side, which is cloned for the separate column menus that appear client-side. This implementation speeds up grid performance but means that every column of the same data type displays the same list of available filter functions. Read More

  4. A Few Simple Adjustments to Improve RadHTMLChart’s Load Time

    Looking to improve your RadHTMLChart load time? Try switching to Canvas rendering (RenderAs="Canvas") or hide the MinorGridLines and/or MajorGridLines of the X and/or Y axis by setting the [YAxis/XAxis].[MinorGridLines/MajorGridLines].Visible property to “false.” Read More

  5. Easily Customize Themes with Sass Theme Builder

    Using the Sass Theme Builder, you can easily customize a theme by customizing the controls. Some of the controls have composite structures and include other child controls to provide the rich functionality they offer, e.g. RadGrid. The Sass Theme Builder applies the selected changes automatically to those controls so you don't have to customize them separately. Read More

  6. Customize RadMenu to Provide Users with Improved Navigation

    RadMenu can be enabled to highlight the upper level of a menu as the user browses to a lower-level menu. This way the user will not feel "lost" when navigating through multi-level menus. Read More

  7. Improve Grid Performance with RadInputManager

    Concerned about grid performance? Try using the RadInputManager to improve client-side performance, RadAjaxAManager to AJAX-ify the grid or RadCompression to compress the response from the server. Read More

  8. Customize the Grid Using GridTemplateColumns

    Want to have different colored cells based on your data? How about two level headers or custom complex structure for your table cells? Using the GridTemplateColumns with HTML tables in the HeaderTemplate/ItemTemplate enables you to make the Grid more dynamic and customized. Read More

  9. Use Telerik Document Processing Libraries to Create, Modify and Export to PDF

    The libraries included in Telerik Document Processing enable you to create, modify and export PDF documents, as well as convert documents from a different file format to PDF. RadPdfProcessing is intended to work with fixed documents. To use its import and export functionalities, you will need to add a reference to the Telerik.Windows.Documents.Fixed assembly. You can import and export a document through the respective methods of the PdfFormatProvider class. Read More

  10. Support for Section 508, WCAG 2.0 and WAI-ARIA Accessibility Standards
    Telerik UI for ASP.NET AJAX supports Section 508, WCAG 2.0 and WAI-ARIA accessibility standards. The implementation of the WAI-ARIA support is achieved entirely client-side (using JavaScript) by appending different attributes and appropriate WAI-ARIA roles to the DOM elements. This is done because an HTML document containing ARIA attributes will not pass validation if they are added on the server. Read More

We hope you find these tips useful as you develop your ASP.NET AJAX apps. Have a great tip we missed? We'd love to hear it, so let us know in the comments below. And if you're new to Telerik UI for ASP.NET AJAX, feel free to dive in and try it out with a free 30 day trial today.

How to Use a jQuery Grid UI Component in Your Web App - Part 3

$
0
0

Learn how to create and manipulate a Kendo UI grid using a remote data source, as we create, read, update, and destroy (CRUD) grid items.

In the last two episodes, you learned how to create a Kendo UI Grid and perform some basic editing operations using a local data source. In this final installment about grids, you will learn how to create and manipulate a grid using a remote data source.

The remote data source I will be using is a public API that contains a list of New York City colleges. In order to make requests to this API from the grid, you need to do three things. First, configure the `transport` object of the data source to perform the action. Second, define the ID and field names of the data source's schema. Last, set the grid's `editable` option and add the command to create the UI. These steps will be explained in more detail to demonstrate how to create, read, update, and destroy items in the grid.

The DataSource Component 

The `DataSource` is a Kendo UI component that abstracts component data from its user interface. We have used it in many components already, like the TreeView and PanelBar. A component's data can be hard-coded into its template, or defined in its `dataSource` parameter. Removing the data from the view is advisable because it makes the component more reusable. The `dataSource` parameter can be set to an array, an object, or a `kendo.data.DataSource` instance. For this example, we will be using the latter method. This is the starter code to create the grid:

Kendo UI Grid example

 
```html
 
<!DOCTYPE html>
 
<html>
 
  <head>
 
    <meta charset="utf-8">
 
    <title>Grid</title>
 
 
    <script src="https://code.jquery.com/jquery-1.12.3.min.js"></script>
 
 
    <style>
 
      body {font-family: helvetica;}
 
    </style>
 
  </head>
 
  <body>
 
    <div id="grid"></div>
 
    <script>
 
      vardataSource = newkendo.data.DataSource({
 
        transport: {...},
 
        schema: {...}
 
      });
 
      $(document).ready(function(){
 
        $('#grid').kendoGrid({
 
          dataSource: dataSource
 
        });
 
      });
 
    </script>
 
  </body>
 
</html>
 
```

Reading Data 

Next, we will fill in the blanks to get the grid to work. First, we will define the parameters of the `transport` and `schema` object. The `transport` option defines what kind of request we will make. We will use `transport.read` to load and save the data from our API. This parameter includes the URL and the format of the result.

```js
 
transport: {
 
  read: {
 
 
    dataType: 'json'
 
  }
 
}
 
```
 

The schema defines the structure of the data. I have used the parse option to preprocess the data before it is saved. Since the data I am using is structured as an array of arrays, I have transformed it into an array of objects and only included a few of its fields so that it is easier to work with. Next, the model parameter of the schema is added to define what fields are in each data item. Binding an `id` to one of the collection's fields is important for the grid to work properly.

```js
 
schema: {
 
  parse: function(response) {
 
    returnresponse.data.map(function(item) {
 
      return{
 
        SchoolID: item[1],
 
        Name: item[9],
 
        City: item[12],
 
        Zip: item[13]
 
      };
 
    });
 
  },
 
  model: {
 
    id: 'SchoolID',
 
    fields: {
 
      SchoolID: {editable: false},
 
      Name: {},
 
      City: {},
 
      Zip: {}
 
    }
 
  }
 
}
 
```
 

Now when you initialize the component, a grid will be automatically be constructed. This saves us from writing additional code to create the columns. However, our data returns 77 items and it is not convenient for the user to load all of these items onto one page. To fix this we can add the `pageSize` option to the data source instance and the `pageable` option to the component's parameters. This will add navigation buttons to the footer of the grid so you can page through the data and skip to the end or beginning of the grid.

Kendo UI Grid example

   
```js
 
vardataSource = newkendo.data.DataSource({
 
  transport: {...},
 
  schema: {...},
 
  pageSize: 5
 
});
 
 
$(document).ready(function(){
 
  $('#grid').kendoGrid({
 
    dataSource: dataSource,
 
    pageable: {
 
      pageSize: 5
 
    }
 
  });
 
});
 
```
  

Updating and Destroying Data 

To enable data updating, you need to first configure the `transport.update` option of the data source instance. To enable data removal you configure the `transport.destroy` option. Since this API only allows data retrieval, I will reuse the same URL for demonstration purposes. In reality, the URL should be set to the endpoint you designed in the API to update and destroy the data. You can also set the request type using the `type` attribute. The default is `get` but for other actions you would use `post.`  Optionally, the `data` attribute can be set to pass additional parameters to the request.

Kendo UI Grid

 

```js
 
vardataSource = newkendo.data.DataSource({
 
  transport: {
 
    ...
 
    update: {
 
 
      dataType: 'json'
 
    },
 
    destroy: {
 
 
      dataType: 'json'
 
    }
 
  },
 
  ...
 
});
 
```
 

Next, you need to set the grid's `editable` option and define the `columns.` Inside the `columns,` we will add the `edit` and `destroy` commands and include all of our fields. Because the model disables the ID field, this field will not show a text field when in edit mode.

```js
 
$('#grid').kendoGrid({
 
  ...
 
  editable: 'popup',
 
  columns: [
 
    {command: ['edit', 'destroy']},
 
    {field: 'SchoolID'},
 
    {field: 'Name'},
 
    {field: 'City'},
 
    {field: 'Zip'}
 
  ]
 
});
 
```
  

Creating Data 

To add new records to the grid, we need to set the `transport.create` option and add a toolbar command. The toolbar is used to make changes or perform actions on the entire grid, as opposed to individual records. The built-in toolbar commands include create, cancel, save, excel, and pdf. Adding one of these values to the toolbar array will add a button to the header of your grid. You can customize the look of these commands by changing the icon class and text of the button or you can create custom toolbar commands by specifying a template for the command. The toolbar command we will be using is the `create` command.

Kendo UI Grid

 

```js
 
vardataSource = newkendo.data.DataSource({
 
  transport: {
 
    ...
 
    create: {
 
 
      dataType: 'json'
 
    }
 
  },
 
  ...
 
});
 
 
$('#grid').kendoGrid({
 
  ..
 
  toolbar: ['create']
 
});
 
```

 

Conclusion 

In summary, you have seen how to configure the grid to perform all CRUD operations using a remote data source. This involves setting the data source’s `transport` option, defining the fields in the schema, and adding the command to the columns or toolbar parameter.

The `DataSource` component plays an important role in building grids. There are other ways you can enhance the grid’s behavior using the `DataSource,` such as adding filtering, sorting, and performing aggregate calculations on the data. For example, if you are using a data grid to display a list of orders, you can add an aggregate function to find the average order price. These features can be used in any component that uses a data source.

Try Out the Grid for Yourself

Want to start taking advantage of the Kendo UI jQuery Grid, or any of the other 70+ ready-made Kendo UI components, like the Charts or Scheduler? You can begin a free trial of Kendo UI today and start developing your apps faster.

Start My Kendo UI Trial

Angular, React, and Vue Versions

Looking for UI components to support specific frameworks? Check out the Grid in Kendo UI for Angular, the Grid in Kendo UI for React, or the Grid in Kendo UI for Vue.

Resources

Top 5 Benefits a Complete Reporting Tool Gives You Immediately

$
0
0

Visualizations have been helping people understand data for centuries. Clear and accurate reporting plays a pivotal role in any business decision today.

Data visualization is a general term that describes any effort to help people understand the significance of data by placing it in a visual context. Patterns, trends and correlations that might go undetected in text-based data can be exposed and recognized easier with data visualization tools.

Data visualization originates in ancient times. In 1644, Michael Florent van Langren, a Flemmish astronomer, is believed to have provided the first visual representation of statistical data. It was a one dimensional line graph that shows the twelve known estimates at the time of the difference in longitude between Toledo and Rome, as well as the name of each astronomer who provided the estimate. What is notable here is that while Van Langren could have provided this information in a table, it is the use of the graph that really visually displays the wide variations in estimates.

Michael Florent van Langren Visualization

Then, in the 18th century we observe the beginning of thematic mapping. This period also gave us William Playfair, widely considered the inventor of many of the most popular graphs we use today (line, bar, circle and pie charts). Many statistical chart types, including histograms, time series plots, contour plots, scatterplots and others were invented during this period. 

Beginning in the 19th century and continuing today, we continue to see dramatic and interesting developments in data visualization. From one and two-dimensional maps and charts to multidimensional presentations of big amounts of data. It is a tremendous development strongly supported by advancements in technology.

Today's data visualization tools go beyond the standard charts and graphs used in Microsoft Excel spreadsheets. They can display data in more sophisticated ways such as infographics, dials and gauges, geographical maps, heat maps, and detailed bar, pie and other charts.

We are now living in a Golden Era of data visualization. We can proudly say that behind any smart business decision lies a significant amount of data visualized in the best possible way. A complete set of reporting tools can be critical for a well-designed and optimized data visualization.

There are many automated reporting tools on the market with a variety of features and functionalities, and it can feel hard to navigate them all and choose the best option. But if we are thinking about the top benefits of a complete reporting tool for best data visualization, we can end up with 5 simple Ps.  Let’s dig into each of them.

Presentation

A complete reporting tool has an easily accessible and intuitive report designer that requires minimal training to use. The designer typically provides numerous styling capabilities, such as conditional formatting, CSS-like styling and countless wizards to help users create complex report layouts, style reports, manipulate data and build visually appealing presentations. By using data-bound items like maps, charts, crosstabs and sub reports, users are able to present interactive report decks and other elements (dashboards, reports by region, invoices, inventory reports, barcode reports and much more). Then the reports can be seamlessly embedded, viewed, and exported in any kind of format.

Reporting Presentation

Productivity

When a user relies on a reporting tool, they have to be able easily and quickly embed reporting functionality into existing line-of-business desktop or web applications without significantly restructuring or modifying anything. The tool should not require provisioning additional hardware and should make it easy for in-house developers, already familiar with the application, to add the reporting functionality. A complete reporting tool can speed up the production of reports by more than 40%.

Performance

Generating large and complex reports that contain rich graphics can be resource intensive. It is crucial to have a highly-optimized report engine that can build the report on the server with minimal memory and processor usage. The report engine in a complete reporting tool is easily configured with secure access to line-of-business data and has options for publishing, exporting and sharing the reports.

Progress

Management expects reports that crystallize business results and trends and which allow them to understand the underlying causes and circumstances. This often requires carefully formatted and highly stylized reports that present rich graphics with dashboard-like displays, and which support interactive features such as filtering, sorting and drill-through actions to supporting data in linked reports. Well-presented and appealing data visualizations created with a reporting tool can be a solid pillar for stable business progress.

Price

Empowering business users to create and analyze ad hoc reports with a complete reporting tool will secure cost-effective licensing and will save development time and money.

Presentation-Productivity-Performance-Progress-Price—these are the main pillars of a complete reporting solution that are a must for any business.

Telerik Reporting is a mature and robust reporting solution that is flexible and performant, offering an economical per-developer based licensing with no end-user costs. Your in-house developers can quickly integrate reports in responsive HTML5, Angular and .NET web apps (ASP.NET, MVC, Core), Azure and WPF/WinForms desktop apps. It offers a complete feature set for report creation, styling and interactivity. You can export the reports in more than 15 formats, including Word, Excel, PDF, PPT, image, CSV and more. And the powerful yet intuitive desktop and Visual Studio integrated designers ensure “pixel-perfect” printing and rendering.

With Progress Telerik Reporting you get sophisticated features like conditional formatting, report books with table of contents, custom interactivity actions, PDF security, events in all viewers, great report rendering, private fonts, continuous form paper printing and more. Plus, the featured HTML5 Report Viewer is both fully responsive and accessibility compliant.

Telerik Reporting provides design-time, data source components to help you codelessly bind report items to several data sources simultaneously. This includes Microsoft SQL Server Analysis Services cubes, ADO.NET data sources, relational databases, business objects, ORMs and XML. Programmatic data binding (at run-time) is also supported.

Try it Out and Share Feedback

We want to know what you think—you can download a free trial of Telerik Reporting today and share your thoughts in our Feedback Portal, or right in the comments below.

Start your trial today: Try Telerik Reporting

Tried Telerik DevCraft?

You can get Reporting as a single product or as a part of Telerik DevCraft. Make sure you've downloaded a free trial or learn more about DevCraft bundles. DevCraft gives you access to all our toolsets, allowing you to say "no" to ugly apps for desktop, web, or mobile.

Where’s Progress? Fall Lineup of .NET & JavaScript Conferences & Events

$
0
0

Join us as we travel to conferences around the world to talk .NET, JavaScript and more. Come talk to us about your app development needs and grab some swag and prizes.

While I’m never ready to say good bye to summer (and technically, I don’t have to until September 23 this year), I always look forward to the fall conference season. And this one is shaping up to be busy. We’ll have developer advocates, engineers, and product team members at events in on three continents this fall.

I’ve pulled together a shortlist of places you can find us. At any of these events, you should find someone who is ready, willing and able to talk to you about our .NET (Telerik) and JavaScript (Kendo UI) components, reporting, productivity and testing tools and more.

So pack your bags, grab your pumpkin spice latte (or don’t) and join us at any of these fine events!

.NET Conf
September 12-14 | Online
You might be wondering how you can join us at an online event, right? Well, this year there is a virtual attendee party after the first full day. You can join via Twitch and Twitter to engage with sponsors, other attendees, your hosts – Jeff Fritz and Richard Campbell – and win lots of cool prizes. What’s more, our very own Atanas Popatanasov is delivering a session on day two (or three, depending on your time zone) entitled “Enhancing WPF/WinForms applications with UWP Features.” Also – keep your eyes out for information about watch parties around the world – you might find us there as well!

NDC Sydney
September 17 – 21 | Sydney, Australia
Technically, this would be a spring event in Australia. Join our very own John Bristowe at the event. He’ll be at our booth ready to talk all things .NET and JavaScript. He’ll be able to show what was released in R3 2018 (which will be hot off the presses) and have swag and prizes.

Vue.js London
September 20 – 21 | London, England
In addition to being a gold Sponsor, Progress developer advocate and founder of the Vue Vixens, Jen Looper, will be speaking and leading a workshop. Stop by the booth to learn more about our Kendo UI components for Vue. And as always, grab some swag and enter to win some prizes.  

BASTA! Fall
September 25 – 28 | Mainz, Germany
One of the largest conferences in Germany for .NET, Windows and open innovation, you’ll find Progress at BASTA! Fall in Mainz. Not only are we a gold sponsor, but our Sam Basu is delivering a keynote entitled “State of Mobile Development for .NET Developers” and a session (“Essential Tools for Xamarin Developers”). Make sure to listen to Sam’s talks and stop by our booth for a demo of our latest .NET and JavaScript tools. You probably know this already (and may even be tired of reading it, if you’ve gotten this far), but guess what? We’ll have swag and prizes to give away!

Techorama
October 1 – 3 | Pathe Edes, The Netherlands
This is our first time at Techorama and we can’t wait to get to the Netherlands! We’ll have a booth, swag and prizes so definitely stop by. We will have folks there to show you a demo of the new release features and components and to talk to you about your .NET and JavaScript development needs.

TechBash
October 2 – 5 | Poconos, PA
Held at the Kalahari Resort and indoor waterpark in Pocono Manor, PA, we plan to make a splash (see what I did there?) as a gold sponsor. Not only will we have a booth set up where you can see awesome demos of and descriptions of what’s new in R3 2018 (and of course, get your hands on some swag and prizes), but Sam Basu is presenting two sessions: What can Visual Studio do for Mobile Developers? and Xamarin.Forms Takes You Places! Don’t miss them!

ConnectTech
October 17-19 | Atlanta, GA
Atlanta is beautiful in October. For real. Fall in the southern US brings beautiful weather. So it’s only fitting that a conference dedicated to frontend design and development would be held there. At our booth, you will find folks chomping at the bit to talk to you about Kendo UI & NativeScript (and yes – they will have swag and prizes). We also have several Progress folks delivering sessions, including: Jen Looper (Human vs AI: Build a Mobile App with Vue.js, ML Kit, and NativeScript), Tara Manicsic (Modern Angular Patterns and How to Learn Angular) and Brian Rinaldi (Strategies for Offline Data in Web Apps). Jen and Tara are also delivering Vue Vixens workshops.

Angular Connect 
November 6-7 | London, England
Touted as Europe’s largest Angular conference, Progress is a platinum sponsor of the event. Come by our booth to chat with our team about Kendo UI and NativeScript. In addition to great conversation, we’ll also have swag and giveaways.

DevReach
November 13-14 | Sofia, Bulgaria
In its 10th year, DevReach is central and eastern Europe’s premier developer conference. Produced by Progress, this year’s lineup of international speakers is second to none, including our own Georgi Atanasov, Ed Charbenau, Alex Gyoshev, Svetlin Nikolaev, Atanas Popatanasov, Richard Zaslaw and others. If you are at the event, you will be able to chat with folks from the Telerik, Kendo UI and NativeScript teams about web, mobile, desktop and chatbot development. Swag and prizes will be given out!

js.talks();
November 17 | Sofia, Bulgaria
jsTalks Bulgaria is a community event hosted at the Sofia Event Center. In its fourth year, the event is all things JavaScript. Come by and talk to our product, engineering, and corporate teams. Learn more about our Javascript tools, learn about open positions at Progress in Bulgaria, and get your hands on some swag and cool prizes.

VSLive Orlando
December 2-7 | Orlando, FL
We’re a big fan of the VSLive events and are excited to close out the year as a silver sponsor at their Orlando event. Stop by the booth for demos, info, swag and prizes. But also make sure you check out Sam Basu’s sessions – Essential Tools for Xamarin Developers! and Xamarin.Forms Takes You Places!

DEVintersction
December 3 – 6 | Las Vegas, NV
Well, Las Vegas in December will be a lot cooler than it was when we were there in July for Inspire. And DEVintersection is a great show to end our fall season and the calendar year. As a silver sponsor, we’ll have a booth, giveaways, prizes, and fun. We’ll have engineers and product team members on hand to answer your technical questions and show you a demo. But even better, Todd Anglin, our VP of Product, is delivering two sessions– “Making CSS Fun with SAAS” and “PWA All the Things” – and a workshop entitled “Conquering Mobile with JavaScript: PWAs and NativeScript.” Hope to see you all there!

As I mentioned before, this is just a shortlist. You will likely see us speaking, attending or having a smaller presence at other events between now and the end of the year. As always, if you are going to a different show and want to see us there, comment below. We look forward to any opportunity we can get to connect with you in person!

Meet the Vue Vixens

$
0
0

Jen Looper and Diana Rodriguez join us on the Eat Sleep Code podcast to talk about how they built up the successful developer community, Vue Vixens.

On this episode of Eat Sleep Code, Jen Looper and Diana Rodriguez discuss Vue Vixens, an organization of people who identify as women and who want to learn Vue.js to make websites and mobile apps. Jen and Diana share their story of creating and building a successful developer community and growing Vue Vixens into a worldwide organization.

You can listen to the entire show and catch past episodes on SoundCloud. Or just click below.

Jen Looper

looperj_portrait

Jen Looper is a Google Developer Expert and a Senior Developer Advocate at Progress with over 15 years of experience as a web and mobile developer. Based in Boston, Jen specializes in creating cross-platform mobile apps. She's a multilingual multiculturalist with a passion for hardware hacking, mobile apps, machine learning and discovering new things every day. Jen is a mom of two college-aged girls and loves helping women achieve their full potential. www.jenlooper.com/

Diana Rodriguez

diana

Diana Rodriguez is a Full Stack Developer & DevOps based in Buenos Aires. With over 15 years of experience and a strong background in backend and infrastructure, Diana likes to bring together the best of both worlds. She's a regular participant of local meetups such as Vuenos Aires, WorkshopJS, etc and has mentored in JavaScript101 and Nardoz. With some upcoming speaking opportunities in some international events, she's super enthusiastic about everything to encourage people to start a career in development and a fan of female devs and devops. In her spare time she likes to play videogames and taekwondo.

Show Notes

Viewing all 5210 articles
Browse latest View live