← Back to all blogs

Featured Posts

Posts in 'dotnet'

Custom WYSIWYG Printing of C1Schedule

C1Schedule includes a printing feature which enables users to get quick printouts of appointments based upon a selected print style and print range. This default printing and previewing uses C1PrintDocument and C1PrintPreviewDialog via reflection, and it uses scripts to design each printing style. The printout styles are designed to be printer-friendly, that is, they are more basic looking than the C1Schedule on the form, i.e. they lack color, and if your schedules are fairly busy, the printouts don't show long or overlapping appointments exactly the same as they appear on screen. The default printing is designed to be very basic and is limited by what scripting is possible in the xml documents.

Using C1Chart with MVVM

C1Chart for WPF can be used with the MVVM design pattern. The concept applied is the same as you would use for other data-aware controls. The ViewModel should expose the collection and binding properties and all these can easily be set in XAML of the Chart view. In this article I will walk you through the basic steps to bind the chart in MVVM pattern.

Recap: CodeMash 2.0.1.1 Influencer Summit

On Jan 11, just prior to CodeMash, a gathering of regional community influencers was held.  This summit featured a panel of four prominent influencers from different language interests, with Jeff Blankenburg moderating.  The bios below greatly shortchange the panelists’ accomplishments

Drag Excel Files on C1FlexGrid

When loading Excel files in Windows applications, the most commonly used option is to use Streams to read/write the files. Another easier method would be dragging the excel file directly from the explorer onto the grid.

MVVM Commanding in Silverlight with C1Toolbar

ComponentOne Studio for Silverlight includes more than just the 50 or so UI controls you see in your toolbox. It also includes many little useful components which help bridge the narrow gap between Silverlight and WPF. Among these extra helpers is a set of commanding classes similar to WPF. C1Command allows you to write commands that not only work in-line with MVVM but are designed to enhance ComponentOne menus and toolbars. In this article I delve a bit into MVVM design patterns for commanding in Silverlight and show how using C1Command with C1Toolbar makes life simple.

C1TrueDbGrid Binding to BindingList Implementing INotifyPropertyChanged Interface

The most commonly used data binding in C1TrueDbGrid is binding the grid to the List<> collection. And the most commonly faced problem in C1TrueDbGrid is that the updations to the collection at runtime are not shown on the grid.

C1TrueDbGrid Binding to BindingList Implementing INotifyPropertyChanged Interface

The most commonly used data binding in C1TrueDbGrid is binding the grid to the List<> collection. And the most commonly faced problem in C1TrueDbGrid is that the updations to the collection at runtime are not shown on the grid.

Building multiple column displays in MVC

Looping through a list of objects to display a table of the items is easy in MVC. All you need to do is: 1: <table>

Are you #NotAtCodeMash? Get the swag anyway!

Are you #NotAtCodeMash, but still want the coolest swag?  Act quick and it’s yours!  The first 10 people to follow ComponentOne (so we can DM the winners) and tweet “Less code, more business logic with @ComponentOne http://c1.ms/fAvE3N Please RT” will be sent a swag pack with the same goodies you’d get if you visited our booth.  We have limited supplies at CodeMash, so you may score some loot not everyone gets.  BTW—readers of my blog got this announcement one hour before I tweeted about it.

Solving the “A potentially dangerous Request.Form value was detected….” in ASP.NET MVC

Oftentimes an MVC application needs to POST text back that a user has entered into a text field or textarea. In a project I am working on I am using the TinyMCE WYSIWYG text editor to allow users to write articles. The editor allows for HTML tags such as , , , etc., and when submitting the form I have run across the infamous, “A potentially dangerous Request.Form value was detected” error. So, how do you get around this? You want the user to be able to use some HTML, but you need to secure your site as well from scripting attacks. Enter the [ValidateInput(false)] attribute. Adding this attribute to each of the ActionResults where you are expecting HTML tags to come in, will allow the Controller to continue with the action. This will work most of the time but is not exactly bulletproof for protecting your site. By doing a string.Replace() on the incoming content, and checking for suspicious and/or malicious code, you can secure your site a bit more. 1: [ValidateInput(false)]

Hello Wijmo

We have recognized the power of HTML, CSS and JavaScript and have

POSTing and GETting with jQuery and MVC

The jQuery library has an extensive set of AJAX functions which make it very easy to handle website functionality with all the Ajaxy goodness you’ve come to expect. However there are some gotcha’s when working with MVC and I thought I’d take some time to talk about them. The first thing to remember is to decorate your Actions with the appropriate Http verbs, either [HttpPost] or [HttpGet]. By default MVC 2 only allows [HttpPost] requests when requesting a Json response. Phil Haack has a great article on this at http://haacked.com/archive/2009/06/25/json-hijacking.aspx. In a project I am working on I want users to be able to add other users as friends, see if their friend is online, and if necessary, delete a friend. This jQuery function allows a user to add a friend: 1: function acceptFriend(friendId) {

Uploading photos with MVC

There are many articles online talking about MVC, but not many showing how to upload files. In a project I'm working on I need to have my users upload photographs and wanted them to be able to preview the photo before submitting it. Here's a screen shot of what I'm talking about. The application allows the user to select a photo, which is then previewed. The user can then add a caption and description of the photo. During this first round the Save button is bound to the following jQuery script: 1: function uploadMemberPhoto(elem) {