I'm listening :) I've done something similar in the past with the Mediapicker. I had to implement it into a datagrid and adjusted the mediapicker source accordingly. But it was quite an ugly hack, so it's not recommendable. I hope there are better ways of integrating existing controls into new ones like you're trying to archive.
There is a simple workaround. It's not really nice, but you can add an extra button to the datatype and when a new value has been selected in the contentpicker the button can be pressed to update the contents of some related fields. It's not nice but it works.
Wait I have a better idea. You can copy the contentpicker from the source code and edit it so it can do a postback if you want to. In the source code the file is located at: umbraco/presentation/umbraco/controls/ContenPicker.cs. You should not edit it in the sourcecode but copy it to your own project and edit it there.
Attaching OnChange or AutoPostBack to a Contentpicker
Hi,
I'm creating a datatype that uses a contentpicker.
<%@ Register TagPrefix="umb" Namespace="umbraco.controls" Assembly="umbraco" %>
<umb:ContentPicker ID="cpMyContent" runat="server"></umb:ContentPicker>
What I need is to add an OnChange event or at least an AutoPostBack to change the contents of some related fields.
Any help is much appreciated.
Ron
Anyone?
I'm listening :) I've done something similar in the past with the Mediapicker. I had to implement it into a datagrid and adjusted the mediapicker source accordingly. But it was quite an ugly hack, so it's not recommendable. I hope there are better ways of integrating existing controls into new ones like you're trying to archive.
Any help woul be much appriciated, so if you could point me into the right direction.
Doe anybody know who created the contentpicker?
Ron
There must be someone..
Nope, this problem is too complex. So it seems :)
There is a simple workaround. It's not really nice, but you can add an extra button to the datatype and when a new value has been selected in the contentpicker the button can be pressed to update the contents of some related fields. It's not nice but it works.
Wait I have a better idea. You can copy the contentpicker from the source code and edit it so it can do a postback if you want to. In the source code the file is located at: umbraco/presentation/umbraco/controls/ContenPicker.cs. You should not edit it in the sourcecode but copy it to your own project and edit it there.
Thanks for your input Jeroen,
I choose a different solution:
I know its a bit dirty but it does the trick.
Ron
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.