Re: Settings invisible field values for user created rows in DataGridView
- From: Sin Jeong-hun <typingcat@xxxxxxxxx>
- Date: Sat, 8 Mar 2008 18:07:33 -0800 (PST)
On Mar 9, 5:35 am, Marc Gravell <marc.grav...@xxxxxxxxx> wrote:
One option is to subscirbe to the AddingNew event of theThank you for your answer.
BindingSource, and set e.NewObject to whatever you want.
Alternatively - what is behind the BindingSource? If it is
BindingList<T>, you can override AddNewCore nad set what properties
you want.
Marc
The data source behind the DataGridView is a very simple .MDB (Access
database) which has a simple table named XXX (XXX is not the real
name) I tried to handle AddingNew as you recommended, but I don't know
what type of object should I set for the NewObject. Ideally, I don't
want to create a new object myself, I want to receive the object
(which represents the new row) created by the user when the user just
have typed a new row, and set only the value for the hidden field
while leaving all the values input by the user intact.
Anyways, I tried like
XXXDataSet.XXXRow. r = xxxDataSet.XXX.NewXXXRow();
r.HiddenField = 2;
e.NewObject = r;
but failed. I think XXXRow type is incorrect, but what type should I
set for it? Is it uncommon that setting hidden field value for newly
created row by user? I thought it should be common and there should be
already a practice for this.
.
- Follow-Ups:
- Re: Settings invisible field values for user created rows in DataGridView
- From: Marc Gravell
- Re: Settings invisible field values for user created rows in DataGridView
- References:
- Settings invisible field values for user created rows in DataGridView
- From: Sin Jeong-hun
- Re: Settings invisible field values for user created rows in DataGridView
- From: Marc Gravell
- Settings invisible field values for user created rows in DataGridView
- Prev by Date: Re: ArrayList error
- Next by Date: display View output in DataGridView
- Previous by thread: Re: Settings invisible field values for user created rows in DataGridView
- Next by thread: Re: Settings invisible field values for user created rows in DataGridView
- Index(es):