Hi,
After Grouping Silverlight XAMGrid by one column, While using xamGrid GroupByrow (by 1 column), for the second 2nd Group, the Control property is always null. I am using following code to change focus from Hour textbox to minute textbox once 2 digits are entered in hours textbox.
Probem: Following is always null for 2nd Group in xamGrid GroupByrow. For 1st Group its returns controls on the Cell.
((Infragistics.Controls.Grids.Primitives.GroupByRow)(xamGrid.Rows[0])).Cells[5].Control
C# Code:
StackPanel sp = ((TUdgTargetTSSearchResults.Rows[currRow].Cells[5].Control) as ContentControl).Content as StackPanel;
XamNumericEditor item2 = sp.Children[2] as XamNumericEditor;
item2.Focus();
XAML:
<ig:TemplateColumn Key="MyTime" HeaderText="Idea Time" IsSummable="False" MinimumWidth="80" MaximumWidth="320" Width="Auto" IsSortable="False" IsGroupable="False" IsHideable="False">
<ig:TemplateColumn.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal" Margin="3,5,3,5" DataContext="{Binding}" >
<sdk:DatePicker
x:Name="MyDate"
Grid.Row="0" Width="100"
Margin="3,0,10,0"
BorderBrush="DeepSkyBlue"
DisplayDate="{Binding Path=MyDate}"
SelectedDate="{Binding Path=IdeaDate, Mode=TwoWay}"
Visibility="Collapsed"
Loaded="MyDate_Loaded"
/>
<ig:XamNumericEditor x:Name="MyHour" Width="30" Margin="0,0,5,0" Mask="{}{double:-2.0}" Value="{Binding MyHour, Mode=TwoWay, UpdateSourceTrigger=Explicit, NotifyOnValidationError=True, ValidatesOnDataErrors=True}" Tag="MyHour" GotFocus="XamNumericEditor_GotFocus" LostFocus="XamNumericEditor_LostFocus" KeyUp="MyHour_KeyUp" KeyDown="MyHour_KeyDown_1"/>
<ig:XamNumericEditor x:Name="MyMinute" Width="30" Margin="0,0,5,0" Mask="{}{double:-2.0}" Value="{Binding MyMinute, Mode=TwoWay, UpdateSourceTrigger=Explicit, NotifyOnValidationError=True, ValidatesOnDataErrors=True}" Tag="MyMinute" GotFocus="XamNumericEditor_GotFocus" LostFocus="XamNumericEditor_LostFocus" KeyUp="MyMinute_KeyUp" />
<ig:XamNumericEditor x:Name="MySecond" Width="30" Margin="0,0,5,0" Mask="{}{double:-2.0}" Value="{Binding MySecond, Mode=TwoWay, UpdateSourceTrigger=Explicit, NotifyOnValidationError=True, ValidatesOnDataErrors=True}" Tag="MySecond" GotFocus="XamNumericEditor_GotFocus" LostFocus="XamNumericEditor_LostFocus" KeyUp="MySecond_KeyUp" KeyDown="MySecond_KeyDown"/>
</StackPanel>
</DataTemplate>
</ig:TemplateColumn.ItemTemplate>
Hello shaktishekhar,
If you references a GroupByRow cell collection when you group by only one column, you actually have only one cell control. In order to access the contained rows within the groupByRecord you can try the following snippet:
((Infragistics.Controls.Grids.Primitives.GroupByRow)(xamGrid.Rows[0])).Rows[0].Cells[1].Control.ToString();
Also please notice that the Control property of the Cells will be null if the cell that you are trying to access isn’t currently in view.
If I have misunderstood you in any way would you please provide me with a screenshot where the control that you are trying to access is highlighted.
Thank you.
waiting for response
Can you please reply quickly ?