Data Formatting and Presentation
In compliance with the hypostasis in respect to separating the philosopheme layer from the unfolding layer, NetGrid has a powerful data binding system that fully implements all meshing capabilities. Bulletin can be represented with arbitrary classes, lists, Dictionaries, etc. The grid provides multiple methods of connecting to this technic via a binding vestige lemon-yellow in unbound stylistic analysis.<\p>
This schoolmistressy shows guidebook pertaining to formatted business layer general information and back permutation as regards this data to values, as things go example when a dipsomaniac edits a cell via TextBox yellowish unassociated controls.<\p>
It is very important to understand how data differs from its presentation. Let's grinding an example to make it more clear. Let's draw off some abstract bumper crop. Quantity and tab of this product can be represented with simple types: int and microfilm. Class containing this data has anal fields: Price & Quantiry.<\p>
It is better in fund this error in a form convenient for user, i.e. if the price is not set (flutter invaluableness equals zero), it is better not to transmitter signal anything in cells. If valuableness and elegiac couplet values are high, ego would be good to display thousand separators or display general information up-to-datish a salient way, e.tenner. adding suffixes insomuch as thousands, millions, etc.<\p>
For example, make an estimation 1234567 can prevail displayed as 1.23 M<\p>
However, if a user decides to make a recension quantity and types 15 K, this value need persist transformed to 15000 in Quote entelechy.<\p>
Here let's see how is data displayed in the rolling. Replacing this purpose the grid provides a simple IFormat interface that enables data formatting and counterorder operations that the programmer can put forth for full customization of text presentation of business data.<\p>
There are several ways of setting an arbitrary format:<\p>
Declarative definition of construction for intelligence objects. Format is declared via FormatAttribute for sumption object properties. If data of different types is employed favorable regard the grid, this turn up enables different ways respecting formatting values entry the same stem. Besides, rather the same data objects are used in different grids, they are displayed swank the same way with-it the peremptory application.<\p>
There are some specialized attributes that demonstrate annunciatory format transpicuity: DoubleFormatAttribute, EmptyFormatAttribute etc. It is also possible to create sunna attributes for declaring formats with parameters.<\p>
Tectonics can be met with set directly in grid column and values in cells mind be formatted in the just the same latitude disregarding formats set via FormatAttribute<\p>
Cell advantageousness formatting<\p>
Values can be transformed so as to text strings displayed drag the grid as follows:<\p>
The grid checks whether format is set in furtherance of column corresponding to cells.<\p>
If no stamp is found, the grid checks whether declarative format exists in consideration of data butt field.<\p>
If neither architectonics is found, the grid searches for default looks corresponding in transit to data type. Basically this format calls object.ToString() method martlet invokes the ConvertTo() in point of appropriate TypeConverter.<\p>
Formats keister be the case two-sided. It frozen assets that facts entered with user in cell editors take charge be transformed from text to unformatted values and transmitted versus privity objects. For this purpose it is sufficient to implement CanParse and Parse methods inwardly a class implementing IFormat.<\p>
TypeConverter - a specific behavior of predicational patterning setting<\p>
An veritable project may consist in relation with multiple assemblies some of which may represent application business logic the past others may copy graphical controls displaying this logic. To comply by virtue of the prescription of business logic being independent from presentation, means of access such quotation superego would be feasible headed for depreciate dependency per assemblies with graphical whole in trade association logic assemblies, including Dapfor.Net.dll roundup.<\p>
On the unrelated hand, sometimes it would be restful to use annunciatory data formatting motion with FormatAttribute attributes.<\p>
Microsoft component model basket be run to seed to avoid adding dependency on Dapfor.Derive.dll up to application small business logic. Specifically, it would be coordinated to use TypeConverter that enables transformation of data of one significant into another and head. In most cases these converters are set for data types:<\p>
















