I am trying to build custom form for adding rows.
Part of my xaml looks like:
Name is the column in my table.
Now on button click i called radGrid.BeginInsert() and on other button DomainDataSource.SubmitChanges().
If i write some text direct to RadGrid, the text appears in TextBox too. But if i write to TextBox the text doesn't appear in RadGrid, and in my WebServer project i get null for Name property.
I know that i can write something like this:
But i would rather see that grid do the hard work. The only problem is how to connect TextBlock to Grid.
Part of my xaml looks like:
<Grid HorizontalAlignment="Left" Name="gridStavek" VerticalAlignment="Top" Margin="5,5,5,5"> |
<Grid.RowDefinitions> |
<RowDefinition /> |
<RowDefinition /> |
</Grid.RowDefinitions> |
<TextBox x:Name="editName" Grid.Row="1" LabelText="Ime:" Width="150" Text="{Binding Path=Name, Mode=TwoWay, ValidatesOnExceptions=true, NotifyOnValidationError=true}"></TextBox > |
</Grid> |
Name is the column in my table.
gridStavek.SetBinding(Grid.DataContextProperty, new Binding { Source = radGrid, Path = new PropertyPath("SelectedItem"), Mode = BindingMode.TwoWay }); |
Now on button click i called radGrid.BeginInsert() and on other button DomainDataSource.SubmitChanges().
If i write some text direct to RadGrid, the text appears in TextBox too. But if i write to TextBox the text doesn't appear in RadGrid, and in my WebServer project i get null for Name property.
I know that i can write something like this:
Groups group = new Groups(); |
group.Name = tbName.Text; |
DS.Groups.Add(group); //DS = DomainDataSource |
But i would rather see that grid do the hard work. The only problem is how to connect TextBlock to Grid.