TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
nagaraju
NA
87
129.7k
Find out the controls in datagrid
Aug 22 2011 1:04 AM
Hi,
i took datagrid in that i placed labels and radiobuttons in datatemplate .
using this i am displaying one question paper. now i want to find out the question no ie <sdk:Label x:Name="lbl_QID" Content="{Binding QID}" Tag="{Binding QID}" /> and the correct answer ie radiobutton. how can i find out the question id and selected radiobutton in datagrid . can u please tell me the solution.here i am sending my source code
<sdk:DataGrid x:Name="Qpdatagrid" AutoGenerateColumns="False" ItemsSource="{Binding ElementName=dataSource, Path=Data}" SelectionChanged="Qpdatagrid_SelectionChanged">
<sdk:DataGrid.Columns>
<sdk:DataGridTemplateColumn>
<sdk:DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<StackPanel >
<StackPanel Orientation="Horizontal">
<!--<TextBlock Text="{Binding Path=QID}" />-->
<sdk:Label x:Name="lbl_QID" Content="{Binding QID}" Tag="{Binding QID}" />
<TextBlock Text=")"/>
<TextBlock Text="{Binding Path=Question}" />
</StackPanel>
<StackPanel Orientation="Vertical" Height="100">
<RadioButton x:Name="Option1" GroupName="{Binding group1}" IsChecked="{Binding Questionpaper, Mode=TwoWay}" Content="{Binding Option1}" Checked="OPtion1_Checked"/>
<RadioButton x:Name="Option2" GroupName="{Binding group1}" Content="{Binding Option2}" IsChecked="{Binding Questionpaper, Mode=TwoWay}" Checked="Option2_Checked"/>
<RadioButton x:Name="Option3" GroupName="{Binding group1}" IsChecked="{Binding Questionpaper, Mode=TwoWay}" Content="{Binding Option3}" Checked="Option3_Checked"/>
<RadioButton x:Name="Option4" GroupName="{Binding group1}" IsChecked="{Binding Questionpaper, Mode=TwoWay}" Content="{Binding Option4}" Checked="Option4_Checked"/>
</StackPanel>
</StackPanel>
</DataTemplate>
</sdk:DataGridTemplateColumn.CellTemplate>
</sdk:DataGridTemplateColumn>
</sdk:DataGrid.Columns>
</sdk:DataGrid>
Thanks
P.Nagaraju
Reply
Answers (
5
)
Name of Silverlight
How to add itemtemplate in silverlight grid like asp.net