Telerik blogs

Latest

  • Productivity Reporting

    Bind Your Telerik Reports to XML Data

    One of the cool things about Telerik Reporting is that you can bind it to just about any kind of data source. Regardless of whether your data is stored in a SQL Server database, an XML document, or a simple text file, if you can read it into one of the supported data source types then you can bind it to your report. Since XML is a often used to store data, I thought it might be helpful to demonstrate how to bind your report to the data in an XML file using LINQ to XML. To get started, create a class...
    May 27, 2021 5 min read
  • Productivity

    Saving a few lines of code. Part V - Raising events.

    As you read the title of this post you may ask yourself - Hmmm, raising an event... wasn't that achievable with 1-2 lines of code? How smaller could it get, 0 lines of code? And you're almost right, to raise an event is not such a big deal. Supposing you have an event of type EventHandler. public event EventHandler Clicked;     Typically you have a virtual protected method which raises the event: protected virtual void OnClicked(EventArgs e)   {       if (Clicked != null)           Clicked(this, e);   }    Pretty simple unless you want to be thread safe (well... almost thread safe), then you should add one additional line: protected virtual void OnClicked(EventArgs e)...
    May 27, 2021 2 min read
  • Productivity Document Processing

    Exporting data to Excel using the RadGridView for WinForms

         There usually comes a time for most developers when they need to use the data being displayed in an application, outside of that application.  There are obviously a number of ways you can present data, but it is common to leverage Microsoft Excel.  It provides a similar look and feel to the grid which means minimal reformatting, plus Excel is widely used and therefore most offices should have a version of the software available.       How to get your data into Excel?  The RadGridView offers a couple of options to accomplish this task.  First, you can use the Primary...
    May 27, 2021 3 min read
  • Productivity

    Saving a few lines of code. Part IV - Refactoring switch statements

    Before going into details about how you could refactor a switch statement first I should say that there's nothing wrong with this statement (as with any other C#, VB.NET or whatever statement). Most probably you would want to refactor a switch in one of these scenarios: It has reached a certain amount of lines of code so that you need to scroll in order to see all the cases. When you want to introduce some new functionality you inevitably end up adding new cases to the switch statement. When you implicitly check for a type in a switch statement. In most...
    May 27, 2021 4 min read
  • Productivity Testing

    Selenium Extensions for RadControls (ASP.NET AJAX)

    Although I ended my Selenium adventure a few months ago, there is a final topic I’d like to cover here. This one completes my set of posts concerning RadControls for ASP.NET AJAX test automation with Selenium. The tool, the Telerik ASP.NET QA team relied on during the past couple of years, helped us catch in time most of the bugs in RadControls that never came into production! A curios fact here is that Selenium 1.0 official release is finally coming soon after many years of development! Check out the recent post on Selenium blog announcing the exciting news. ...
    May 27, 2021 4 min read