Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Guys,
http://www.nibble.be/?p=51 details saving datatype data as xml, however looks like thats not for when you are implmenting AbstractDataEditor interface. Do you have to do something different in my case i have
void DataEditorControl_OnSave(EventArgs e) { base.Data.Value = _jquerySheetControl.SheetXml; }
wheer SheetXml is string of xml.
Regards
Ismail
Not sure I entirley understand your question, but here is an example of a data type using the abstractdataeditor that works:
public class MemberGroupPickerDataType : AbstractDataEditor { protected MemberGroupPickerControl _control = new MemberGroupPickerControl(); public MemberGroupPickerDataType() { _control.Init += new EventHandler(control_Init); RenderControl = _control; DataEditorControl.OnSave += new AbstractDataEditorControl.SaveEventHandler(DataEditorControl_OnSave); } public override Guid Id { get { return new Guid("bdbe818d-e088-4caa-9cb8-087494ce73ae"); } } public override string DataTypeName { get { return "Member Group Picker"; } } protected void control_Init(object sender, EventArgs e) { _control.InitValue = base.Data.Value as string; } protected void DataEditorControl_OnSave(EventArgs e) { base.Data.Value = _control.SelectedValue; } } public class MemberGroupPickerControl : DropDownList { public string InitValue { get; set; } protected override void OnInit(EventArgs e) { base.OnInit(e); DataSource = Roles.GetAllRoles(); DataBind(); Items.Insert(0, new ListItem(ui.Text("choose") + "...", "")); if (!string.IsNullOrEmpty(InitValue)) SelectedValue = InitValue; } }
Matt
Hi Ismail,
As far as I can tell, you'll need to override the PrevalueEditor in your AbstractDataEditor-derived class...
My_PrevalueEditor m_PreValues; public override IDataPrevalue PrevalueEditor { get { if (m_PreValues == null) { m_PreValues = new My_PrevalueEditor(this); } return m_PreValues; } }
Your PrevalueEditor needs to implement the IDataPrevalue interface... then you can set the DBType of the BaseDataType, (to NText).
Then you can override the Data (of your AbstractDataEditor-derived class) to use a custom DefaultData class - as Tim shows in his blog post.
Making these customisations seems to take away from the abstraction, but I'm not sure of another way to do it.
Good luck, and let us know how you get on.
Cheers, Lee.
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.
Continue discussion
AbstractDataEditor save data xml
Guys,
http://www.nibble.be/?p=51 details saving datatype data as xml, however looks like thats not for when you are implmenting AbstractDataEditor interface. Do you have to do something different in my case i have
wheer SheetXml is string of xml.
Regards
Ismail
Not sure I entirley understand your question, but here is an example of a data type using the abstractdataeditor that works:
Matt
Hi Ismail,
As far as I can tell, you'll need to override the PrevalueEditor in your AbstractDataEditor-derived class...
Your PrevalueEditor needs to implement the IDataPrevalue interface... then you can set the DBType of the BaseDataType, (to NText).
Then you can override the Data (of your AbstractDataEditor-derived class) to use a custom DefaultData class - as Tim shows in his blog post.
Making these customisations seems to take away from the abstraction, but I'm not sure of another way to do it.
Good luck, and let us know how you get on.
Cheers, Lee.
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.