//------------------------------------------------------
 private void AfficheColonne(C2iWndListe.CColonne colonne)
 {
     ValideModifs();
     m_colonneAffichee = colonne;
     if (colonne == null)
     {
         m_panelInfo.Visible = false;
     }
     else
     {
         m_panelInfo.Visible         = true;
         m_txtTitre.Text             = colonne.Title;
         m_numUpLargeur.Value        = colonne.Width;
         m_txtFormule.Formule        = colonne.FormuleDonnee;
         m_chkGrouperDonnees.Checked = colonne.Grouper;
         m_imageLink.Visible         = colonne.ActionSurLink != null;
         m_picBkColor.BackColor      = colonne.BackColor;
         m_picTextColor.BackColor    = colonne.TextColor;
         if (colonne.Font != null)
         {
             m_lblPolice.Text = colonne.Font.FontFamily.Name;
         }
         else
         {
             m_lblPolice.Text = "";
         }
         m_backColor = colonne.BackColor;
         m_textColor = colonne.TextColor;
         m_font      = colonne.Font;
         m_cmbAgregate.SelectedValue = (int)colonne.OperationAgregation;
         m_txtTitreTotal.Text        = colonne.LibelleTotal;
     }
 }
Example #2
0
        //-----------------------------------------------------------------------
        private void m_linkForGrid_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            if (!(m_grid.DataSource is DataTable))
            {
                return;
            }
            DataTable table = (DataTable)m_grid.DataSource;
            int       nRow  = m_grid.CurrentCell.RowNumber;
            int       nCol  = m_grid.CurrentCell.ColumnNumber;

            if (nRow >= 0 && nRow < table.Rows.Count)
            {
                DataRow row = table.Rows[nRow];
                object  obj = row[m_2iList.GetNomColObject()];
                if (obj == null)
                {
                    return;
                }
                C2iWndListe.CColonne colonne = m_2iList.GetColonne(m_grid.TableStyle.GridColumnStyles[nCol].MappingName);
                if (colonne != null && colonne.ActionSurLink != null)
                {
                    CResultAErreur result = CExecuteurActionSur2iLink.ExecuteAction(colonne.ActionSurLink, obj);
                    if (!result)
                    {
                        CFormAlerte.Afficher(result);
                    }
                }
            }
        }
        //------------------------------------------------------
        private void m_btnAdd_LinkClicked(object sender, EventArgs e)
        {
            ValideModifs();
            C2iWndListe.CColonne col = new C2iWndListe.CColonne();
            col.Title = "New column";
            int nIndex = m_wndListeColonnes.Items.Add(col);

            m_wndListeColonnes.SelectedIndex = nIndex;
        }
 //----------------------------------------------------
 private void m_btnRemove_LinkClicked(object sender, EventArgs e)
 {
     if (m_wndListeColonnes.SelectedIndex >= 0)
     {
         C2iWndListe.CColonne col = (C2iWndListe.CColonne)m_wndListeColonnes.Items[m_wndListeColonnes.SelectedIndex];
         if (CFormAlerte.Afficher(I.T("Remove the column @1 ?|30020", col.Title),
                                  EFormAlerteType.Question) == DialogResult.Yes)
         {
             m_wndListeColonnes.Items.RemoveAt(m_wndListeColonnes.SelectedIndex);
         }
     }
 }
 private void RefreshListe()
 {
     m_bIsRefreshing = true;
     m_wndListeColonnes.BeginUpdate();
     for (int nCol = 0; nCol < m_wndListeColonnes.Items.Count; nCol++)
     {
         C2iWndListe.CColonne col = (C2iWndListe.CColonne)m_wndListeColonnes.Items[nCol];
         m_wndListeColonnes.Items[nCol] = "...";
         m_wndListeColonnes.Items[nCol] = col;
     }
     m_wndListeColonnes.EndUpdate();
     m_bIsRefreshing = false;
 }