469,338 Members | 8,654 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,338 developers. It's quick & easy.

Dynamic UI - Win Forms


Hi,
Sorry if this is a cross-post.

Wondering if there is any way to genrate Windows UI from an xml file just as
one would load a Web UI as HTML from an XML using XSLT. Please do let me
know if you have any ideas. Assume that the xml contains UI info (i.e.,
which is the control to display the info on etc). One obvious, but tedious
way is to manually parse the xml and generate controls using new() and fill
in data, but am looking for more structured ones.

TIA
Krishnan

Thanks
Krishnan
Nov 12 '05 #1
5 10704
Hi Krishnan,

Thanks for your post.

Based on my understanding, you want to dynamically serialize and
deserialize the winform controls from Xml file.

Microsoft has released a KB of a sample project, which demonstrate the
VS.net IDE design-time support. In this sample, we can serialize the
designer in 3 formats: VB.net files, C# files and Xml files. It also
implemented the function of deserialize the designer from Xml files. So
this function may meet your need.

Normally, internally, it just parse the xml file and use Reflection to
create each controls and initialize each properties. Link listed below:
"INFO: Code Sample That Demonstrates How to Create a Custom Form Designer
by Using Visual C# .NET"
http://support.microsoft.com/default...b;en-us;813808

Hope this helps

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 12 '05 #2
Hi,
Thanks for your reply.

I was more concerned about a dynamic UI. Foe e.g., if I have an xml file
that contains (among other things) data and the control through which I
should display data, I should be able to do it in Winforms. (In case of an
ASP .NEt application I can write xslt for a control matching the control
name!). I found that I can do reasonably well by creating a schema for my
xml, genrating a typed dataset to the schema, filling the dataset with my
xml data and attaching it to a datagrid with (dynamically) bound controls.

However I should say, in this process, I now have hit upon another issue.

I am trying to get a typed dataset from an xsd. However, the VS 2003
Enterprise Architect IDE says that "The same table (Table name) cannot be
the child table in two nested relations". I googled this and found that the
XML viewer sometimes throws up this message. But, in my case, I get this
message when I am trying to get a typed dataset from my xsd. I do have a
multpile reference to a child element, but I do not see how it violates any
of the W3C norms. Could you please help me out?

TIA
Krishnan

""Jeffrey Tan[MSFT]"" <v-*****@online.microsoft.com> wrote in message
news:oT**************@TK2MSFTNGXA01.phx.gbl...
Hi Krishnan,

Thanks for your post.

Based on my understanding, you want to dynamically serialize and
deserialize the winform controls from Xml file.

Microsoft has released a KB of a sample project, which demonstrate the
VS.net IDE design-time support. In this sample, we can serialize the
designer in 3 formats: VB.net files, C# files and Xml files. It also
implemented the function of deserialize the designer from Xml files. So
this function may meet your need.

Normally, internally, it just parse the xml file and use Reflection to
create each controls and initialize each properties. Link listed below:
"INFO: Code Sample That Demonstrates How to Create a Custom Form Designer
by Using Visual C# .NET"
http://support.microsoft.com/default...b;en-us;813808

Hope this helps

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 12 '05 #3
Hello!
I was more concerned about a dynamic UI. Foe e.g., if I have an xml file
that contains (among other things) data and the control through which I
should display data, I should be able to do it in Winforms.
I didn't look very closely at the sample but it looks like you should be
able to produce the XML wich is generated by the designer using XSLT
from your data and deserialize it dynamically to an UI...
(You could also directly create C#-Code from XSLT and compile it
dynamically)
Or you look at GTK#, wich afaik supports an XML-syntax for building
forms. #develop also has something with XML-forms, maybe Qt#... (it
would be easier than Windows.Forms because of automatic layout managers)

I am trying to get a typed dataset from an xsd. However, the VS 2003
Enterprise Architect IDE says that "The same table (Table name) cannot be
the child table in two nested relations". I googled this and found that the
XML viewer sometimes throws up this message. But, in my case, I get this
message when I am trying to get a typed dataset from my xsd. I do have a
multpile reference to a child element, but I do not see how it violates any
of the W3C norms. Could you please help me out?


How does the XSD look like?
IIRC the message occurs for something matching this:
<root>
<a>
<a>foo</a>
</a>
</root>
--
Pascal Schmitt
Nov 12 '05 #4
Hi,

The XSD has to obey not only the W3C norms, but also the DataSet schema
norm. This issue occurs because of the xsd is invalid. You can also check
the following KB article for more information.

http://support.microsoft.com/default...b;en-us;325696

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 12 '05 #5
Thanks Kevin

"Kevin Yu [MSFT]" <v-****@online.microsoft.com> wrote in message
news:Ca**************@TK2MSFTNGXA02.phx.gbl...
Hi,

The XSD has to obey not only the W3C norms, but also the DataSet schema
norm. This issue occurs because of the xsd is invalid. You can also check
the following KB article for more information.

http://support.microsoft.com/default...b;en-us;325696

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 12 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Nathan Bloomfield | last post: by
1 post views Thread by mtech1 | last post: by
3 posts views Thread by MikeY | last post: by
7 posts views Thread by AdeelAlvi | last post: by
2 posts views Thread by deejayquai | last post: by
3 posts views Thread by RahimAsif | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
1 post views Thread by Marylou17 | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.