开发者

LightSwitch - How to customize ListBox's ItemTemplate

I am just starting to explore LightSwitch. I generated a screen using the "List and Details Screen" t开发者_运维知识库emplate. I would like to do the following:

b) Customize the look of the ListBox items on the left

a) Modify the data it shows in each item (make it display multiple fields)

    (edit: Learned that this can be done using something like columns or rows layout) How can I get to the DataTemplate associated with the ItemTemplate on this ListBox? Do I need to create a custom control?

Thanks


You can change the structure of what is displayed in a list box or any other screen element very easily. Beth Massi has written a blog that shows how to do this. LightSwitch is very flexible in this area because it's based on XAML and supports hierarchical composition of controls.

In order to change the visual look of a particular control, even doing something as simple as controlling the font, you will find that a custom control is your only option. However, customer controls are pretty easy to create and consume in LightSwitch as long as you have the full version of Visual Studio.

You can also create a theme or custom shell to control the overall look and feel of all controls and windows, but that's a significant amount of work, and it won't give you the ability to target individual controls.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜