Этот баннер — требование Роскомнадзора для исполнения 152 ФЗ.
«На сайте осуществляется обработка файлов cookie, необходимых для работы сайта, а также для анализа использования сайта и улучшения предоставляемых сервисов с использованием метрической программы Яндекс.Метрика. Продолжая использовать сайт, вы даёте согласие с использованием данных технологий».
Политика конфиденциальности

Новые сообщения [новые:0]
Дайджест
Горячие темы
Избранное [новые:0]
Форумы
Пользователи
Статистика
Статистика нагрузки
Мод. лог
Поиск
|
|
15.01.2005, 11:51
|
|||
|---|---|---|---|
|
|||
Custom Control содержит колекцию - как сделать |
|||
|
#18+
Как сделать Custom Control, который содержит свойство коллекцию Rows как на примере: <pds:CustomControl> <Rows> <Row Num='1' Status='1' ... /> <Row Num='2' Status='1' ... /> </Rows> </pds:CustomControl> ... |
|||
|
:
Нравится:
Не нравится:
|
|||
|
|
|
15.01.2005, 12:34
|
|||
|---|---|---|---|
Custom Control содержит колекцию - как сделать |
|||
|
#18+
тебе надо 1. создать класс Row - элемент коллекции ряда 2. создать коллекцию Rows - коллекцию объектов типа rows 3. создать readonly свойство типа Rows 4. к этому свойству добавь атрибуь ментаданных <DesignerSerializationVisibility(DesignerSerializationVisibility.Content), _ NotifyParentProperty(True), _ PersistenceMode(PersistenceMode.InnerProperty), _ Editor(GetType(Rows), GetType(CollectionEditor))> _ ... |
|||
|
:
Нравится:
Не нравится:
|
|||
|
|
|
15.01.2005, 14:19
|
|||
|---|---|---|---|
|
|||
Custom Control содержит колекцию - как сделать |
|||
|
#18+
Большое спасибо, получилось. Только с едитором не получилось, не нашел я такой едитор. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
|
|
|
15.01.2005, 14:24
|
|||
|---|---|---|---|
|
|||
Custom Control содержит колекцию - как сделать |
|||
|
#18+
Есть еще одна проблема, в design пишет Еrror Creating Control : Could not be set on property Rows ... |
|||
|
:
Нравится:
Не нравится:
|
|||
|
|
|
15.01.2005, 20:03
|
|||
|---|---|---|---|
Custom Control содержит колекцию - как сделать |
|||
|
#18+
свойство Rows стоит как readonly? а editor стоит подключить. правда он в хитрой dll находиться, ее нужно персонально подключить. просто я как раз такое свойсвто в своем контроле делал, по функциям очень похожее на ваше ... |
|||
|
:
Нравится:
Не нравится:
|
|||
|
|
|
15.01.2005, 20:20
|
|||
|---|---|---|---|
|
|||
Custom Control содержит колекцию - как сделать |
|||
|
#18+
свойство Rows стоит как readonly , только get хитрое ДЛЛ надо самому писать? ... |
|||
|
:
Нравится:
Не нравится:
|
|||
|
|
|
16.01.2005, 00:43
|
|||
|---|---|---|---|
Custom Control содержит колекцию - как сделать |
|||
|
#18+
да, в разделе get свойства необходимо вызвать EnsureChildControls() а длл писать не надо - Editor из стандартной system.dll , если верить msdn. так а она и так ведь подключена. и должно все получиться. перекомпилируй проект ... |
|||
|
:
Нравится:
Не нравится:
|
|||
|
|
|
16.01.2005, 00:44
|
|||
|---|---|---|---|
Custom Control содержит колекцию - как сделать |
|||
|
#18+
да, для Editor нужно Imports System.ComponentModel если нет - добавь ... |
|||
|
:
Нравится:
Не нравится:
|
|||
|
|
|
16.01.2005, 00:46
|
|||
|---|---|---|---|
Custom Control содержит колекцию - как сделать |
|||
|
#18+
поправочка - тебе ведь нужнен System.ComponentModel.Design.CollectionEditor, а он находиться в System.Design.dll - вот ее то и подключи ... |
|||
|
:
Нравится:
Не нравится:
|
|||
|
|
|
20.01.2005, 02:55
|
|||
|---|---|---|---|
|
|||
Custom Control содержит колекцию - как сделать |
|||
|
#18+
Sorry I'm writing in english. I'm having probably the same problem with the control property (collection Tabs) - the error message: '' could not be set on property 'Tabs'. After setting the control property Tabs as Readonly (with the Get only) the error message changed to 'Tabs' could not be initialized. The error message appears only after rebuilding the project and returning back to design mode in VS.NET. When inserting my new control on the page in design mode I can set all its properties (incl. the collection properties) and the final HTML page looks pretty good. The error appears just only when returning back to design mode. Could you help me please? Vladimir CZ the collection item: Public Class mZalozka Public Property TextNadpis() As String ... Public Property NavigateUrl() As String ... Public Property CommandArgument() As String ... End Class the collection: Public Class mZalozky Inherits CollectionBase Default Public ReadOnly Property Item(ByVal index As Integer) As mZalozka... Public Sub Add(ByRef Zalozka As mZalozka).... Public Sub Remove(ByVal index As Integer).... End Class my control class: <ToolboxData("<{0}:mTab runat=server></{0}:mTab>"), ParseChildren(True), PersistChildren(False)> _ Public Class mTab Inherits System.Web.UI.WebControls.WebControl Implements IPostBackEventHandler... local: Private _zalozky As New mZalozky the collection property: <Category("Misc"), Browsable(True), PersistenceMode(PersistenceMode.InnerProperty), _ DesignerSerializationVisibility(DesignerSerializationVisibility.Content), NotifyParentProperty(True), _ Editor(GetType(mZalozky), GetType(System.ComponentModel.Design.CollectionEditor))> _ Public ReadOnly Property Tabs() As mZalozky Get Return _zalozky End Get End Property and finally the aspx control snippet: <mc:mTab id="MTab47" runat="server"> <Tabs> <mc:mZalozka NavigateUrl="" TextNadpis="Text" CommandArgument=""></mc:mZalozka> <mc:mZalozka NavigateUrl="" TextNadpis="Text" CommandArgument=""></mc:mZalozka> </Tabs> </mc:mTab> ... |
|||
|
:
Нравится:
Не нравится:
|
|||
|
|
|
21.01.2005, 00:07
|
|||
|---|---|---|---|
Custom Control содержит колекцию - как сделать |
|||
|
#18+
вот так попробуйте <Category("Misc"), Browsable(True), PersistenceMode(PersistenceMode.InnerProperty), _ DesignerSerializationVisibility(DesignerSerializationVisibility.Content), NotifyParentProperty(True), _ Editor(GetType(mZalozky), GetType(System.ComponentModel.Design.CollectionEditor))> _ Public ReadOnly Property Tabs() As mZalozky Get EnsureChildControls() Return _zalozky End Get End Property ... |
|||
|
:
Нравится:
Не нравится:
|
|||
|
|
|
21.01.2005, 01:55
|
|||
|---|---|---|---|
|
|||
Custom Control содержит колекцию - как сделать |
|||
|
#18+
Ooh - with the same result - after returning back to VS designer the error message 'Tabs' could not be initialized. I had to give up after three days and had to change the collection property to simple string delimited with *. Since now it works well and I can do the rest of my job :( Vladimir ... |
|||
|
:
Нравится:
Не нравится:
|
|||
|
|
|

start [/forum/topic.php?fid=18&tablet=1&tid=1394689]: |
0ms |
get settings: |
7ms |
get forum list: |
14ms |
check forum access: |
3ms |
check topic access: |
3ms |
track hit: |
30ms |
get topic data: |
8ms |
get forum data: |
2ms |
get page messages: |
40ms |
get tp. blocked users: |
1ms |
| others: | 222ms |
| total: | 330ms |

| 0 / 0 |
