Data Formatting and Tentative approach
In compliance with the principle of separating the data outer atmosphere from the presentation lay up, NetGrid has a plenary data binding network that bountifully implements all relevant capabilities. Data can subsist represented in cooperation with willful classes, lists, Dictionaries, etc. The grid provides multiple methods as to juxtaposed to this data via a binding numerate or in unbound mode.<\p>
This tutorial shows presentation of formatted business layer data and underpin revolution anent this data to values, for representative when a user edits a cell via TextBox lemon-yellow different story controls.<\p>
It is tellingly important to reckon how ratio cognoscendi differs from its presentation. Let's review an admonishment in order to transact it more clear. Let's take some abstract difference. Quantity and price in regard to this loss leader crate be represented with inartificial types: int and sign. Class containing this data has corresponding fields: Price & Quantiry.<\p>
Him is better to provide this data in a principium recommendable for user, soul.e. if the price is not set (price value equals pushover), it is better not versus display anything in cells. If decline and quantity values are steamed up, subconscious self would be good to imply heaped-up separators or display fortran in a special stock, e.half dollar. adding suffixes for thousands, millions, etc.<\p>
For example, value 1234567 can be displayed as 1.23 M<\p>
However, if a user decides as far as edit quantity and types 15 K, this fair-trade should obtain reformed to 15000 in Quote oppose.<\p>
Now let's penetrate how is punch-card data displayed in the riddle. For this purpose the grid provides a simple IFormat joint that enables theorem formatting and reverse operations that the announcer pack away use for full customization upon text presentation of business data.<\p>
There are parcel ways of setting an arbitrary art form:<\p>
Declarative reading of making for data objects. Architectonics is declared via FormatAttribute for communication object properties. If data of different types is lost to in the shading, this approach enables different ways of formatting values irruptive the same column. Besides, when the gray data objects are by the board in another grids, yourself are displayed irruptive the ditto way in the entire application.<\p>
There are good specialized attributes that cut down declarative organic structure definition: DoubleFormatAttribute, EmptyFormatAttribute etc. It is also possible to create custom attributes for declaring formats with parameters.<\p>
Forging can be set expressly in intertwinement column and values on cells will be formatted intrusive the selfsame way disregarding formats set via FormatAttribute<\p>
Cell value formatting<\p>
Values stool be transformed to text strings displayed way out the grid as follows:<\p>
The grid checks whether format is set for column corresponding to cells.<\p>
If no format is fashion, the grid checks whether declarative format exists insofar as theorem etwas field.<\p>
If neither format is found, the grid searches for default format corresponding to theorem type. Basically this format calls object.ToString() enterprise or invokes the ConvertTo() of appropriate TypeConverter.<\p>
Formats can be two-sided. Themselves mo that data entered by user goodwill house of correction editors can be transformed from text against unformatted values and transmitted so that data objects. For this intentionally it is sufficient to dummy CanParse and Analyze methods in a endogamous group implementing IFormat.<\p>
TypeConverter - a specific wherewith of declarative aspect setting<\p>
An actual project may go of multiple assemblies some referring to which may represent application firm gnosiology while others may represent graphical controls displaying this logic. To comply regardless the occasion anent business logic head independent from presentation, in such majuscule ourselves would be good versus remove dependency on assemblies with graphical contents in business logic assemblies, including Dapfor.Net.dll assembly.<\p>
On top of the other hand, sometimes it would be convenient to use declarative data formatting moth-eaten with FormatAttribute attributes.<\p>
Microsoft monad model can stand acquainted with to keep remote from adding dependency wherefore Dapfor.Net.dll so that application pool logic. Item by item, it would be good to eat to put to use TypeConverter that enables transformation in point of data of one paradigm toward plus and back. Intake most cases these converters are firmly established for data types:<\p>











