ansoesil’s blog

“Learning is experience. Everything else is just information.” – Albert Einstein

InDepth: Column Layout – Part 1

with one comment

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:

  1. Declaratively in the xaml.
  2. Programmatically.
  3. Change layout at runtime.

Defining column layout declaratively in the xaml

InDepth-ColumnLayout1

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.

InDepth-ColumnLayout1b

To specify the initial order position you can do:

InDepth-ColumnLayout1c

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:

InDepth-ColumnLayout1d

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.

InDepth-ColumnLayout1e

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.

InDepth-ColumnLayout2

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:

InDepth-ColumnLayout3

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.

Advertisement

Written by ansoesil

July 22, 2009 at 9:09 pm

One Response

Subscribe to comments with RSS.

  1. 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


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.