PC Review


Reply
Thread Tools Rate Thread

Change state of detached column of dataGridView.

 
 
Mr. X.
Guest
Posts: n/a
 
      10th Apr 2010
In VB.NET 2008 (VS 2008) I see I can change the state of an unChanged
column,
but for detached column - I cannot change the state.

Dim objRowV As DataRowView
Dim objRow As DataRow

objRowV = myBindSource.Current
objRow = objRowV.Row
objRow("my_column") = 123

objRow.SetAdded() ' **** this line troughs an exception. ****

.... How can I handle this case ?

Thanks

 
Reply With Quote
 
 
 
 
Armin Zingler
Guest
Posts: n/a
 
      10th Apr 2010
Am 10.04.2010 15:00, schrieb Mr. X.:
> In VB.NET 2008 (VS 2008) I see I can change the state of an unChanged
> column,
> but for detached column - I cannot change the state.
>
> Dim objRowV As DataRowView
> Dim objRow As DataRow
>
> objRowV = myBindSource.Current
> objRow = objRowV.Row
> objRow("my_column") = 123
>
> objRow.SetAdded() ' **** this line troughs an exception. ****
>
> .... How can I handle this case ?
>
> Thanks


The state "Added" means it has been added to the datatable.
Add it to a datatable and it's state will be "Added".

Otherwise it's just an existing datarow.

--
Armin
 
Reply With Quote
 
Mr. X.
Guest
Posts: n/a
 
      10th Apr 2010
Well, thanks. It works.

Thanks

"Armin Zingler" <(E-Mail Removed)> wrote in message
news:e#(E-Mail Removed)...
> Am 10.04.2010 15:00, schrieb Mr. X.:
>> In VB.NET 2008 (VS 2008) I see I can change the state of an unChanged
>> column,
>> but for detached column - I cannot change the state.
>>
>> Dim objRowV As DataRowView
>> Dim objRow As DataRow
>>
>> objRowV = myBindSource.Current
>> objRow = objRowV.Row
>> objRow("my_column") = 123
>>
>> objRow.SetAdded() ' **** this line troughs an exception. ****
>>
>> .... How can I handle this case ?
>>
>> Thanks

>
> The state "Added" means it has been added to the datatable.
> Add it to a datatable and it's state will be "Added".
>
> Otherwise it's just an existing datarow.
>
> --
> Armin


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Change the DataGridView Column in the run time anbaesivam Microsoft Dot NET Framework 6 9th Jan 2009 01:53 PM
Change the image of 3-state checkbox in datagridview Dan Microsoft Dot NET Framework Forms 1 26th May 2008 03:38 PM
Detecting selection change in ComboBox column of a DataGridView David Jackson Microsoft C# .NET 2 14th Apr 2007 07:34 PM
Change DataGridView Column Type Peter Microsoft C# .NET 4 2nd Feb 2006 04:07 AM
How do I change a Datagridview column type? =?Utf-8?B?c2ZzbWl0aF8xMzEz?= Microsoft ADO .NET 1 7th Jan 2006 09:48 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:03 AM.