Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem with a new class
Message
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Titre:
Problem with a new class
Versions des environnements
Environment:
C# 3.0
OS:
Windows XP
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01401121
Message ID:
01401121
Vues:
91
Hi everybody,

Can you please tell me what I'm missing here?
using System;
using System.Linq;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel;
using System.Data;
using System.Drawing; 
using System.Windows.Forms;

namespace myNamespace
{
    // C#
    // Specifies the bitmap associated with the DataGrid type.
   // [ToolboxBitmap(typeof(DataGrid))]
    public partial class grdOrderDetails : DataGrid
    {
        private int _rowNumber = 0;
        public int _RowNumber
        {
            get
            {
                return this._rowNumber;
            }
            set
            {
                this._rowNumber = value;
            }
        }

        #region Grid Mouse Up Event

        /// <summary>
        /// Search grid mouse up event.       
        /// </summary>        
        protected override void  OnMouseUp(MouseEventArgs mea)
        {
 	         base.OnMouseUp(mea);
            DataGrid.HitTestInfo hti = this.HitTest(mea.X, mea.Y);
            try
            {
                switch (hti.Type)
                {
                    case DataGrid.HitTestType.Cell:
                        {
                            this.Select(hti.Row);
                            _rowNumber = hti.Row;
                            break;
                        }
                    case DataGrid.HitTestType.ColumnHeader:
                        {
                            break;
                        }
                }
            }
            catch (Exception ex)
            {

                MessageBox.Show(ex.ToString());

            }
        }
        #endregion
    }       
}
I changed the original DataGrids to the instances of my class in my form and now I'm getting an error in run-time about failing initialize.

Do you know what may be wrong here?

Thanks in advance.
If it's not broken, fix it until it is.


My Blog
Répondre
Fil
Voir

Click here to load this message in the networking platform