or
Hello,
I have a small doupt about wpf binding
here i have three classes,
class LoanViewBO
{
private string _companyName;
private List<
LoanBO
> _loans;
public string CompanyName
{
get { return _companyName; }
set { _companyName = value; }
}
public List<
LoanBO
> Loans
{
get { return _loans; }
set { _loans = value;}
}
}
class LoanBO
{
private List<
LoanItemBO
> _loanItems;
private string _loanNumber;
private string _items;
private string _reference;
public List<
LoanItemBO
> LoanItems
{
get { return _loanItems; }
set { _loanItems = value;}
}
public string LoanNumber
{
get { return _loanNumber; }
set { _loanNumber = value; }
}
public string Items
{
get {return _items;}
set { _items = value;}
}
public string Reference
{
get { return _reference; }
set { _reference = value; }
}
}
class LoanItemBO
{
private int? _loanID;
private string _loanNumber;
private int? _itemID;
private string _itemName;
public int? LoanID
{
get { return _loanID; }
set { _loanID = value; }
}
public string LoanNumber
{
get { return _loanNumber; }
set { _loanNumber = value; }
}
public int? ItemID
{
get { return _itemID; }
set { _itemID = value; }
}
public string ItemName
{
get { return _itemName; }
set {_itemName = value;}
}
}
Here i have only one textBox. which is going to bind Companyname..
also i have two Telerik DataGrid .First dataGrid Bind with Loans and second dataGrid Bind with
LoanItems .How to bind with in XAML? here i want to do Insert operation..how i should
assign DataContext in Code , XAML and Bindings?(here one Loan may have many LoanItems)
anybody suggest me? it will be appreciate. and also i want empty row when loading?
Thank you..
public GridViewHeaderCell()
<
StackPanel
>
<
telerik:DataFormDataField
DataMemberBinding
=
"{Binding Credential.AccountName, Mode=TwoWay}"
Label
=
"Account:"
/>
<
telerik:DataFormDataField
DataMemberBinding
=
"{Binding Credential.Username, Mode=TwoWay}"
Label
=
"Username:"
/>
<
telerik:DataFormDataField
Label
=
"Old Password:"
>
<
PasswordBox
/>
</
telerik:DataFormDataField
>
<
telerik:DataFormDataField
Label
=
"New Password:"
>
<
PasswordBox
/>
</
telerik:DataFormDataField
>
<
telerik:DataFormDataField
DataMemberBinding
=
"{Binding Credential.Domain, Mode=TwoWay}"
Label
=
"Domain:"
/>
<
telerik:DataFormCheckBoxField
DataMemberBinding
=
"{Binding Credential.IsPrimary, Mode=TwoWay}"
Label
=
"Is Primary:"
/>
</
StackPanel
>
This is a DataTemplate I'm applying to my RadDataForm. However, that last CheckBox field is not displaying properly.
Here is a photo link showing what the output looks like:
http://public.bay.livefilestore.com/y1pD3zRBo_yIsJp0-maZiXz-MeCu6nKQT9fhvcgDuGN2fa-zm8OajKmj7AOZBA2YghLrpMM1bDuawWlr2ZbXaP9Pg/checkbox_issue.png?psid=1
I'm using the latest internal release of the WPF controls on trial. Any ideas?
<
telerik:RadTabControl
telerik:Theming.Theme
=
"Windows7"
BackgroundVisibility
=
"Collapsed"
TabStripPlacement
=
"Left"
TabOrientation
=
"Vertical"
DisplayMemberPath
=
"Name"
ItemsSource
=
"{Binding ReviewCategoryModels}"
ContentTemplate
=
"{StaticResource ReviewSectionDetailTemplate}"
Align
=
"Right"
ItemContainerStyle
=
"{StaticResource ReviewCategoryTabStyle}"
/>
<
DataTemplate
x:Key
=
"ReviewSectionDetailTemplate"
>
<
ListView
x:Name
=
"items"
ItemsSource
=
"{Binding Items}"
AlternationCount
=
"2"
MinWidth
=
"550"
Style
=
"{StaticResource ReviewItemListView}"
>
[...]
</
ListView
>
</
DataTemplate
>
<
Setter
Property
=
"Template2D"
>
<
Setter.Value
>
<
ControlTemplate
TargetType
=
"telerik:ChartArea"
>
<
Border
BorderBrush
=
"{TemplateBinding BorderBrush}"
BorderThickness
=
"{TemplateBinding BorderThickness}"
Background
=
"{TemplateBinding Background}"
Margin
=
"{TemplateBinding Margin}"
Padding
=
"{TemplateBinding Padding}"
>
<
Grid
>
<
Grid.ColumnDefinitions
>
<
ColumnDefinition
Width
=
"auto"
/>
<
ColumnDefinition
Width
=
"*"
/>
<
ColumnDefinition
Width
=
"auto"
/>
</
Grid.ColumnDefinitions
>
<
Grid.RowDefinitions
>
<
RowDefinition
Height
=
"auto"
/>
<
RowDefinition
Height
=
"*"
/>
<
RowDefinition
Height
=
"auto"
/>
</
Grid.RowDefinitions
>
<
telerik:AxisX2D
x:Name
=
"PART_AxisX"
Grid.Column
=
"1"
Grid.Row
=
"2"
Style
=
"{TemplateBinding AxisXStyle}"
AxisLineStyle
=
"{StaticResource YGridLineStyle}"
/>
<
telerik:AxisY2D
x:Name
=
"PART_AxisY"
Grid.Column
=
"0"
Grid.Row
=
"1"
Style
=
"{TemplateBinding AxisYStyle}"
AxisLineStyle
=
"{StaticResource XGridLineStyle}"
/>
<
telerik:AdditionalAxes2DContainer
x:Name
=
"PART_AdditionalHorizontalAxesPanel"
Grid.Column
=
"1"
Grid.Row
=
"0"
StackOrientation
=
"Vertical"
/>
<
telerik:AdditionalAxes2DContainer
x:Name
=
"PART_AdditionalVerticalAxesPanel"
Grid.Column
=
"2"
Grid.Row
=
"1"
StackOrientation
=
"Horizontal"
Visibility
=
"Collapsed"
/>
<
telerik:RadTransitionControl
x:Name
=
"PART_RadTransitionControl"
Grid.Column
=
"1"
Grid.Row
=
"1"
Style
=
"{TemplateBinding TransitionControlStyle}"
>
<
telerik:ClipPanel
x:Name
=
"PART_PlotAreaPanel"
Style
=
"{TemplateBinding PlotAreaStyle}"
>
<
telerik:DragZoomLayerControl
x:Name
=
"PART_DragZoomLayer"
Style
=
"{TemplateBinding DragZoomLayerControlStyle}"
>
<
ItemsPresenter
/>
</
telerik:DragZoomLayerControl
>
<
telerik:HorizontalStripLines2D
x:Name
=
"PART_HorizontalStripLines"
/>
<
telerik:VerticalStripLines2D
x:Name
=
"PART_VerticalStripLines"
/>
<
telerik:AnnotationLayer
x:Name
=
"PART_AnnotationLayer"
ItemsSource
=
"{TemplateBinding Annotations}"
/>
<
telerik:VerticalMinorGridLines2D
x:Name
=
"PART_VerticalMinorGridLines"
/>
<
telerik:HorizontalMinorGridLines2D
x:Name
=
"PART_HorizontalMinorGridLines"
/>
<
telerik:HorizontalGridLines2D
x:Name
=
"PART_HorizontalGridLines"
/>
<
telerik:VerticalGridLines2D
x:Name
=
"PART_VerticalGridLines"
/>
<
telerik:AdditionalPlotAreaAxes2DContainer
x:Name
=
"PART_AdditionalPlotAreaHorizontalAxesPanel"
StackOrientation
=
"Vertical"
/>
<
telerik:AdditionalPlotAreaAxes2DContainer
x:Name
=
"PART_AdditionalPlotAreaVerticalAxesPanel"
StackOrientation
=
"Horizontal"
/>
<
telerik:PlotAreaAxisY2D
x:Name
=
"PART_PlotAreaAxisY"
Style
=
"{TemplateBinding PlotAreaAxisYStyle}"
/>
<
telerik:PlotAreaAxisX2D
x:Name
=
"PART_PlotAreaAxisX"
Style
=
"{TemplateBinding PlotAreaAxisXStyle}"
/>
<
telerik:LabelsPanel
x:Name
=
"PART_LabelsPanel"
/>
</
telerik:ClipPanel
>
</
telerik:RadTransitionControl
>
<
telerik:NoDataControl
x:Name
=
"PART_NoData"
Grid.ColumnSpan
=
"3"
Grid.RowSpan
=
"3"
Style
=
"{TemplateBinding NoDataControlStyle}"
/>
</
Grid
>
</
Border
>
</
ControlTemplate
>
</
Setter.Value
>
</
Setter
>
Are there other differences I'm missing?
How do these 2 compare with RadRibbonWindow?
Thank you,
- Martin Schneider