Hello everyone!
Currently I'm testing xamGrid. At least, I think I do... but I'm doing something wrong and I don't know what.
I'm trying to define hierarchy like this one:
I group
I.I group
I.II group
I process
I.I process
I.I.I process
It should be really easy, but I made a mistake :(
For test purposes I've generated data in code. I will attach 3 main files, and if someone can help, please tell me what is the problem.
Thank you!
Hi,
Just set your ColumnLayout key to the property that it each ColumnLayout should be bound to.
In the case of the sample code you posted, you would use SubGroups:
<ig:ColumnLayout Key="Subgroups" TargetTypeName="ActivityGroup">
Hope this helps,
-SteveZ
Hi Stephen,
Could you please answer me one more question?
As you could see in code that I sent, ActivityGroup has IDActivityType. Whith DataGrid, and ListBox I can easily filter DataGrid, based on selection in ListBox. Part of xaml code is as follows:
<ListBox Grid.Row="1" Name="listBox1" ItemsSource="{Binding Path=ActivityTypes}" DisplayMemberPath="ActivityTypeTerm" SelectedItem="{Binding Path=CurrentType, Mode=TwoWay}" Margin="0,0,0,307" Grid.RowSpan="2" />
<sdk:DataGrid AutoGenerateColumns="False" Grid.Column="1" Grid.Row="1" ItemsSource="{Binding Path=FilteredActivityGroups}" SelectedItem="{Binding Path=CurrentType, Mode=TwoWay}" Name="filteredActivityGroupsDataGrid" RowDetailsVisibilityMode="VisibleWhenSelected">
I now that I can do the same thing using ListBox and xamGrid, but I don't know how. Could you help me with this one, please?
- Lucky
Actually, currently the xamGrid doesn't have a property similar to SelectedItem.
However, in the upcoming release of 11.1 we have added this feature, and you will be able to bind to the ActiveItem on the root level of the xamGrid.
OK, nice to here that you will add this feature. But, is there a workaround? I need to filter data in xamGrid, based on selection in ListBox. Any advice how to do that?
So if you need to filter, based off the selection of the ListBox, you don't really need the SelectedItem property on the xamGrid anyways, as that would just sync selection between the xamGrid and the ListBox.
How are you doing the filtering? Using the xamGrid's Filtering, or are you modifying your ItemsSource and doing the filtering yourself?
Ok, I understand the first part. I'm tried to modify ItemsSource, and that is not a problem. I've solved that.
Next thing I want to do is to define ItemsSource for another xamGrid, based on selected row in the first xamGrid. That is way I need to know which item is selected. Probably there is another way...
If I'm not clear enough, I'll try to explain again.
Thank you for your help.
Ok,
I undertand that and that is what I was looking for. Then, based on cell value, I can get id, or another value that I need. After that, I can select my item... etc.
That should do the work. Thank you, this was really helpful.
Ah, ok.
So you can use the ActiveCellChanged event on the XamGrid. This would fire any time the ActiveCell changed. So it could fire multiple times for the same row, if you're click on a cell within the same row.
If you have Row Selection turned on, then you can use the SelectedRowsCollectionChanged event to determine when a row has been selected.
To access these properties outside of the event:
grid.ActiveCell.
grid.SelectionSettings.SelectedRows
Is this what you were looking for?