//------------------------------------------------------------------- private void FillColonne(ListViewAutoFilledColumn col) { int nNum = col.Index; foreach (ListViewItem item in Items) { while (item.SubItems.Count <= nNum) { item.SubItems.Add(""); } //string strText = CInterpreteurTextePropriete.GetStringValue(item.Tag, col.Field, "" ).ToString(); string strText = CInfoStructureDynamique.GetDonneeDynamiqueString(item.Tag, col.Field, ""); strText = strText.Replace("\r", " ,"); strText = strText.Replace("\n", " "); item.SubItems[nNum].Text = strText; } }
//------------------------------------------------------------------- public void UpdateItemWithObject(ListViewItem item, object obj) { if (item == null || obj == null) { return; } item.Tag = obj; while (item.SubItems.Count < this.Columns.Count) { item.SubItems.Add(""); } ArrayList lstColonneesToDel = new ArrayList(); for (int i = 0; i < this.Columns.Count; i++) { string strField = m_listColonnes[i].Field; if (strField != "") { try { //bool bIsChampValide = true; string strText = CInfoStructureDynamique.GetDonneeDynamiqueString(obj, strField, ""); //string strText = CInterpreteurTextePropriete.GetStringValue ( obj, strField, "", ref bIsChampValide ); strText = strText.Replace("\r", ""); strText = strText.Replace("\n", " ,"); strText = strText.Replace("\t", ""); item.SubItems[i].Text = strText; //if ( !bIsChampValide ) // lstColonneesToDel.Add ( m_listColonnes[i] ); } catch { item.SubItems[i].Text = I.T("Unknown value|10013"); } } } //foreach ( ListViewAutoFilledColumn col in lstColonneesToDel ) // RemoveColonne ( col ); }