The content you're reading is getting on in years
This post is on the older side and its content may be out of date.
Be sure to visit our blogs homepage for our latest news, updates and information.
In this template I subscribed for the OnClientLoad event of RadComboBox control. This is because I need to remove one of the providers that are populated in the custom control on the server. I have to remove the Libraries provider, because it uses binary data. You can remove the provider from the list if you add a condition inside the "if" check in the GCProviders method, like:
if (provider !=null && provider.Name != "Libraries")
The custom control:
Here I inherited from the SimpleControl class and overrode the LayoutTemplatePath. Here I set the path to my template which has RadGrid, RadComboBox, RadAjaxManagerProxy and RadAjaxLoadingPanel declarations. I created a new property for the provider name which gets the value from the RadComboBox SelectedItem.
Inside InitializeControls I bound the RadCombobox and subscribed for RadGrid's events - PreRender, UpdateCommand, DeleteCommand, NeedDataSource, InsertCommand
As some of the providers like GenericContent and Wiki have different metakeys for the "Title", I had to dynamically change the GridBoundColumn value inside Grid's PreRender event handler and then rebind the grid.
To check the provider I created a helper method, whose value I passed inside the Insert, Update, Delete event handlers.
You can find the complete code below:
View all posts from The Progress Team on the Progress blog. Connect with us about all things application development and deployment, data integration and digital business.
Let our experts teach you how to use Sitefinity's best-in-class features to deliver compelling digital experiences.Learn More
Subscribe to get all the news, info and tutorials you need to build better business apps and sites
You can also ask us not to share your Personal Information to third parties here: Do Not Sell or Share My Info
We see that you have already chosen to receive marketing materials from us. If you wish to change this at any time you may do so by clicking here.
Thank you for your continued interest in Progress. Based on either your previous activity on our websites or our ongoing relationship, we will keep you updated on our products, solutions, services, company news and events. If you decide that you want to be removed from our mailing lists at any time, you can change your contact preferences by clicking here.