Answer the question
In order to leave comments, you need to log in
How to generate form from xml?
Good afternoon, connoisseurs!
please tell me how to implement form generation (WinForm) in C# from XML schemas
<CONTENT_MODEL dfattchfiles="|Document|files" dfnumberdoc="|Document|Число_регномера" key="Key">
<E name="Key" datatype="integer" index="false" default=""1"" view="invisible" displayname="Ключ" dfprotected="true"/>
<S name="Document" use="Входящие" displayname="Документ"><E displayname="Регистрационный номер" name="Регистрационный_номер" datatype="text(249)" index="true" dfprotected="true" dfhidden="true"/>
<E displayname="Порядковый рег. номер" name="Число_регномера" datatype="integer(+1..)" index="true" view="invisible" dfprotected="true" required="true"/>
<E displayname="Дата регистрации" name="Дата_регистрации" datatype="date" edit="" index="true" dfprotected="true" required="true" esp="false" default="nowdate()"/>
<E displayname="Вид документа" name="Вид_документа" datatype="dictionary(VidDocNames,text)" index="true" dfprotected="true" required="false" edit="combobox"/>
<E displayname="Краткое содержание" name="Краткое_содержание" datatype="longtext" euflag="7" index="true" dfprotected="true" required="true" edit="multiline" awindex="true"/>
<E displayname="Имя потока" name="Имя_потока" datatype="text" index="false" view="invisible" dfprotected="true" dfhidden="true" esp="false"/>
....
Answer the question
In order to leave comments, you need to log in
Your document is a description of a data model with values, apparently.
The data model describes what columns you should have.
You just need to loop through all the columns from your document and build from, depending on the type.
There is no silver bullet, of course.
A close example of the approach: https://stackoverflow.com/a/2016113/2822609
On my own, this example just shows how this can be achieved. Take properties, generate controls for them, add values and links. All.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question