Click here to Skip to main content
15,885,366 members
Home / Discussions / WPF
   

WPF

 
AnswerRe: Wpf Datagrid Pin
Clifford Nelson12-Sep-12 12:34
Clifford Nelson12-Sep-12 12:34 
GeneralRe: Wpf Datagrid Pin
SledgeHammer0112-Sep-12 13:29
SledgeHammer0112-Sep-12 13:29 
QuestionWPF groupbox visibility by combobox value selected Pin
karthik bandaru11-Sep-12 20:33
karthik bandaru11-Sep-12 20:33 
AnswerRe: WPF groupbox visibility by combobox value selected Pin
Mycroft Holmes11-Sep-12 20:54
professionalMycroft Holmes11-Sep-12 20:54 
GeneralRe: WPF groupbox visibility by combobox value selected Pin
karthik bandaru11-Sep-12 21:04
karthik bandaru11-Sep-12 21:04 
GeneralRe: WPF groupbox visibility by combobox value selected Pin
Mycroft Holmes11-Sep-12 21:12
professionalMycroft Holmes11-Sep-12 21:12 
QuestionGrid Dynamic Column and Row in run time in WPF MVVM Pin
sels198711-Sep-12 15:59
sels198711-Sep-12 15:59 
AnswerRe: Grid Dynamic Column and Row in run time in WPF MVVM Pin
Clifford Nelson12-Sep-12 13:39
Clifford Nelson12-Sep-12 13:39 
You should have not problem with creating a completely dynamic environment with WPF and a DataGrid. I have the following xaml:

<Window x:Class="DynamicGrid.MainWindow"
				xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
				xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
				xmlns:local="clr-namespace:DynamicGrid"
				Title="MainWindow"
				Height="350"
				Width="525">
	<Window.DataContext>
		<local:ViewModel />
	</Window.DataContext>
	<Grid>
		<DataGrid AutoGenerateColumns="True"
							ItemsSource="{Binding Children}"
							HorizontalAlignment="Stretch"
							Name="dataGrid1"
							VerticalAlignment="Stretch" />
	</Grid>
</Window>


with the following ViewModel:

class ViewModel
{
    public ViewModel()
    {
        var temp = new BindingList<Class1>();
        temp.Add(new Class1 {TypeA = "AAAA", TypeB = "BBBB"});
        temp.Add(new Class1 { TypeA = "CCCC", TypeB = "CCCC" });
        _children = temp;
    }
    private IEnumerable<object> _children;
    public IEnumerable<object> Children
    {
        get { return _children; }
        set { _children = value; }
    }
}


The grid is automatically created, and can add new rows. Just use what ojects you need. If you need something even more dynamic, then can bind to a class that inherits from DynamicObject
QuestionPopUp Window Open and close in WPF MVVM pattern Pin
sels19878-Sep-12 21:53
sels19878-Sep-12 21:53 
AnswerRe: PopUp Window Open and close in WPF MVVM pattern Pin
Mycroft Holmes9-Sep-12 14:25
professionalMycroft Holmes9-Sep-12 14:25 
AnswerRe: PopUp Window Open and close in WPF MVVM pattern Pin
Pete O'Hanlon10-Sep-12 5:03
mvePete O'Hanlon10-Sep-12 5:03 
AnswerRe: PopUp Window Open and close in WPF MVVM pattern Pin
Abhinav S10-Sep-12 16:14
Abhinav S10-Sep-12 16:14 
AnswerRe: PopUp Window Open and close in WPF MVVM pattern Pin
_Maxxx_29-Oct-12 17:30
professional_Maxxx_29-Oct-12 17:30 
QuestionTuple as a Binding Parameter Pin
Ahrimal6-Sep-12 22:11
Ahrimal6-Sep-12 22:11 
QuestionBinding to an XML list of attributes Pin
Jayme656-Sep-12 11:46
Jayme656-Sep-12 11:46 
AnswerRe: Binding to an XML list of attributes Pin
Pete O'Hanlon6-Sep-12 22:24
mvePete O'Hanlon6-Sep-12 22:24 
GeneralRe: Binding to an XML list of attributes Pin
Jayme657-Sep-12 6:11
Jayme657-Sep-12 6:11 
GeneralRe: Binding to an XML list of attributes Pin
Pete O'Hanlon7-Sep-12 6:52
mvePete O'Hanlon7-Sep-12 6:52 
GeneralRe: Binding to an XML list of attributes Pin
Jayme657-Sep-12 7:10
Jayme657-Sep-12 7:10 
GeneralRe: Binding to an XML list of attributes Pin
dbaseman7-Sep-12 21:06
dbaseman7-Sep-12 21:06 
GeneralRe: Binding to an XML list of attributes Pin
Jayme658-Sep-12 0:32
Jayme658-Sep-12 0:32 
GeneralRe: Binding to an XML list of attributes Pin
dbaseman8-Sep-12 10:08
dbaseman8-Sep-12 10:08 
GeneralRe: Binding to an XML list of attributes Pin
Jayme659-Sep-12 0:04
Jayme659-Sep-12 0:04 
GeneralRe: Binding to an XML list of attributes Pin
dbaseman9-Sep-12 16:18
dbaseman9-Sep-12 16:18 
QuestionHow to implement a gallery like the built-in gallery in Windows Phone Pin
small25-Sep-12 16:22
small25-Sep-12 16:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.