wpf

ztingtingmck 2010-05-12 03:18:28
我目前在学习WPF,请各位帮助
1.

我的程序中有一个字符串
string name="苏州";
我的前台是这样
<ComboBox Width="200" Name="cobAddress" SelectionChanged="cobAddress_SelectionChanged" SelectedIndex="-1" >
<ComboBoxItem>安徽</ComboBoxItem>
<ComboBoxItem>宿迁</ComboBoxItem>
<ComboBoxItem>苏州</ComboBoxItem>
<ComboBoxItem>常州</ComboBoxItem>
</ComboBox>

我希望程序一加载,ComboBox 就呈现:苏州

2.

<ListView ItemsSource="{Binding PersonalInfoList}" Name="lvInfo">
<ListView.View>
<GridView>
<GridViewColumn Width="100" DisplayMemberBinding="{Binding Path=Name}">
<Hyperlink Click="Hyperlink_Click">姓名</Hyperlink>
</GridViewColumn>
<GridViewColumn Width="100" DisplayMemberBinding="{Binding Path=WorkYears}">
<Hyperlink Name="hlWorkYears" Click="hlWorkYears_Click">工作年限</Hyperlink>
</GridViewColumn>
<GridViewColumn Width="100" Header="办公电话" DisplayMemberBinding="{Binding Path=WorkPhoneNumber}"/>
<GridViewColumn Width="100" Header="电邮" DisplayMemberBinding="{Binding Path=Email}"/>
<!--<GridViewColumn Width="100" Header="编辑"></GridViewColumn>
<GridViewColumn Width="100" Header="查看" />
<GridViewColumn Width="100" Header="删除" />-->
</GridView>
</ListView.View>
我不希望使用这种Binding 方式,可不可以像Asp.net中绑定数据源的用法
而且我怎么进行编辑,删除,排序,我实在不会,希望得到帮助。
...全文
26 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
Olive_Guo 2010-09-17
  • 打赏
  • 举报
回复
cobAddress.selectedValue={Binding name}试试?

110,534

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧