Gridview and Detailsview "New" record

G

Giorgio

Hi,

I have a dropdown menu with categories and when a category is selected
the Gridview is binded with sub-categories. Then when a sub-category is
selected a detailsview is displayed side-by-side to the gridview and
then I can click on "new" and isert a new subcategory or edit and
update the sub-category.
My problem is that when a category doesn't have any sub-categories then
the Gridview is not displayed therefore there's no way I can see the
detailsview and the "new" button so I cannot insert any new
sub-categories.
How can I enable the insert method of the detailsview when there aren't
any records on the gridview and in which event do I do that?
An example would be very much appreciated.

Thanks a lot
Giorgio
 
P

purkka

Hi

Modify the EmptyDataTemplate of the xxxView-kontrol by inserting a
linkbutton which change the ViewMode like
protected void addNew(object sender, EventArgs e)
{
DetailsView1.ChangeMode(DetailsViewMode.Insert);
}
 

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
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top