Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
Z

zameb

@zameb
About
Posts
2
Topics
0
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • WPF Weird behavior or me? [modified]
    Z zameb

    Use DynamicResource because the resource is defined in an external file and will not be resolved until runtime.

    WPF wpf help csharp wcf com

  • Export WPF ListView data to excel
    Z zameb

    The ListView in WPF is so different to the Forms one. :~ Maybe the problem is how to iterate inside the ListView items. Here it is:

            GridView grid = source.View as GridView;
            if (grid == null)
            {
                //Sorry, only for GridView views
                return;
            }
            foreach (GridViewColumn col in grid.Columns)
            {
                //value of header is col.Header
            }
            foreach (Object item in source.Items)
            {
                PropertyInfo\[\] dataFields = item.GetType().GetProperties();
                int i = 0;
                foreach (GridViewColumn col in grid.Columns)
                {
                    try
                    {
                        //Get the name of field displayed on grid
                        string strPath = ((Binding)col.DisplayMemberBinding).Path.Path;
                        //Get the field value
                        object propValue = GetValue(item, source.Items, strPath);
                        //Value of cell is propValue
                    }
                    catch (Exception)
                    {
                    }
                }
            }
    

    I think it will be easier to export (to excel, pdf or anything) from here.

    WPF question csharp css wpf
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups