Accueil > Non classé > Save position and size of ColumnHeader automaticly

Save position and size of ColumnHeader automaticly

I you want to save automaticly position and size of Columnheader for a ListView you can use this AttachedProperty

and use like

the SaveColumnPositionID is the uniq Id of ListView for saving

two possibilities

  • first in ini file (by default)
    %APPDATA%\[compagny]\[product].ini
    // [ID]
    // cols = 3|2|1|0|
    // sizes = NaN|64.4|208.17660377358487|NaN|
  • second in Registry
    Computer\HKEY_CURRENT_USER\SOFTWARE\[compagny]\[product]\[Id]
    // key cols = 3|2|1|0|
    // key sizes = NaN|64.4|208.17660377358487|NaN|

for switch to registry you must insert this code
ListViewHelper.UseIni = false;
before all (in app for sample)
InitializeComponent();
this parameter is Global for all application
and you must have a different SaveColumnPositionID for each ListView

Categories: Non classé Tags:
  1. Pas encore de commentaire
  1. Pas encore de trackbacks