Here is the scenario
I have a xamDataGrid where i want the records shown in heirarchy. I want to add a button for clear all and select all on each group level. and on button click event i bind the button datacontext with DataPresenter.ActiveRecord, but on select all and clear all button click event i find the DataContext of a button == null.
here is the xaml, Grid is binded as follows,
Name="GrdUsers" Source="{Binding Source={StaticResource DsProvider}}"
With other visible colum there is an invisible column
<
igDP:UnboundField Name="UserRoleId" BindingPath="UserRoleId" Visibility="Collapsed">
<igDP:UnboundField.Settings><igDP:FieldSettings AllowEdit="False"/></igDP:UnboundField.Settings></igDP:UnboundField>
and in SortedFields
igDP:FieldSortDescription FieldName="UserRoleId" Direction="Ascending" IsGroupBy="True">
Here is a column on which Select all and clear all appears on the header for each group.
igDP:UnboundField loc:Resource.Uid="NameColumn" Label="{loc:Resource}">
<igDP:UnboundField.Settings><igDP:FieldSettings CellValuePresenterStyle="{StaticResource PersonNameStyle}" LabelPresenterStyle="{StaticResource PermitAllInGroupStyle}"/>
</igDP:UnboundField.Settings></igDP:UnboundField>
Here is the style of a header
<Style x:Key="PermitAllInGroupStyle" BasedOn="{StaticResource {x:Type igDP:LabelPresenter}}"
TargetType="{x:Type igDP:LabelPresenter}"><Setter Property="Template"><Setter.Value>
<ControlTemplate TargetType="{x:Type igDP:LabelPresenter}"><StackPanel Orientation="Horizontal" HorizontalAlignment="Left">
<Button x:Name="BtnSelectAllUsersOnGroup" Style="{orbitui:SkinResource PermitAllButtonStyle}" DataContext="{Binding Path=DataPresenter}" Content="{loc:Resource Uid=SelectAll}" Click="BtnSelectAllUsersOnGroup_Click"></Button>
<Button x:Name="BtnClearAllOnGroup" Style="{orbitui:SkinResource PermitAllButtonStyle}"
DataContext="{Binding Path=DataPresenter.ActiveRecord}"Content="{loc:Resource Uid=ClearAll}" Click="BtnClearAllOnGroup_Click"></Button></StackPanel></ControlTemplate></Setter.Value>
</Setter></Style>
and on Click event i write the follwing code.
private
void BtnClearAllOnGroup_Click(object sender, RoutedEventArgs e){
var source = ((Button)sender); var record = source.DataContext as Record;
//Here i found source.DataContext == null
This was not null and giving Record in DataContext but now in new version 2009.2 this is null,
I theer any way i can access to a record groupby value(the value on which the records are grouped.?
Any help would be gr8
There shouldn't be any problem or restricted functionality by setting UseNestedPanels to true. This is fully supported and there are no plans to drop that support going forward.
gr8. yes that resolved the issue thank you.. but i am worried about the future changes and can you tell me it wil not going to break any other feature with in new version. are there any consequences if i revert it to pre-9.2 appraoch by setting the UseNestedPanels to true.?
Hi Aqeel,
One thing that has changed in 9.2 is that we default to a new single panel layout as a performance optimization in most cases. This might be causing the issue you are seeing. If you want to revert to the pre-9.2 approach set the XamDataGrid.ViewSettings.UseNestedPanels to true.
If this doesn't solve the problem then I would suggest subitting an issue here http://es.infragistics.com/support/submitrequest.aspx.