|
|
Thanks Rob, it seems that your control can provide some guidance for the full family tree control. Would keep you posted if i get to design it further
|
|
|
|
|
Currently I am trying to incorporate the person user control as collapsible to show hide children. Also to show person's detail on mouse hover.
|
|
|
|
|
The simplest way to do this would be to have a treeview containing the information, and then restyle the template to show the view as appropriate.
|
|
|
|
|
In windows forms application we used to add a data source to the application and then dragged & dropped the fields to the application, that worked fine.
I tried the same in the WPF app but it's not dragging it there on the window.
Can we use the windows form data binding method in wpf or is there any other procedure?
|
|
|
|
|
The databinding in WPF is completely different to Winforms, but much better once you get the hang of it and one of the principle reasons I prefer WPF. I suggest you look for resources on WPF databinding, because with the improved power comes more complexity. Moving Toward WPF Data Binding One Step at a Time[^] by Josh Smith is a very good place to start.
[Edit]
You should also look up MVVM with WPF once you've got the binding down, it will make life much easier.
|
|
|
|
|
WPF binding concepts are a little different. Start here[^].
The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it.
|
|
|
|
|
I am trying to show another window using the visible property as:
Window2.Visibility = Windows.Visibility.Hidden
I have written the command in window1 on a command button. But its giving an error
"Reference to a non-shared member requires an object reference."
Any solutions??
|
|
|
|
|
Looks like you may need to declare an instance of Window2 and then hide the instance
Window2 window = new Window2();
window.Visibility = Windows.Visibility.Hidden;
"You get that on the big jobs."
|
|
|
|
|
Can you recommend a book which takes you step by step through a complete silverlight or wpf project from finish to the end?
Thanks
|
|
|
|
|
|
|
Kevin Marois wrote: WPF Unleashed is total crap.
I don't think that is true at all, it's a well structured and well written reference. It may not be perfect, but then what reference work is?
I must get a clever new signature for 2011.
|
|
|
|
|
You also might want to have a look at some quickstart tutorials on msdn.
The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it.
|
|
|
|
|
I am uunable to find any tutorial on samples where you can have navigation menues on the left hand side of the screen which allows you to go from one page to another.
Do you know of any samples you can refer me to please?
Thanks
|
|
|
|
|
Go through the articles here on CodeProject, they cover just about anything you need to do. Look especially for anything by Josh Smith and Sacha Barber - true masters of WPF.
I must get a clever new signature for 2011.
|
|
|
|
|
|
I have a DataGrid bound to ViewModel. I want the first column to be checkbox in datagrid. If user clicks on checkbox column of any row, then I want to perform some processing and show another datagrid below that row.
I want to this purely with MVVM.
Thanks
Ankur
|
|
|
|
|
Basically, you need to handle IEditableCollectionView. When you click your checkbox, you'll start off by triggering the AddNew method where you'll add a new instance to the underlying collection; as this is databound you will update the UI automatically (you'll need to supply an add/edit datatemplate). If the user is happy with the data they entered, your code calls CommitNew; if they are unhappy, your code calls CancelNew (where the item is removed from the ObservableCollection). And that's it - you've just added the functionality you need to add/edit objects.
I have a post here[^] (it's WPF, but you should be able to easily adapt it to Silverlight) that covers how to do this with a sample set of classes to make things easier for you.
|
|
|
|
|
Hi Pete O'Hanlon,
Thanks for the answer, but since I am very newbie to WPF and MVVM I did not get your point. Basically what I want is
1) Where to call Checkbox click event (View model or code behind) to populate detail grid collection.
2) Show detail grid only when checkbox is checked.
3) Retrieve values from detail and parent grid
Please let me know how I can achieve these from the code you mentioned above.
|
|
|
|
|
You can bind to the IsChecked on the checkbox and trigger this from the VM. You don't retrieve values from the grid - remember that in MVVM, this information just comes from the data model - use that as your datasource.
|
|
|
|
|
Thanks, that will solve #3 above but still not cleared on 1 and #2, specially how I handle checkbox event from viewmodel.
can you please some sample code if you have.
|
|
|
|
|
You have answered your own question, #1 the event must be handled in the VM so bind the checked event to the vm and deal with it there.
As to the child datagrid I've not used this type of structure but with a tree view I have an observablecollection as a property of my main data source and populate that. Then you need an itemssource for each data row bound to the child collection.
I would consider the telerik treeview as it has the columns as well as the tree structure.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Mycroft gave you the answer. Effectively, you'll have a checked property in the the VM which you'll bind to from your checkbox. That will be the trigger for the update - although, to be honest, I don't think that using a checkbox to kick off the behaviour you want is the best way forward.
|
|
|
|
|
thanks for tips, I am now successfully able to bind the BlogIsSelected property to the grid checkbox column. but I am not able to acheive following with the code below
1) Show detail grid only when it checkbox is selected
2) attach event to checkbox column, I did not find any click event for this column
Can you please correct the xaml I am using
Thanks
Ankur bhargava
<DataGrid x:Name="FamilyEditorGrid" ItemsSource="{Binding Path=AllBlogs}" MaxHeight="575"
Background="{x:Null}"
Margin="0,0,0,0"
BorderBrush="{x:Null}"
AutoGenerateColumns="False"
SelectionMode="Single"
GridLinesVisibility="None"
RowDetailsTemplate="{StaticResource RowDetailItemTemplate}"
RowDetailsVisibilityMode="{Binding Path=BlogIsSelected, Converter={StaticResource boolToVisibilityConverter}}"
>
<DataGrid.CellStyle>
<Style TargetType="{x:Type DataGridCell}">
<Setter Property="VerticalContentAlignment" Value="Center" />
</Style>
</DataGrid.CellStyle>
<!--<DataGrid.RowStyle>
<Style TargetType="{x:Type DataGridRow}">
<Setter Property="Height" Value="32" />
</Style>
</DataGrid.RowStyle>-->
<DataGrid.Columns>
<DataGridCheckBoxColumn Header=""
Binding="{Binding Path=BlogIsSelected}"
SortMemberPath="BlogIsSelected" Width="35"
/>
<DataGridTextColumn Header="Blog URL"
Binding="{Binding BlogURL}"
SortMemberPath="BlogURL"
IsReadOnly="True" Width="auto" />
</DataGrid.Columns>
</DataGrid>
|
|
|
|