void SetList () { RowTemplate.Height = _nLineH; nColCaption = GetColNo_ByName ( "Caption" ); nColValue = GetColNo_ByName ( "Value" ); nColDef = GetColNo_ByName ( "Def" ); if (DataSource == null) return; if (((System.Windows.Forms.Control) (this)).BindingContext == null) return; if ( DataSource != null ) BindingContext [ DataSource ].SuspendBinding (); EDITITEMDEF struDef = new EDITITEMDEF(); for (int i = Rows.Count -1 ; i >= 0 ; i -- ) { struDef.Set_ByCombin ( Rows[i].Cells[nColDef].Value.ToString() ); if (struDef.bReadOnly) { Rows[i].Cells[nColValue].Style.ForeColor = struDef.clrFore; Rows[i].Cells[nColValue].Style.BackColor = clrReadOnly; } else { Rows[i].Cells[nColValue].Style.ForeColor = struDef.clrFore; Rows[i].Cells[nColValue].Style.BackColor = struDef.clrBK; } if (struDef.bShow) { if (_bBrief && struDef.bHideInBrief) Rows[i].Visible = false; else Rows[i].Visible = true; } else Rows[i].Visible = false; } if ( DataSource != null ) BindingContext [ DataSource ].ResumeBinding (); }
protected EDITITEMDEF GetItemDef( DATA data ) { EDITITEMDEF ItemDef = new EDITITEMDEF(); ItemDef.Set_ByCombin( data.Def ); return ItemDef; }