THE EXPERT’S VOICE® IN .NET Pro Telerik ASP.NET and Silverlight Controls Master Telerik Controls for Advanced ASP.NET and Silverlight Projects Go beyond traditional ASP.NET and Silverlight controls José Rolando Guay Paz Foreword by Joe Stagner Microsoft Pro Telerik ASP.NET and Silverlight Controls Master Telerik Controls for Advanced ASP.NET and Silverlight Projects ■ ■ ■ José Rolando Guay Paz Pro Telerik ASP.NET and Silverlight Controls: Master Telerik Controls for Advanced ASP.NET and Silverlight Projects Copyright © 2010 by José Rolando Guay Paz All rights reserved. No part of this work may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, recording, or by any information storage or retrieval system, without the prior written permission of the copyright owner and the publisher. ISBN-13 (pbk): 978-1-4302-2940-7 ISBN-13 (electronic): 978-1-4302-2941-4 Printed and bound in the United States of America 9 8 7 6 5 4 3 2 1 Trademarked names, logos, and images may appear in this book. Rather than use a trademark symbol with every occurrence of a trademarked name, logo, or image we use the names, logos, and images only in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the trademark. The use in this publication of trade names, trademarks, service marks, and similar terms, even if they are not identified as such, is not to be taken as an expression of opinion as to whether or not they are subject to proprietary rights. President and Publisher: Paul Manning Lead Editor: Mark Beckner Developmental Editor: Ewan Buckingham Technical Reviewer: Kevin Babcock Editorial Board: Clay Andres, Steve Anglin, Mark Beckner, Ewan Buckingham, Gary Cornell, Jonathan Gennick, Jonathan Hassell, Michelle Lowman, Matthew Moodie, Duncan Parkes, Jeffrey Pepper, Frank Pohlmann, Douglas Pundick, Ben Renow-Clarke, Dominic Shakeshaft, Matt Wade, Tom Welsh Coordinating Editor: Kelly Moritz Copy Editor: Heather Lang Compositor: Lynn L’Heureux Indexer: Brenda Miller Artist: April Milne Cover Designer: Anna Ishchenko Distributed to the book trade worldwide by Springer Science+Business Media, LLC., 233 Spring Street, 6th Floor, New York, NY 10013. Phone 1-800-SPRINGER, fax (201) 348-4505, e-mail [email protected], or visit www.springeronline.com. For information on translations, please e-mail [email protected], or visit www.apress.com. Apress and friends of ED books may be purchased in bulk for academic, corporate, or promotional use. eBook versions and licenses are also available for most titles. For more information, reference our Special Bulk Sales–eBook Licensing web page at www.apress.com/info/bulksales. The information in this book is distributed on an “as is” basis, without warranty. Although every precaution has been taken in the preparation of this work, neither the author(s) nor Apress shall have any liability to any person or entity with respect to any loss or damage caused or alleged to be caused directly or indirectly by the information contained in this work. The source code for this book is available to readers at www.apress.com. You will need to answer questions pertaining to this book in order to successfully download the code. To God for all the blessings I’ve received. Thank you Lord. To my beautiful wife Karina, my wonderful daughter Sara Nicole and our new baby coming soon. Thank you for being with me all the way with this project. I can’t thank you enough. I love you. I promise I’ll make up the time I stole from you. To my mother, Nelly, and father, Rolando, for teaching me all I needed. Dad, I know you are not with us anymore but this book is especially for you. I know you would’ve loved to see it. Thank you both for everything. I love you and miss you. To my sister Loly, my brothers Juan and Ramon, my nephews and nieces. I love you and miss you all. Thank you to my family in law for all your support and encouragement through all these years. Thank you. Special thanks to Aunt Maritza and to Uncle Marco. This never would have happened without them. Contents at a Glance ■Foreword...........................................................................................................................xviii ■About the Author.................................................................................................................xix ■About the Technical Reviewer.............................................................................................xx ■Acknowledgements............................................................................................................xxi ■Introduction........................................................................................................................xxii ■Chapter 1: Introducing ASP.NET and Telerik........................................................................1 ■Chapter 2: Getting Started With Telerik RadControls.........................................................15 ■Chapter 3: Input RadControls..............................................................................................33 ■Chapter 4: Navigation RadControls.....................................................................................61 ■Chapter 5: Date, Time, and Scheduling RadControls........................................................97 ■Chapter 6: Data RadControls, Part 1.................................................................................131 ■Chapter 7: Data RadControls, Part 2.................................................................................229 ■Chapter 8: Layout RadControls..........................................................................................281 ■Chapter 9: Chart and Image RadControls.........................................................................329 ■Chapter 10: Additional RadControls..................................................................................381 ■Chapter 11: RadAjax..........................................................................................................421 ■Chapter 12: Telerik Extensions for ASP.NET MVC.............................................................499 ■Chapter 13: RadControls for Silverlight............................................................................531 ■Chapter 14: Introducing Telerik Reporting.......................................................................585 ■Chapter 15: Telerik OpenAccess ORM...............................................................................621 ■Index...................................................................................................................................661 v Contents ■Foreword...........................................................................................................................xviii ■About the Author.................................................................................................................xix ■About the Technical Reviewer.............................................................................................xx ■Acknowledgements............................................................................................................xxi ■Introduction........................................................................................................................xxii ■Chapter 1: Introducing ASP.NET and Telerik........................................................................1 ASP.NET...................................................................................................................................1 ASP.NET Web Forms..........................................................................................................2 ASP.NET MVC....................................................................................................................8 Telerik’s RadControls Suite of Components......................................................................13 Summary...............................................................................................................................14 ■Chapter 2: Getting Started With Telerik RadControls.........................................................15 Installing the Controls and Tools.............................................................................................15 Downloading the Installers...............................................................................................16 Installing the Suites.........................................................................................................18 Installing Telerik Extensions for ASP.NET MVC.................................................................20 Installing and Updating Controls Manually........................................................................21 Setting Up Your Application to Use Telerik RadControls...........................................................22 Configuring Telerik RadCompression......................................................................................27 Configuring Telerik RadUpload...............................................................................................28 Enabling RadScriptManager and RadStyleSheetManager........................................................30 Summary...............................................................................................................................31 ■Chapter 3: Input RadControls..............................................................................................33 Introducing RadInput..............................................................................................................33 Understanding Common Properties and Events................................................................33 Using RadTextBox............................................................................................................36 vii ■CONTENTS Getting and Setting RadTextBox Values............................................................................37 Working with Buttons.......................................................................................................38 Using RadNumericTextBox...............................................................................................39 Setting Minimum and Maximum Values...........................................................................39 Setting the Type of Numeric Values..................................................................................40 Using RadDateInput.........................................................................................................40 Formatting Dates.............................................................................................................41 Validating Dates...............................................................................................................43 Parsing Dates..................................................................................................................44 Using RadMaskedTextBox................................................................................................45 Setting the RadMaskedTextBox Mask..............................................................................45 Using RadInputManager...................................................................................................48 Introducing RadEditor.............................................................................................................49 Creating a Custom FileBrowser........................................................................................52 Customizing the Appearance and Tools............................................................................52 Localizing RadEditor........................................................................................................55 Checking Spelling............................................................................................................57 Creating Your Own Dictionary..........................................................................................58 Using System Modules.....................................................................................................58 Creating Your Own Module..............................................................................................59 Summary...............................................................................................................................60 ■Chapter 4: Navigation RadControls......................................................................................61 Using RadMenu and RadToolBar.............................................................................................61 Binding RadMenu to a Datasource...................................................................................64 Showing Items in Multiple Columns.................................................................................66 Navigating with RadMenu................................................................................................66 Using RadMenu Templates..............................................................................................69 Setting RadMenuItem Custom Attributes..........................................................................70 Creating a Two-State RadToolBarButton..........................................................................72 Using RadTreeView................................................................................................................73 Performing Simple Navigation..........................................................................................73 Implementing Drag-and-Drop Functionality......................................................................74 Supporting Check Boxes..................................................................................................78 Loading Nodes on Demand..............................................................................................80 Modifying Node Text........................................................................................................81 Using Node Templates.....................................................................................................84 viii
Description: