n2cms 可编辑复选框列表属性
我正在考虑为一个项目创建一个可编辑的复选框列表属性,如下面的代码所示。编辑界面呈现复选框列表,但不保留选定的复选框项。
[Editable("Divisions", typeof(CheckBoxList), "SelectedValue", 85, DataBind = true, ContainerName = Tabs.Content)]
[EditorModifier("DataSource", new string[] { "Item 1", "Item 2", "Item 3", "Item 4", "Item 5", "Item 6" })]
public virtual string[] Divisions
{
get { return (string[])(GetDetail("Divisions")); }
set { SetDetail("Divisions", value); }
}
还有其他人尝试过实施上述内容吗?如果是这样,你是如何实现的?
感谢您的时间和支持
肖恩
I am looking at creating an editable checkboxlist property for an item as indicated in the code below. The edit interface renders the checkboxlist but does not persist the selected checkbox items.
[Editable("Divisions", typeof(CheckBoxList), "SelectedValue", 85, DataBind = true, ContainerName = Tabs.Content)]
[EditorModifier("DataSource", new string[] { "Item 1", "Item 2", "Item 3", "Item 4", "Item 5", "Item 6" })]
public virtual string[] Divisions
{
get { return (string[])(GetDetail("Divisions")); }
set { SetDetail("Divisions", value); }
}
Has anyone else tried to implement the above? If so, how did you achieve it?
Thank you for your time and support
Sean
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
花了几个小时检查 n2cms 自定义编辑器后,下面是我的解决方案
这就是你如何使用它
作为额外的好处,这里是一个单选按钮列表可编辑属性
这就是你如何使用它
希望这对
肖恩有帮助
After spending a few hours checking out n2cms custom editors, below is my solution
And this is how you use it
As an added bonus, here is a radio button list editable attribute
And this is how you use it
Hope this helps
Sean
Libardo 在论坛 http://n2cms.codeplex.com/Thread/ 上回答了这个问题View.aspx?ThreadId=223192
这是有关下拉菜单的教程 http://n2cmstutorial.blogspot.com/2010/08/creating-page-with-drop-down-list.html 并且在这些之后实现复选框列表应该不会太难步骤。
Libardo answered this on the forum http://n2cms.codeplex.com/Thread/View.aspx?ThreadId=223192
Here is tutorial on dropdowns http://n2cmstutorial.blogspot.com/2010/08/creating-page-with-drop-down-list.html and it should not be too hard to implement checkbox list following these steps.