InDepth: Column Layout – Part 1
Hi,
In the previous posts i’ve discussed how to do data binding using Intersoft Presenter. One thing that is set by default is that the columns is automatically generated from the given item type. In most cases, we don’t want all the columns in the item type to be displayed so how can we manage this ?
Intersoft Presenter has the capability to determine the view definitions through several properties. First of all you can defines the columns that you want to display, controls its behavior (AllowFilter, AllowGrouping, AllowSort), its display (Caption, Width), its action (SortMemberField, FilterMemberField), including states such as SortOrder and so on. Furthermore you can also control the FilterOptions which contains collection of option that can be used to filter the data, and you can also determine which options are checked and which options aren’t. Last but not least you can also control the group columns.
In this post I’ll cover three basic approach to define the column layout:
- Declaratively in the xaml.
- Programmatically.
- Change layout at runtime.
Defining column layout declaratively in the xaml
First of all you need to turn of the AutoGenerateColumn property (set the value of this property to “No”). Then you’ll need to define the columns manually as in the picture above.
To specify the initial order position you can do:
The default value is “None” which mean no SortOrder is applied.
Further more you can also customize the filter options that will be listed in the action box by declaring:
You’re free to create any set of Expression in each filter option, and then specify the meaningful name to its Filter Text. In this case i would like to filter the data base on certain range of value.
Furthermore you can also set which of the following options that will be applied initially and which aren’t by filling the SelectedFilterOptions property.
The SelectedFilterOptions should be filled with FilterOption that will be applied / checked which linked through FilterText. As for this case, the 0 – 50 options will be checked while the 51 – 100 option will not.
And as you can see from the screen shot, the Units in order column is also sorted descending.
Lastly you can also specify the grouped columns from:
This approach give you more freedom to set the initial display of you Presenter. There are also others property that i didn’t cover up in this post but all of them can configurable the same way.
I”ll discuss how to specify column definitions programmatically and how to change it at run time and what are the things to considered when changing the column definitions in the next post.
Regards
Andry
Here’s are the link to the sample code.






to run the specific samples in this post, change the following code in app.cs
private void Application_Startup(object sender, StartupEventArgs e)
{
// Column Layout
this.RootVisual = new InDepth_ColumnLayout();
// this.RootVisual = new InDepth_ColumnLayout_Programmatically();
// this.RootVisual = new InDepth_ColumnLayout_Runtime();
}
open one of the commented code.
ansoesil
July 22, 2009 at 9:10 pm