Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2008.11.16;
Скачать: CL | DM;

Вниз

Динамическая разработка шаблонов серверных элементов управления   Найти похожие ветки 

 
Середкин   (2005-07-26 17:36) [0]

Есть необходимость динамически менять шаблоны серверных элементов управления компонента DataList, например, ItemTemplate. Для этого необходимо перекрыть метод InstantiateIn пространства имён ITemplate. В помощи Delphi 2005 имеются примеры такого перекрытия:

[Visual Basic]
" Override the ITemplate.InstantiateIn method to ensure
" that the templates are created in a Literal control and
" that the Literal object"s DataBinding event is associated
" with the BindData method.
Public Sub InstantiateIn(container As Control) Implements ITemplate.InstantiateIn
  Dim l As New Literal()
  AddHandler l.DataBinding, AddressOf Me.BindData
  container.Controls.Add(l)
End Sub "InstantiateIn
[C#]
// Override the ITemplate.InstantiateIn method to ensure
// that the templates are created in a Literal control and
// that the Literal object"s DataBinding event is associated
// with the BindData method.
public void InstantiateIn(Control container)
{
   Literal l = new Literal();
   l.DataBinding += new EventHandler(this.BindData);
   container.Controls.Add(l);
}
[C++]
// Override the ITemplate*.InstantiateIn method to ensure
// that the templates are created in a Literal control and
// that the Literal Object*"s DataBinding event is associated
// with the BindData method.
public:
void InstantiateIn(Control* container) {
  Literal* l = new Literal();
  l->DataBinding += new EventHandler(this, BindData);
  container->Controls->Add(l);
}

Но меня интересует именно сиснтаксис DelphiLanguage. Может кто-нибудь перевести это на нормальный "дельфёвый" вид?


 
k2 ©   (2005-07-27 06:24) [1]

Середкин   (26.07.05 17:36)

подробно здесь http://bdn.borland.com/borcon2004/article/paper/0,1963,32154,00.html


 
k2 ©   (2005-07-27 08:19) [2]

а вообще хорошо в ..\Demos\DB\AspPortal\BDSWebExample\Code\apptypes.pas и проч.
всегда сначала вдаль тянет отчегото :)



Страницы: 1 вся ветка

Текущий архив: 2008.11.16;
Скачать: CL | DM;

Наверх




Память: 0.47 MB
Время: 0.012 c
2-1223130000
Dr. Genius
2008-10-04 18:20
2008.11.16
InputQuery – ввод пароля


11-1195632501
dima27
2007-11-21 11:08
2008.11.16
KOL+WINCE+БД


4-1200229460
Navi
2008-01-13 16:04
2008.11.16
Управление LPT - перевести код с VB на Delphi


4-1200051901
Unknown user
2008-01-11 14:45
2008.11.16
Как программно открыть пункт меню и выделить нужный элемент?


11-1195305295
Сидор
2007-11-17 16:14
2008.11.16
MsgOk: сделать модальным