XGridMax

XGridMax Control
—————————————————————————————
—————————————————————————————


Namespace :
System72.Controls.WinUI
Control Class Name
: XGridMax

Language : C#

Version : 2.0

About
————————————-


XGridMax
is an extreme DataGrid control with custom properties and
methods which make life easier for the developer. It has all the
funcionality of a standard Datagrid plus a few others.
XGridMax is an industrial strength DataGrid with custom ColumnStyles
and functionality.

Download

You can download XGridMax source code and installer.
Properties
——————–

XFormat
– A property which mimics the AutoFormat of a standard grid but
can be set at both at Design Time and runtime.giving the user(or the
developer) the ability to change the Format dynamically. At Design time
this property is categorised to a custom category called “Format”. To
see this in action change the view in properties to categorised.

RowCount
– Returns the current number of rows in XGridMax(Especially useful when using the Freeze Panes Method).

XGridMaxTableStyle
– A property to set the TableStyle of XGridMax
ShowColumnOnMove – Determines whether to show the column data &
header while dragging a column.Can be set at both design time and
runtime.


ShowOnlyColumnHeaderOnMove
– Determines whether to show only the column
header while dragging a column.Can be set at both design time and
runtime.


DraggedColumnBorderColor
-The border color for the Dragged Column. This
is used to visually cue, which column is being dragged. Defaults to
Black.


FreezeBoundaryColor
– The line color for the Freeze Pane Boundary. Defaults to Red.
HighlightFreezePane -Determines whether a frozen pane is highlighted.

FreezePaneHighlightColor
– The highlight color for the frozen panes.
Set to 50% transparency. Defaults to the SelectionBackColor of the
XGridTableStyle.


Methods

——————–

BindToDataSource
– Binds XGridMax to a Datasource. Accepts only a dataset.
InitialiseXGridMaxTableStyle – Creates a new Table Style for XGridMax using the mapping name provided.

AutoFitColumns
– By calling this method it auto sizes the grid columns to fit the data(or header), whichever is larger.

XFormatTableStyle
-Formats the Table Style to one of predefined format styles specified by the XGridFormat enumeration.

MoveColumns
– A method for moving XGridMax columns (Programatically). A
TableStyle needs to be defined to access this functionality.

(* Now Moving columns from the GUI is also possible. Simply click
and hold the mouse down on a ‘From’ column and then drag/drop it on to
the ‘To’ Column.)


FreezePane
– Method to Freeze Pane Column or
Row(Programatically).Similar to the Excel FreezePanes command. (*
Panes can be frozen from the GUI. Right Click on a column header and
choose “Freeze Column”, or right click in a cell and choose “Freeze
Row”)

UnfreezePane
– Unfreezes the frozen pane programatically(column or row).
(* Similarily panes can be unfrozen by right clicking on a column header or row)


ColumnStyles

————————–


AddXGridTextColumns
-This method adds a Text Box column to the
tablestyle defined above.This method has a lot of fexlibility in
setting up the caption of the column different to the field name and
also we can set the column to show or hide

AddXGridBoolColumns
– Same as above but we can add a datagridboolcolumn
with the flexibility to set the truevalue and false value for the
column

AddXGridTextIconColumns
– This method adds & associates Icons to
specific columns. This method has all the flexibility of a
DataGridTextColumn but with Icons associated to the column data
AddXGridComboBoxColumns – This method makes the column into a Combo Box
and gets and sets the values of it based on the main dataset.


AddXGridDateColumns
– This method makes the Column to have a Drop down
calendar and has the ability to display and set the date through the
Date Picker control.


AddXGridOptionColumns
– This method enables adding a Column of Option
buttons. It also enables custom action to be associated with the click
event of a option button.


AddXGridURLColumns
– This method enables adding a column of URLs using the column data. Opens the hyperlink in I.E on click.


Method Signatures

——————————-


AddXGridTextColumns:

——————–

1 (string caption,string columnName)

2 (string caption,string columnName,HorizontalAlignment alignment)

3 (string caption,string columnName,HorizontalAlignment alignment,string nullText)

4 (string caption,string columnName,HorizontalAlignment alignment,string nullText,string DBTypeFormat)

5 (string caption,string columnName,HorizontalAlignment alignment,string nullText,string DBTypeFormat,bool isReadOnly)

6 (string caption,string columnName,string nullText)

7 (string caption,string columnName,string nullText,string DBTypeFormat)

8 (string caption,string columnName,string nullText,string DBTypeFormat,bool isReadOnly)

9 (string caption,string columnName,string DBTypeFormat,bool isReadOnly)

10 (string caption,string columnName,bool isVisible)

11 (string caption,string columnName,bool isReadOnly,bool isVisible)

12 (string caption,string columnName,HorizontalAlignment
alignment,string nullText,string DBTypeFormat,bool isReadOnly,bool
isVisible)


AddXGridBoolColumns:

——————–

1 (string caption, string columnName,object trueValue,object falseValue)

2 (string caption, string columnName,object trueValue,object falseValue,HorizontalAlignment alignment)
3 (string caption, string columnName,object trueValue,object falseValue,HorizontalAlignment alignment,bool isReadOnly)

4 (string caption, string columnName,object trueValue,object falseValue,string nullText,bool isReadOnly)

5 (string caption, string columnName,object trueValue,object
falseValue,HorizontalAlignment alignment,string nullText,bool
isReadOnly)

6 (string caption, string columnName,object trueValue,object falseValue,bool isVisible)

7 (string caption, string columnName,object trueValue,object
falseValue,bool isReadOnly,bool isVisible)
8 (string caption, string columnName,object trueValue,object
falseValue,HorizontalAlignment alignment,string nullText, bool
isReadOnly,bool isVisible)


AddXGridTextIconColumns:

————————

1 (string caption,string columnName,ImageList imageList,delegateGetImageIndexForRow imageDelegate)

2 (string caption,string columnName,ImageList imageList,delegateGetImageIndexForRow imageDelegate,HorizontalAlignment alignment)

3 (string caption,string columnName,ImageList
imageList,delegateGetImageIndexForRow imageDelegate,HorizontalAlignment
alignment,string nullText)

4 (string caption,string columnName,ImageList
imageList,delegateGetImageIndexForRow imageDelegate,HorizontalAlignment
alignment,string nullText,string DBTypeFormat)

5 (string caption,string columnName,ImageList
imageList,delegateGetImageIndexForRow imageDelegate,HorizontalAlignment
alignment,string nullText,string DBTypeFormat,bool isReadOnly)

6 (string caption,string columnName,ImageList imageList,delegateGetImageIndexForRow imageDelegate,string nullText)

7 (string caption,string columnName,ImageList
imageList,delegateGetImageIndexForRow imageDelegate,string
nullText,string DBTypeFormat)

8 (string caption,string columnName,ImageList
imageList,delegateGetImageIndexForRow imageDelegate,string
nullText,string DBTypeFormat,bool isReadOnly)

9 (string caption,string columnName,ImageList
imageList,delegateGetImageIndexForRow imageDelegate,string
DBTypeFormat,bool isReadOnly)

10 (string caption,string columnName,ImageList imageList,delegateGetImageIndexForRow imageDelegate,bool isVisible)

11 (string caption,string columnName,ImageList
imageList,delegateGetImageIndexForRow imageDelegate,bool
isReadOnly,bool isVisible)

12 (string caption,string columnName,ImageList
imageList,delegateGetImageIndexForRow imageDelegate,HorizontalAlignment
alignment,string nullText,string DBTypeFormat,bool isReadOnly,bool
isVisible)


AddXGridComboBoxColumns:

————————

1 (string caption,string columnName,string displayMember,string valueMember,DataView comboDataSource)

2 (string caption,string columnName,string displayMember,string valueMember,DataView comboDataSource,string nullText)

3 (string caption,string columnName,string displayMember,string
valueMember,DataView comboDataSource,string nullText,bool isReadOnly)

4 (string caption,string columnName,string displayMember,string valueMember,DataView comboDataSource,bool isVisible)

5 (string caption,string columnName,string displayMember,string
valueMember,DataView comboDataSource,string nullText,bool
isReadOnly,bool isVisible)


AddXGridDateColumns:

——————–

1 (string caption,string columnName,string dateFormat)

2 (string caption,string columnName,string dateFormat,string nullText)

3 (string caption,string columnName,string dateFormat,string nullText,bool isReadOnly)

4 (string caption,string columnName,string dateFormat,bool isVisible)

5 (string caption,string columnName,string dateFormat,string nullText,bool isReadOnly,bool isVisible)


AddXGridOptionColumns:

———————-

1 (string caption,string columnName,OptionClickEventHandler delegateOptionClick)

2 (string caption,string columnName,OptionClickEventHandler delegateOptionClick,bool alignToRight)
3 (string caption,string columnName,OptionClickEventHandler delegateOptionClick,string nullText)

4 (string caption,string columnName,OptionClickEventHandler delegateOptionClick,string nullText,bool alignToRight)


AddXGridURLColumns:

——————–

1 (string caption,string columnName)

2 (string caption,string columnName,bool isVisible)

3 (string caption,string columnName,string nullText)

4 (string caption,string columnName,HorizontalAlignment alignment,string nullText)

5 (string caption,string columnName,HorizontalAlignment alignment,string nullText,bool isVisible)


BindToDataSource:

—————-

1 (DataSet dataSource, string tableName)


InitialiseXGridMaxTableStyle:

——————————

1 (string mappingName)


AutoFitColumns:

——————

1 (none)


XFormatTableStyle:

——————-

1 (XGridFormat formatStyle)


MoveColumns:

————-

1 (int fromColumn, int toColumn)


FreezePane:

————-

1 (int index, PaneType paneType)


UnfreezePane:

————-

1 (PaneType paneType)


Comments

—————————-

All my methods are virtual so go ahead and change them if you feel they
don’t suit your requirements.Better still send in your feedback and I
will put it in the next release


Installation Notes

————————————————————

* Run the XGridMaxInstaller.msi in XGridMaxInstaller\Release folder

*I am assuming you have windows 2000 or higher as it will have the windows
installer by default to limit the size of the download I have removed
it from the install folder

* This installs the XGridMax DLL for your
use in the program files folder. Don’t worry, you can unistall this
anytime you like from the control panel.

* Open the XGridMaxUsage
Project where in I have written sample code on how to use the
properties and methods of XGridMax.

– How to get the XGridMax Control to the ToolBox for your own projects
Once XGridMax is installed?

* Open your project

* Right Click on the ToolBox and choose ‘Customise ToolBox …’ from the Context menu

* Click on the .NET Framework Components Tab

* Click the browse button and find the XGridMax.dll

* If you have chosen the defaults it will be in this path ‘C:\Program Files\Sai Panyam\XGridMax\XGridMax.dll’

*If you have installed it somewhere else point to this dll

* Then click on the OK button
*XGridMax will be in the toolbox

Then drag and drop the XGridMax from the toolbox like any other control Enjoy:)


– Requirements

* Microsoft .NET framework version 1.1.

* To compile VS.NET is recommended

* Northwind database on SQL SERVER

*Windows Installer for the installation of XGridMax


– Knows Issues

* If you open the XGridMaxUsage without installing the XGridMax
control, All the controls on the form disappear. Rectification: Don’t
panic!!! Close the solution. Run the XGridMaxInstaller.msi to install
the XGridMax and open the XGridMaxUsage Project again.

*Send me a feedback if you find any thing else, I will endeavour to fix them


History

———————————

2.0

First release in C#, much more cleaner code than the one in VB.NET and
also many new columnstyles and functionality like moving columns
programatically and also through the UI, ability to configure the look
and feel of the Date Control of the column etc. Freeze Panes
functionality like Excel. Rectified a lot of bugs from 1.0 in terms of
paint operations.

1.0
Version

1.0 was in VB.NET

Constraints

———————————

2.0

* Works only for a dataset

* The binding manager for the grid and the combo box should be
different.What this means is that you need separate sql statements for
the Grid and the combo box. You can have the same dataset but different
tables to connect to. The Foreign Key for the Combo column should be a
part of the Main grid’s sql statement.

* The Date Column will have the ‘Check Box’ on the Date Picker to enable setting a null value to the cell and also have the
ability to change a null value to a date.


Last Update

———————————-

26 October 2005

%d bloggers like this: