PC Review Forums Newsgroups Microsoft DotNet Microsoft Dot NET Framework Forms Remove last raw on dataGrid

Reply

Remove last raw on dataGrid

 
Thread Tools Rate Thread
Old 25-06-2003, 08:09 PM   #1
Chi Tang
Guest
 
Posts: n/a
Default Remove last raw on dataGrid


Hi,

Does anybody know how to remove the last raw on a dataGrid control on a
Windows form? This raw is empty with a star sign on the first column. When
I click it some data become null. Thanks for any help,

CT


  Reply With Quote
Old 26-06-2003, 07:02 PM   #2
Dmitriy Lapshin
Guest
 
Posts: n/a
Default Re: Remove last raw on dataGrid

Hi Chi,

You can disable this row by doing the following:

CurrencyManager cm = (CurrencyManager)dataGrid.BoundContext[
dataGrid.DataSource,
dataGrid.DataMember];

DataView theView = (DataView)cm.List;
theView.AllowNew = false;

This code should be executed right after the grid has been bound to a data
source.

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Unit Testing and Integration Environment
http://x-unity.miik.com.ua
Deliver reliable .NET software

"Chi Tang" <chikuotang@hotmail.com> wrote in message
news:O4moXT0ODHA.2316@TK2MSFTNGP11.phx.gbl...
> Hi,
>
> Does anybody know how to remove the last raw on a dataGrid control on a
> Windows form? This raw is empty with a star sign on the first column.

When
> I click it some data become null. Thanks for any help,
>
> CT
>
>


  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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off