Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem with a new class
Message
 
 
To
All
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Title:
Problem with a new class
Environment versions
Environment:
C# 3.0
OS:
Windows XP
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01401121
Message ID:
01401121
Views:
92
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
Reply
Map
View

Click here to load this message in the networking platform