Click here to Skip to main content
15,797,062 members
Home / Discussions / C#
   

C#

 
GeneralRe: DLLImport problem Pin
teejayem23-Jul-08 7:07
teejayem23-Jul-08 7:07 
AnswerRe: DLLImport problem Pin
led mike23-Jul-08 6:05
led mike23-Jul-08 6:05 
GeneralRe: DLLImport problem Pin
teejayem23-Jul-08 6:17
teejayem23-Jul-08 6:17 
GeneralRe: DLLImport problem Pin
led mike23-Jul-08 7:01
led mike23-Jul-08 7:01 
GeneralRe: DLLImport problem [modified] Pin
teejayem23-Jul-08 7:27
teejayem23-Jul-08 7:27 
GeneralRe: DLLImport problem Pin
led mike23-Jul-08 9:48
led mike23-Jul-08 9:48 
Questionadd data in datarow and fit max length columns Pin
JoZ CaVaLLo23-Jul-08 5:32
JoZ CaVaLLo23-Jul-08 5:32 
AnswerRe: add data in datarow and fit max length columns Pin
JoZ CaVaLLo23-Jul-08 5:46
JoZ CaVaLLo23-Jul-08 5:46 
I found my own answer...

I have to use the ColumnChanging event on the table and use the following code:

void ColumnChanging(object sender, DataColumnChangeEventArgs e)
{
    if (e.Column.DataType == typeof(string))
    {
        if (e.ProposedValue.ToString().Length > e.Column.MaxLength)
            e.ProposedValue = e.ProposedValue.ToString().Substring(0, e.Column.MaxLength - 1);
    }
}


Life is not short... the problem is only how you organize yourself

Questionwin form treeview image Pin
arkiboys23-Jul-08 4:53
arkiboys23-Jul-08 4:53 
AnswerRe: win form treeview image Pin
Luc Pattyn23-Jul-08 5:07
sitebuilderLuc Pattyn23-Jul-08 5:07 
GeneralRe: win form treeview image Pin
arkiboys23-Jul-08 5:11
arkiboys23-Jul-08 5:11 
GeneralRe: win form treeview image Pin
arkiboys23-Jul-08 5:17
arkiboys23-Jul-08 5:17 
GeneralRe: win form treeview image Pin
Luc Pattyn23-Jul-08 5:21
sitebuilderLuc Pattyn23-Jul-08 5:21 
GeneralRe: win form treeview image Pin
arkiboys23-Jul-08 5:24
arkiboys23-Jul-08 5:24 
QuestionDatagridview displaying garbage characters Pin
tkrn23-Jul-08 3:51
tkrn23-Jul-08 3:51 
AnswerRe: Datagridview displaying garbage characters Pin
SomeGuyThatIsMe23-Jul-08 4:19
SomeGuyThatIsMe23-Jul-08 4:19 
GeneralMessage Removed Pin
23-Jul-08 5:53
tkrn23-Jul-08 5:53 
GeneralRe: Datagridview displaying garbage characters Pin
SomeGuyThatIsMe23-Jul-08 6:36
SomeGuyThatIsMe23-Jul-08 6:36 
QuestionCollectionBase to PropertyGrid Pin
stancrm23-Jul-08 3:47
stancrm23-Jul-08 3:47 
AnswerRe: CollectionBase to PropertyGrid Pin
darkelv23-Jul-08 7:33
darkelv23-Jul-08 7:33 
AnswerRe: CollectionBase to PropertyGrid Pin
visualhint11-Aug-08 5:54
visualhint11-Aug-08 5:54 
QuestionC# for Driver Pin
balu1234523-Jul-08 3:07
balu1234523-Jul-08 3:07 
AnswerRe: C# for Driver Pin
snorkie23-Jul-08 4:00
professionalsnorkie23-Jul-08 4:00 
Questionip address Pin
AlexPizzano23-Jul-08 2:50
AlexPizzano23-Jul-08 2:50 
AnswerRe: ip address Pin
Mogaambo23-Jul-08 3:13
Mogaambo23-Jul-08 3:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.