Using HierarchicalDataTemplate to bind TreeView in WPF


Just sharing a simple example that shows how to bind the XML data to TreeView using HierarchicalDataTemplate.

Suppose this is our XML file named Packages.xml

This is the XAML used


<Window x:Class="SampleSyncServerAdminTool.MainWindow"
 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
 Title="MainWindow" Height="350" Width="525">
 <Window.Resources>

 <XmlDataProvider x:Key="MyList" Source="Packages.xml" XPath="Packages"/>

<HierarchicalDataTemplate DataType="Packages" ItemsSource="{Binding XPath=*}">
 <TextBlock Text="Packages"></TextBlock>
 </HierarchicalDataTemplate>

<HierarchicalDataTemplate DataType="Package" ItemsSource="{Binding XPath=*}">
 <TextBlock Text="{Binding XPath=@Name}"></TextBlock>
 </HierarchicalDataTemplate>

<HierarchicalDataTemplate DataType="Batch" ItemsSource="{Binding XPath=*}">
 <TextBlock Text="{Binding XPath=@Name}"></TextBlock>
 </HierarchicalDataTemplate>

</Window.Resources>
 <Grid>
 <DockPanel>
 <TreeView DockPanel.Dock="Left" Width="150" Name="treeViewPackages"
 ItemsSource="{Binding Source={StaticResource MyList}}">
 </TreeView>
 <Grid DockPanel.Dock="Right">
 </Grid>
 </DockPanel>
 </Grid>
</Window>

The TreeView showing package information.

Bye.

List of all the tools and resources for Microsoft Dynamics CRM 2011.


Hi,

Got to know about this wonderful CRM Wiki page today, so just thought of sharing it.

http://social.technet.microsoft.com/wiki/contents/articles/2490.microsoft-dynamics-crm-2011-development-resources.aspx

Thanks George Doubinski and Ben Hosking for publishing it.

Bye.

Installing Microsoft Dynamics CRM 4.0 in Windows Server 2008 R2 machine having Microsoft SQL Server 2008 database.


Hi,

These are the steps we followed to install Microsoft Dynamics CRM 4.0 in Windows Server 2008 R2 machine (Here we had the Microsoft SQL Server 2008 installed on a different server)

Before running the setup, first we added the .NET Framework 3.5.1 Features from Server Manager.

After running the installer we got the following error in the Environment Diagnostics Wizard.

 ERROR : (provider: Named Pipes Provider, error: 40 – Could not open a connection to SQL Server) (Microsoft SQL Server, Error: )

We followed the step mentioned in this article to resolve this issue.

http://blog.sqlauthority.com/2009/05/21/sql-server-fix-error-provider-named-pipes-provider-error-40-could-not-open-a-connection-to-sql-server-microsoft-sql-server-error/

On running the installer again, we got this issue

Error : Service msftesql was not found on computer …… The specified service does not exist as an installed service.


We followed the below mentioned steps to resolve the issue

  1. Run > Regedit
  2. HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services
  3. Rename MSSQLFDLauncher Folder to msftesql
  4. Reboot System
  5. Administrative Tools > Services > SQL Full-text Filter Daemon Launcher (MSSQLSERVER) and Check START Status
  6. Rename back msftesql Folder to MSSQLFDLauncher

http://social.microsoft.com/Forums/eu/crm/thread/d8dda562-aae6-47b7-9c81-86f98d2b77f6

Bye.

Determining the Update Rollup Version of the CRM installed


Hi,

Just sharing two useful posts which would help us to identify the update rollup version installed in our CRM environment.

For CRM 2011

http://crmdynamo.com/2011/09/crm-2011-update-rollup-release-build-numbers-and-how-to-find-them/

For CRM 4.0

http://crmdynamo.com/2010/03/check-which-update-rollup-version-is-installed-on-your-crm-environments/

Bye.

Try out – Ribbon Workbench for Dynamics CRM 2011


Hi,

Today i came across this new tool for Ribbon editing in CRM 2011.

http://www.develop1.net/public/page/Ribbon-Workbench-for-Dynamics-CRM-2011.aspx

The tools looks really wonderful.

Will try it out soon.

Bye.

 

 

How t0 – Create a master detail report in SSRS without using Sub report.


Suppose we have simple master (Person) and detail (Favorite
Actor and Favorite
Movie) tables in our database .

To write a report that doesn’t make use of sub reports we need to have a single dataset as shown below

Create a new report project and drag the List control for Master table and two Tablix inside List for the detail records.

Select the list and set Group Properties for the Row Groups as shown below.

Select the row for the first tablix that shows Favorite Actor information, right click it and specify group properties as FAID (i.e. primary key for that table)

Do the same for the other tablix (Movie table).

Run the report, it will show the following output

To hide the tablix if there is no data, set its Hidden Property using the following expression

For tablix 1 à
=IIF(IsNothing(Fields!FAID.Value),True,False)

For tablix 2 à
=IIF(IsNothing(Fields!FMID.Value),True,False)

The DataSet query

</p>
<p>select P.Id, P.FirstName, P.LastName,fa.Id as FAID,fa.firstname,fa.lastname, fm.Id as FMID,fm.Movie from Person P<br />
left outer join FavoriteActor as FA on P.Id = FA.PersonId<br />
left outer join FavoriteMovie as FM on P.Id = FM.PersonId</p>
<p>

Hope it helps

Advertisements

Nishant Rana's Weblog

Everything related to Microsoft .NET Technology

Skip to content ↓