Sybase DataWindow .
NET
John Strano [Link]@[Link] Technology Evangelist Sybase, Inc.
Agenda
Overview of DataWindow .NET Windows Forms Demonstration Web Forms Demonstration Q&A Session
Introducing DataWindow .NET One component for data access and reporting Greatly reduces the amount of code you need to write in a .NET application Intuitive graphical user interface allows developers to be productive immediately Patented technology backed up by award-winning customer support Supports Microsoft Windows forms, Web forms, and Microsoft Windows Mobile-based Tablet PC applications
DataWindow .NET
Award Nomination
What is DataWindow .NET? DataWindow .NET consists of:
A Component that plugs into your .NET development environment A DataWindow Designer that allows you to graphically create your data presentation layer A Database Administration Tool to access and graphically display database information Database drivers to access your RDBMS of choice
What is DataWindow .NET? At runtime DataWindow .NET consists of:
Data entry interfaces Reports Engine that tracks user modifications and dynamically generates INSERTs, UPDATEs and DELETEs
all from one tool.
Database Support
Introducing DataWindow .NET
Presentation Styles
Presentation Styles
Report Styles
Freeform Style DataWindow
Tabular Style DataWindow
Grid Style DataWindow
Graph Style DataWindow
Label Style DataWindow
N-Up Style DataWindow
Group Report Style DataWindow
Nested Report Style DataWindow
Composite Report Style DataWindow
Cross Tab Style DataWindow
Introducing DataWindow .NET
Additional Features
Drop Down DataWindows
Think of them as enhanced Combo Boxes
DataWindow Validation Rules
Validation rule files
DataWindow .NET
More Information
Over 1000 properties that can be accessed and manipulated at both design time and runtime Approximately 200 methods to access and control data and the DataWindow Lots of events for even greater control
ItemChanged, ItemError, SQLPreview, RowFocusChanged, etc.
DataWindow .NET
More Information
Edit Masks and formatting Computed Fields for client-side processing Supports SQL, stored procedures and external data sources Easy printing of DataWindows ( [Link]() ) Dynamic creation of DataWindows at runtime And much more!
Reduce Code
Example: Setting the Autosize Height on a Row
public void AutoSizeGrid() { // DataGrid should be bound to a DataTable for this part to // work. int numRows = ((DataTable)[Link]).[Link]; Graphics g = [Link]([Link]); StringFormat sf = new StringFormat([Link]); SizeF size; // Since DataGridRows[] is not exposed directly by the DataGrid // we use reflection to hack internally to it.. There is actually // a method get_DataGridRows that returns the collection of rows // that is what we are doing here, and casting it to a [Link] MethodInfo mi = [Link]().GetMethod("get_DataGridRows", [Link] | [Link] | [Link] | [Link] | [Link] | [Link]); [Link] dgra = ([Link])[Link](gridTasks,null); // Convert this to an ArrayList, little bit easier to deal with // that way, plus we can strip out the newrow row. ArrayList DataGridRows = new ArrayList(); foreach (object dgrr in dgra) { if ([Link]().EndsWith("DataGridRelationshipRow")==true) [Link](dgrr); } // Now loop through all the rows in the grid for (int i = 0; i < numRows; ++i) { // Here we are telling it that the column width is set to // 400.. so size will contain the Height it needs to be. size = [Link](gridTasks[i,1].ToString(),[Link],400,sf); int h = Convert.ToInt32([Link]); // Little extra cellpadding space h = h + 8; // Now we pick that row out of the DataGridRows[] Array // that we have and set its Height property to what we // think it should be. PropertyInfo pi = DataGridRows[i].GetType().GetProperty("Height"); [Link](DataGridRows[i],h,null); // I have read here that after you set the Height in this manner that you should // Call the DataGrid Invalidate() method, but I haven't seen any prob with not calling it.. } [Link](); }
DataGrid
DataWindow
Reduce Code
Example: Setting a Column Style to Checkbox
// code assumes you have a DataSet named myDataSet, a table named "EastCoastSales" and a DataGrid myDataGrid //STEP 1: Create a DataTable style object and set properties if required. DataGridTableStyle ts1 = new DataGridTableStyle(); //specify the table from dataset (required step) [Link] = "EastCoastSales"; // Set other properties (optional step) [Link] = [Link]; //STEP 2: Create a string column and add it to the tablestyle DataGridColumnStyle TextCol = new DataGridTextBoxColumn(); [Link] = "custName"; //from dataset table [Link] = "Customer Name"; [Link] = 250; [Link](TextCol); //STEP 3: Create an int column style and add it to the tablestyle //this requires setting the format for the column through its property descriptor PropertyDescriptorCollection pdc = [Link] [myDataSet, "EastCoastSales"].GetItemProperties(); //now created a formated column using the pdc DataGridDigitsTextBoxColumn csIDInt = new DataGridDigitsTextBoxColumn(pdc["CustID"], "i", true); [Link] = "CustID"; [Link] = "CustID"; [Link] = 100; [Link](csIDInt); //STEP 4: Add the checkbox DataGridColumnStyle boolCol = new DataGridBoolColumn(); [Link] = "Current"; [Link] = "Info Current"; //uncomment this line to get a two-state checkbox //((DataGridBoolColumn)boolCol).AllowNull = false; [Link] = 150; [Link](boolCol); //STEP 5: Add the tablestyle to your datagrid's tablestlye collection [Link](ts1);
DataGrid DataWindow
Reduce Code
Example: Adding a Combo Box
DataGrid
// Step 1. Derive a custom column style from DataGridTextBoxColumn // a) add a ComboBox member // b) track when the combobox has focus in Enter and Leave events // c) override Edit to allow the ComboBox to replace the TextBox // d) override Commit to save the changed data // Step 2 - Use the combo column style // Add 1 col with combo style DataGridComboBoxColumn ComboTextCol = new DataGridComboBoxColumn(); [Link] = "custCity"; [Link] = "Customer Address"; [Link] = 100; [Link](ComboTextCol); // Step 3 - Additional setup for Combo style // a) make the row height a little larger to handle minimum combo height [Link] = [Link] + 3; // b) Populate the combobox somehow. It is a normal combobox, so whatever... [Link](); [Link]("Chicago"); [Link]("Corvallis"); [Link]("Denver"); [Link]("Great Falls"); [Link]("Kansas City"); [Link]("Los Angeles"); [Link]("Raleigh"); [Link]("Washington"); // c) set the dropdown style of the combo... [Link] = [Link];
DataWindow
Note: For data from a database even more code would be required!
Demonstration One
Windows Forms
Demonstration Two
Web Forms
Whats Possible [Link]
Whats Possible [Link]
Whats Possible [Link]
Whats Possible [Link]
Whats Possible [Link]
Whats Possible [Link]
Whats Possible [Link]
Whats Possible [Link]
Whats Possible [Link]
Whats Possible [Link]
Demonstration Four
[Link] Planner
Session Summary
Provided an overview of DataWindow .NET features Demonstrated how DataWindow .NET can be used in .NET Windows Forms applications Demonstrated how DataWindow .NET can be used in [Link] applications
Roadmap for DataWindow .NET
DataWindow .NET 1.5
WebForms and ASP .NET Direct access to DataWindow object properties using the DataWindow .NET object model Ink Edit and Ink Picture Controls General availability April 8, 2005
DataWindow .NET 2.0
Support for .NET Datasets and DataTables Additional ADO .NET support Integrate DataWindow Designer into the Microsoft Visual Studio IDE Support for Microsoft .NET Framework 2.0 and ASP .NET 2.0 Release planned for late 2005
DataWindow .NET
Resources
Newsgroup:
[Link] [Link] [Link]
Blogs:
[Link]
Code Examples:
[Link]
Product Information and Evaluation Copy:
[Link]
Replay of MSDN live webcast:
[Link]
DataWindow .NET 1.5 Evaluation Download
[Link]
Questions and Answers
Q&A
[Link]@[Link]