定制Web部件(定制目录) [英] custom web part(custom catalog)

查看:101
本文介绍了定制Web部件(定制目录)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在自定义布局中建立零件目录:

而不是带有复选框的可用零件列表,区域的下拉列表和添加到"按钮,我需要带有复选框的可用零件列表以及一个添加"按钮(没有区域的下拉列表).此添加按钮会将选定的零件添加到特定区域.

谁能给我一些有关如何自定义此内容的指导?


感谢

I need to have a catalog of my parts in a custom layout:

Instead of a list of available parts with checkboxes, the dropdownlist of the zones and the "add to" button, I need a list of available parts with checkboxes and just an "add" button (without the dropdownlist of the zones). This add button will add the selected parts to a specific zone.

Can anyone give me some directions on how to customize this?


Thanks

推荐答案

创建一个面板/用户控件,使其显示为Visible ="False",然后在有人单击"Add WebPart Button"时将其显示为

面板/用户控件内

您可以创建一个动态复选框列表.

并在添加"按钮单击事件上使用以下代码.

循环所有复选框,如果选中,则执行以下操作.根据您的要求更改引号中的值.

Create a panel/user control and make it Visible = "False", then make it visible when someone click on "Add WebPart Button"

inside the panel/user control

You can create a list of dynamic check box.

and use the following code on "Add" button click event.

loop for all the check boxes and if its checked do the following. change the values in the quotes as per your requirements.

Control c1 = LoadControl("Path of your User Control based on the checkbox selected");
c1.ID = "some unique id";

GenericWebPart gwp1 = this.WidgetManager.CreateWebPart(c1);
gwp1.Title = "Title of the webpart";                        

    WidgetManager.AddWebPart(gwp1, "variable name of the specific web part zone i.e. LeftZone or something", 0);



最后隐藏面板/用户控件.



and at the end Hide the panel/user control.


thx很多,对我有很多帮助.它按我的计划工作了.thx又一次
thx alot,u''ve benn alot of help to me.it worked as i planed for it.thx again


这篇关于定制Web部件(定制目录)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆