Wednesday, March 28, 2012

Programmatically exit gridviews edit mode when changing tabs

Hi,

I have a gridview in a tabpanel and I would like to have it operate such that if the user puts the gridview in edit mode and then clicks to another tab, then the gridview exits edit mode. I tried this:

Protected Sub tabContPersonnelAdmin_ActiveTabChanged(ByVal senderAs Object,ByVal eAs System.EventArgs)Handles tabContPersonnelAdmin.ActiveTabChangedgvPersonnel.EditIndex = -1gvPersonnelType.EditIndex = -1End Sub

... but that has no effect.

Any ideas, anyone?

Heck, while I'm at it, I'd also like to be able to exit the gridview's edit mode when a panel with a collapsiblepanel extender attached to it is clicked.

I appreciate anyone's help!

Hi,

By default, the ActiveTabChanged event isn't fired on the server when another tab is clicked on the client. You need to set AutoPostBack property of the TabContainer to true.

For CollasiblePanel, it doesn't have build-in support for server side event when it's expanded or collapsed, so you may need to invoke __doPostback method on the client to force a postback. And pass different arguments in it.

Hope this helps.


Thanks, Raymond!

I'll see what I can do with that info.

Regards

No comments:

Post a Comment