Programatically change mode

S

Steve Funk

Can the Detailsview control mode be changed via a post-back event? I cannot
change the DetailsView1.CurrentMode = DetailsViewMode.Insert from ReadOnly as
the CurrentMode is Read-Only. Changing the DefaultMode doesn't seem to have
an effect.

If its possible please give me an example how.
 
P

Phillip Williams

You can use the ChangeMode method:

void DetailsView1_ItemCommand(object sender, DetailsViewCommandEventArgs e)
{
if (e.CommandName == "Cancel")
DetailsView1.ChangeMode(DetailsViewMode.ReadOnly);
}
 

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

Members online

Forum statistics

Threads
474,129
Messages
2,570,770
Members
47,329
Latest member
FidelRauch

Latest Threads

Top