﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>c360 Forums / SDK for Microsoft CRM / Version 3 Product Questions / Samples  / Grid Preferences / Latest Posts</title><generator>InstantForum.NET v4.1.4</generator><description>c360 Forums</description><link>http://www.c360.com/Forums/</link><webMaster>support@c360.com</webMaster><lastBuildDate>Sat, 22 Nov 2008 13:22:42 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Grid Preferences</title><link>http://www.c360.com/Forums/Topic707-39-1.aspx</link><description>And use the &lt;FONT color=#008080 size=2&gt;ColumnType.EntityLink&lt;/FONT&gt; in ConfigureGrid in the GridPreferencesHelper:&lt;P&gt;[quote]&lt;BR&gt;&lt;FONT size=2&gt;&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT size=1&gt;&lt;FONT color=#0000ff&gt;public&lt;/FONT&gt; &lt;FONT color=#0000ff&gt;void&lt;/FONT&gt; ConfigureGrid(&lt;FONT color=#008080&gt;IGrid&lt;/FONT&gt; grid)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size=1&gt;{&lt;/FONT&gt;&lt;/P&gt;&lt;BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"&gt;&lt;P&gt;&lt;FONT size=1&gt;grid.SortCol = &lt;FONT color=#0000ff&gt;this&lt;/FONT&gt;.SortField;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size=1&gt;grid.SortDir = &lt;FONT color=#0000ff&gt;this&lt;/FONT&gt;.SortDirection;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size=1&gt;&lt;FONT color=#0000ff&gt;for&lt;/FONT&gt; (&lt;FONT color=#0000ff&gt;int&lt;/FONT&gt; i = 0; i &amp;lt; &lt;FONT color=#0000ff&gt;this&lt;/FONT&gt;.SelectedFields.Length; i++)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size=1&gt;{&lt;/FONT&gt;&lt;/P&gt;&lt;BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"&gt;&lt;P&gt;&lt;FONT size=1&gt;&lt;FONT color=#008080&gt;ColumnType&lt;/FONT&gt; columnType = &lt;FONT color=#008080&gt;ColumnType&lt;/FONT&gt;.Normal;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#008000&gt;&lt;FONT size=1&gt;// use entity column type for primary field&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;P&gt;&lt;FONT size=1&gt;&lt;FONT color=#0000ff&gt;if&lt;/FONT&gt; (SelectedFields[i].Name == _entityMetadata.PrimaryField)&lt;/FONT&gt;&lt;/P&gt;&lt;BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"&gt;&lt;P&gt;&lt;FONT size=1&gt;columnType = &lt;FONT color=#008080&gt;ColumnType&lt;/FONT&gt;.EntityLink;&lt;/FONT&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;FONT color=#0000ff&gt;&lt;FONT size=1&gt;else&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;P&gt;&lt;FONT size=1&gt;{&lt;/FONT&gt;&lt;/P&gt;&lt;BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"&gt;&lt;P&gt;&lt;FONT color=#008000&gt;&lt;FONT size=1&gt;// use entity column type for refereces to from entities&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;P&gt;&lt;FONT size=1&gt;&lt;FONT color=#0000ff&gt;foreach&lt;/FONT&gt; (&lt;FONT color=#008080&gt;RelationshipMetadata&lt;/FONT&gt; relmap &lt;FONT color=#0000ff&gt;in&lt;/FONT&gt; _entityMetadata.ReferencesFrom)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size=1&gt;{&lt;/FONT&gt;&lt;/P&gt;&lt;BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"&gt;&lt;P&gt;&lt;FONT size=1&gt;&lt;FONT color=#0000ff&gt;if&lt;/FONT&gt; (relmap.ReferencingAttribute == SelectedFields[i].Name)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size=1&gt;{&lt;/FONT&gt;&lt;/P&gt;&lt;BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"&gt;&lt;P&gt;&lt;FONT size=1&gt;columnType = &lt;FONT color=#008080&gt;ColumnType&lt;/FONT&gt;.EntityLink;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size=1&gt;&lt;FONT color=#0000ff&gt;break&lt;/FONT&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;FONT size=1&gt;}&lt;/FONT&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;FONT size=1&gt;}&lt;/FONT&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;FONT size=1&gt;}&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size=1&gt;grid.ColumnHeaders.Add(&lt;FONT color=#008080&gt;ControlFactory&lt;/FONT&gt;.CreateColumnHeader(&lt;FONT color=#0000ff&gt;this&lt;/FONT&gt;.SelectedFields[i].DisplayName, &lt;FONT color=#0000ff&gt;this&lt;/FONT&gt;.SelectedFields[i].Name, (&lt;FONT color=#0000ff&gt;this&lt;/FONT&gt;.SelectedFields[i].Name == _entityMetadata.PrimaryField ? 0 : 150), columnType));&lt;/FONT&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;FONT size=1&gt;}&lt;/FONT&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;FONT size=1&gt;}&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;P&gt;[/quote]</description><pubDate>Fri, 10 Nov 2006 05:36:36 GMT</pubDate><dc:creator>pklingens</dc:creator></item><item><title>RE: Grid Preferences</title><link>http://www.c360.com/Forums/Topic707-39-1.aspx</link><description>Idea: Why not allow the url to the gridpreference.aspx page to be a property&lt;BR&gt;See attachment.&lt;BR&gt;&lt;BR&gt;This way you can easily create your own GridPreference class and still use the helper class.&lt;BR&gt;...you should follow the GridPreference class for the parameters that are passed through...&lt;BR&gt;&lt;BR&gt;It would be even nicer if you the GridPreferences class became available in the c360.SDK.UI.Pages dll ;)&lt;BR&gt;</description><pubDate>Thu, 09 Nov 2006 08:58:58 GMT</pubDate><dc:creator>pklingens</dc:creator></item><item><title>Grid Preferences</title><link>http://www.c360.com/Forums/Topic707-39-1.aspx</link><description>&lt;STRONG&gt;&lt;U&gt;&lt;FONT size=3&gt;Overview&lt;/FONT&gt;&lt;/U&gt;&lt;/STRONG&gt;&lt;P&gt;The goal of this sample is to demonstrate how the GridPreferences control can be used in conjuction with a Grid to allow the end-user to select the fields he or she wants to see. Furthermore, this sample also demonstrates how to preserve user preference and how to subsequently retrieve them.&lt;/P&gt;&lt;P&gt;This sample demonstrates the following:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Use a Save dialog page to present the GridPreferences control.&lt;/LI&gt;&lt;LI&gt;Read metadata about an entity and display the list of fields in the GridPreferences control.&lt;/LI&gt;&lt;LI&gt;Save the user selections&lt;/LI&gt;&lt;LI&gt;Use an AreaPage to display a standard grid&lt;/LI&gt;&lt;LI&gt;Retrieve the user preferences and display only the selected fields in the Grid&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;&lt;FONT size=3&gt;Installation&lt;/FONT&gt;&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Step 1&lt;/U&gt;&lt;/STRONG&gt; – Edit ISV.config&lt;/P&gt;&lt;P&gt;This sample must be added as a new link under a “top level” menu (i.e.: a pull down menu on the top menu bar at the top of the main CRM window). Therefore we need to edit the “CustomMenus” section in Microsoft CRM’s ISV.config file like so:&lt;BR&gt;&amp;lt;Menu Title="Testing c360 SDK"&amp;gt;&lt;BR&gt; &amp;lt;MenuItem Title="Grid Preferences" Url="&lt;A href="http://localhost:5517/c360Sdk/Samples/GridPreferences/Grid.aspx"&gt;http://localhost:5517/c360Sdk/Samples/GridPreferences/Grid.aspx&lt;/A&gt;" WinMode="0" Client="Web,OutlookWorkstationClient" AvailableOffline="false" /&amp;gt;&lt;BR&gt;&amp;lt;/Menu&amp;gt;&lt;/P&gt;&lt;P&gt;Note: you will need to adjust the url in the above sample to match your environment.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Step 2&lt;/U&gt;&lt;/STRONG&gt; – Copy files&lt;/P&gt;&lt;P&gt;In your Visual Studio 2005 project, make sure you have a folder called “Samples” and create a sub-folder called “GridPreferences”.&lt;/P&gt;&lt;P&gt;In this new folder, copy the image, the two ASPX page and their corresponding code behind files:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;18_settings.gif&lt;/LI&gt;&lt;LI&gt;Grid.aspx&lt;/LI&gt;&lt;LI&gt;Grid.aspx.cs&lt;/LI&gt;&lt;LI&gt;GridPreferences.aspx&lt;/LI&gt;&lt;LI&gt;GridPreferences.aspx.cs&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;There is also one file included in this sample that must be copied to the App_Code folder in your solution:&lt;BR&gt;GridPreferences.cs&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;&lt;FONT size=3&gt;Screenshots&lt;/FONT&gt;&lt;/U&gt;&lt;/STRONG&gt;&lt;P&gt;&lt;IMG src="http://www.c360.com/Forums/Uploads/Images/da4f63aa-e4f2-4ed4-8216-0ba1.PNG"&gt;&lt;P&gt;&lt;IMG src="http://www.c360.com/Forums/Uploads/Images/48fa46d4-d2e6-48c4-8afc-e123.PNG"&gt;&lt;P&gt;&lt;IMG src="http://www.c360.com/Forums/Uploads/Images/34090099-7503-4c80-8107-8e3f.PNG"&gt;&lt;P&gt;&lt;IMG src="http://www.c360.com/Forums/Uploads/Images/2c657a86-ff5a-4e4d-855a-0c43.PNG"&gt;</description><pubDate>Tue, 17 Oct 2006 14:32:10 GMT</pubDate><dc:creator>Jeremie Desautels</dc:creator></item></channel></rss>