BrainDump
  Home arrow BrainDump arrow Page 5 - Introduction to Binding ComboBox and DataG...
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Silverlight  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
ASP Web Hosting  
ASP.NET Web Hosting 
Windows Web Hosting
 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
BRAINDUMP

Introduction to Binding ComboBox and DataGrid Controls in Silverlight 2.0
By: Jagadish Chaterjee
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 2
    2009-02-04

    Table of Contents:
  • Introduction to Binding ComboBox and DataGrid Controls in Silverlight 2.0
  • Developing WCF Service to serve Business (Entity) Objects collection using LINQ to SQL
  • Binding Object Collections Silverlight 2.0 ComboBox control dynamically
  • Binding Object Collections to cascading Silverlight 2.0 ComboBoxes
  • Binding Object Collections to Silverlight 2.0 ComboBox cascading with DataGrid
  • Detailed Explanation

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Introduction to Binding ComboBox and DataGrid Controls in Silverlight 2.0 - Binding Object Collections to Silverlight 2.0 ComboBox cascading with DataGrid


    (Page 5 of 6 )

    In the previous example, we saw the collection being bound to the ComboBox dynamically. In this section, we will have related binding between a ComboBox and DataGrid.

    The following is the Silverlight 2.0 markup which displays both ComboBox and DataGrid in a detailed fashion:


    <UserControl x:Class="DemoSL.Page8"

    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

    Width="400" Height="300" xmlns:data="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data">

     <StackPanel x:Name="LayoutRoot" Background="White">

     <StackPanel Height="36" Width="301" Orientation="Horizontal" HorizontalAlignment="Left" Margin="10,0,0,0">

     <TextBlock Height="16" x:Name="lblDept" Width="100" Text="Select Dept:" TextWrapping="Wrap"/>

     <ComboBox Height="20" x:Name="cboDept" Width="184" Canvas.ZIndex="100" DisplayMemberPath="Dname" />

     </StackPanel>

     <TextBlock Height="26" HorizontalAlignment="Left" x:Name="lblMsg" Width="350" Text="" TextWrapping="Wrap" Margin="10,0,0,0"/>

     <ScrollViewer Height="243" HorizontalAlignment="Stretch" Width="Auto" Margin="10,0,0,0">

     <data:DataGrid x:Name="dgEmployees"/>

     </ScrollViewer>

     </StackPanel>


    </UserControl>


    You can copy the entire code from the previous section and modify as follows:


    Partial Public Class Page8

    Inherits UserControl


    .

    .


    Private Sub EmpListFetched(ByVal sender As Object, ByVal e As EmpService.GetEmployeeListByDeptCompletedEventArgs)

    Me.dgEmployees.ItemsSource = e.Result

    Me.lblMsg.Text = "Fetched!"

    End Sub


    End Class


    It should give the output as follows:


    More BrainDump Articles
    More By Jagadish Chaterjee


       · Hai,This is my next article in the series focusing on Siverlight 2.0 tutorials. ...
     

    BRAINDUMP ARTICLES

    - Introduction to Office Live Workspace
    - Using MS Excel for One-way Analysis of Varia...
    - Comparing Data Sets Using Statistical Analys...
    - Import Blogger Posts into WordPress Using Wi...
    - Download WordPress from an FTP Server and Ru...
    - Install and Run WordPress in XAMPP Local Host
    - What Windows 7 Brings to the Table
    - Virtualization and Sandbox Detection
    - Advanced Firebug Techniques in Windows XP Ho...
    - Editing CSS with Firebug in Windows XP Home
    - Using Firebug in Windows XP Home
    - Migrating to Exchange Server 2007
    - Using System Restore on a Non-Bootable PC
    - Finding Logged on Users and More Scripting S...
    - Developing Macro Commands in MS Excel





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 4 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek