Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Elegant Grid Tech Support » TextCell Collapse All
Subject Author Date
John Pag Jun 9, 2010 - 5:43 AM

I want to extend class TextCell and create class inherrited


 class MyTextCell:TextCell

    {

        public MyTextCell(GridControlBase gridControl, Column column)

            : base(gridControl, column)

        {

        }

        protected override void OnKeyDown(object sender, System.Windows.Forms.KeyEventArgs e)

        {


           //some code

        }


    }


But when i write this code


cellsText[k] = (MyTextCell)dr[k].AddNewCell(typeof(MyTextCell), unboundGridControl1.Columns[0]);


mistake comes out  "Constructor on type ’CSUST.Data.MyTextCell’ not found.."


How can i create correcltly the inherrited of this class?

John Pag Aug 6, 2010 - 1:48 AM

I found how I make. pleasant

John Pag Jul 5, 2010 - 8:39 AM


I create inherited class with two constructors. There are no mistakes now






public class MyCell : TextCell     { public MyCell(GridControlBase gridControl, Column column)     : base(gridControl, column)     {     } public MyCell(Column column, GridControlBase gridControl)     : this(gridControl, column)     {     }     public TextCellStyle Style     {     get     {     return this.Style;     }     }

  protected override void OnKeyDown(object sender, KeyEventArgs e)     {

   // some code     base.OnKeyDown(sender, e);     }

}


 


i wanted to created the inherited, in which i can control the quantity of the entered symbols in Text Cell, but i dnt know why the event Key Down is not working??? can anyone advise me how can i do it?




Technical Support Aug 5, 2010 - 9:07 AM

When the cell editor is activated, key events are no longer received by the cell. You should use a custom text editor to handle all the key strokes.