export to csv file

Dec 28 2009 1:06 AM
i have two projects one first one is correct(media flow)and 2nd one is not correct(HDI_Silverlight2_DataGridColumns_cs).

in mediaflow project a property like <this:excelcolumn> excelcolumn is class ?

How it is use in my project?

Designing code

<Grid>
          <StackPanel Orientation="Horizontal" Margin="6">
            <data:DataGrid x:Name="results" Margin="6" FontSize="16" >
              <data:DataGrid.ItemsSource>
                <this:Customers/>
              </data:DataGrid.ItemsSource>
            </data:DataGrid>
            <Button Content="export..." VerticalAlignment="Top" Margin="4" FontSize="16"  Click="Button_Click"/>
          </StackPanel>
        </Grid>


public class Customers : List<Customer>
  {
    public Customers()
    {
      this.Add(new Customer("John", "Doe", "Developer"));
      this.Add(new Customer("Jane", "Smith", "Designer"));
      this.Add(new Customer("Bill", "Williams", "Developer"));
      this.Add(new Customer("Robert", "Green", "BDM"));
      this.Add(new Customer("Rita", "White", "Designer"));
      this.Add(new Customer("Karen", "", "Developer, Designer"));
      this.Add(new Customer("Mike", "Cruz", "IT Pro"));
      this.Add(new Customer("", "", "", ""));
    }
  }
  
  public class Customer
  {
    
    public Customer()
    {
    }
    
    public Customer(string first, string last, string role)
    {
      First = first;
      Last = last;
      Role = role;
    }

    public Customer(string first, string last, string role, string notes) : this(first, last, role)
    {
      Notes = notes;
    }


    public string First { get; set; }
    public string Last { get; set; }
    public string Role { get; set; }
    public string Notes { get; set; }
  }

Attachment: excelsheet.rar

Answers (1)