请教如何得到listbox下的textblock的text?代码如下
<ListBox Name="listBox1" SelectionChanged="listBox1_SelectionChanged"
ItemsSource="{Binding Source={StaticResource weatherCollection},Path=DataCollection}">
<ListBox.ItemTemplate>
<DataTemplate>
<Grid >
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Grid Grid.Column="0">
<Image Source="../cellpic.png"/>
</Grid>
<Grid Grid.Column="1">
<TextBlock Name="tb1" Text="XXXXXXXX" Margin="35,25,0,0"/>
</Grid>
<Grid Grid.Column="2" >
<Image Source="../pointer.png" HorizontalAlignment="Right"/>
</Grid>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
[解决办法]
可参考一下下面的帖子:http://topic.csdn.net/u/20110915/17/d725257a-dfef-44ff-a98d-d4c7125cc995.html
[解决办法]
可参考下该帖子:http://topic.csdn.net/u/20110915/17/d725257a-dfef-44ff-a98d-d4c7125cc995.html