Disable inserting (newbie)

  • Thread starter Thread starter Adriano
  • Start date Start date
A

Adriano

hello,

how do i hide the last row of DataGrid (the one for inserting new
data), so my users can't insert new data but only update and delete?

thanks in advance,
Adriano
 
Can't remember but I think there is an AllowAdd or AllowNew property for the
datagrid.... try that... (set to false)

HTH,

Shane
 
I know this C# code doesn't help much, but it might jog somebody else's
memory.

myDVM = new DataViewManager(myDS);

dgUsers.SetDataBinding(myDVM, "Users");

DataView dv = ((CurrencyManager) this.BindingContext[dgUsers.DataSource,
dgUsers.DataMember]).List as DataView;
if(dv != null)
{
dv.AllowDelete = false;
dv.AllowNew = false;
}

Seems to me you had to bind your grid to a dataview, and disable AllowNew on
the view.

Greg
 
great! dataview has that "allownew" property,

thanks all,
Adriano

Greg Burns said:
I know this C# code doesn't help much, but it might jog somebody else's
memory.

myDVM = new DataViewManager(myDS);

dgUsers.SetDataBinding(myDVM, "Users");

DataView dv = ((CurrencyManager) this.BindingContext[dgUsers.DataSource,
dgUsers.DataMember]).List as DataView;
if(dv != null)
{
dv.AllowDelete = false;
dv.AllowNew = false;
}

Seems to me you had to bind your grid to a dataview, and disable AllowNew on
the view.

Greg


SStory said:
Can't remember but I think there is an AllowAdd or AllowNew property for the
datagrid.... try that... (set to false)

HTH,

Shane
 

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