Hi all,
I want to know which event i can use for cell click in datagrid?
I want to display the value in that cell from the database query. and when clicking on that cell i want to show the second grid.
I am currently doing this using row click event. But now i want to use cell click event for 4 to 5 columns.
Thanks,
Deepika.
Loading

Deepika ChaudharyPosted Nov 1, 2011, 4:38 AM
I got it solved using the below code..In code behind i am using button_click event of hyperlink.
{
private void Button_Click(object sender, RoutedEventArgs e){
string header = dgUserCollRules.FocusedCell.OwningColumn.Header.ToString();ServiceReference1.CollRulesBO opgrpInfo = (ServiceReference1.CollRulesBO)dgUserCollRules.GetOwningCell(sender as FrameworkElement).OwningRow.DataContext;
if (opgrpInfo != null)
int Coll_RuleID =
Convert.ToInt32(opgrpInfo.CollRulesID);}
<my:DataGridTemplateColumn Binding="{Binding CountPending}" Header="Pending Count" ><my:DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<HyperlinkButton Foreground="DarkBlue" ToolTipService.ToolTip="Click here to see the claims of Pending status" Click="Button_Click">
<TextBlock x:Name="txtblkCPending" Text="{Binding}" TextDecorations="Underline" />
HyperlinkButton>
DataTemplate>
my:DataGridTemplateColumn.CellTemplate>
my:DataGridTemplateColumn>Hemant KumarPosted Oct 28, 2011, 5:10 AM
http://stackoverflow.com/questions/1804204/silverlight-datagrid-row-click
http://stackoverflow.com/questions/2436945/implementing-the-double-click-event-on-silverlight-4-datagrid
http://forums.silverlight.net/t/22523.aspx