|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
new line in datagrid cellI have got a datagrid control on window form. One of its column should comprise long text (note) . Not too long. Let's say that 255 characters. But I want to allow users to press enter key in order to add new line character. My idea is to override ProcessCmdKey and catch processing of enter key. I can add character at the end of text object of CurrentCell but ControlChars.NewLine just simply move cursor to the begining of text not ot the begining of the new line. What am I doing wrong? Mayby another idea how to achieve this. Personal remark: As I remember VS.NET was suppoused to improve writing application. It should be quicker, better and all of this. But in order to achieve just a little of (let's say) Sybase PowerBuilder functionality I must write a huge lines of code. There are problems with almost everything. I can't use combo box in datagrid in simply way - I must write many lines of codes. I don't even say about multicolumn combobox. Is there anybody having the same feeling? I've just found the solution. It was enough to set SelectionStart
property at the value of text length jareks***@gazeta.pl napisal(a): Show quoteHide quote > Hello > > I have got a datagrid control on window form. One of its column should > comprise long text (note) . Not too long. Let's say that 255 > characters. But I want to allow users to press enter key in order to > add new line character. My idea is to override ProcessCmdKey and catch > processing of enter key. I can add character at the end of text object > of CurrentCell but ControlChars.NewLine just simply move cursor to the > begining of text not ot the begining of the new line. What am I doing > wrong? > Mayby another idea how to achieve this. > > Personal remark: > As I remember VS.NET was suppoused to improve writing application. It > should be quicker, better and all of this. But in order to achieve just > a little of (let's say) Sybase PowerBuilder functionality I must write > a huge lines of code. There are problems with almost everything. I > can't use combo box in datagrid in simply way - I must write many lines > of codes. I don't even say about multicolumn combobox. Is there anybody > having the same feeling? Jarek,
I only have it for a datagridview http://www.vb-tips.com/default.aspx?ID=0f172b8e-cbc3-483f-a622-9ec47f79cd27 Your feeling about going from A to B is normal. It is the same as that you would start working in the Ukraine or Germany. You would find the behaviour there strange because you are used to your old habbits. After a while you would see the good things, although some things will forever stay strange for you. Despite of that, the Datagrid is missing a lot that is now in the DataGridView. Working with that last makes life easier. It does not help if you don't have version 2005, but despite of that my idea was to give you this answer so I hope it helps something. Cor
Mouse/Screen Image Status
Datagrids how to launch media player and a selected file from within VB.Net app? Counting rows in an SQL table Locking a Combo-Box How do I make my computer unstupid? asp.net template for user registration how do i compare two string and get the difference? Calling .Net DLL functions in Excel 2003 How to update application settings in vb.net code |
|||||||||||||||||||||||