How Can I prevent a new row in datagrid But permit to edit existing cell ?

  • Thread starter Thread starter Marc R.
  • Start date Start date
M

Marc R.

HI all,

How do I prevent a New row to be append to the grid but I still want to be
able to edit curent rows.

Readonly = true will lock all current row,

thanks
Marc.
 
Marc said:
HI all,

How do I prevent a New row to be append to the grid but I still want to be
able to edit curent rows.

Readonly = true will lock all current row,

thanks
Marc.

You need to bind the datagrid with a dataview.

Pseudo code:

DataView1 = new DataView
DataView1.Datasource = MyDataTable
DataView1.AllowNew=False
DataView1.AllowEdit=true
DataGrid1.DataSource = DataView1

Hope that helps
Chris
 
thanks, but right after the 2nd line :
Datasource is not a member of dataview ... Am I missing something here ?
 
never mind, it is not data sources it is table
Marc R. said:
thanks, but right after the 2nd line :
Datasource is not a member of dataview ... Am I missing something here ?
 
Hi I have a little related question I have my datagrid bounded to a
dataset with two related tables, how do I use the dataview if two tables
(master-child) are involved?

also, perhaps you can help me how can I remove that anoying link label
that appears with the name of the relationship? I only have one
relationship and I would like to display the child records as soon as
the plus sign is checked.

tnx
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top