or
<
telerik:RadGridView
x:Name
=
"RadGridView1"
ItemsSource
=
"{Binding Assigns}"
>
<
telerik:RadGridView.Columns
>
<
telerik:GridViewComboBoxColumn
Header
=
"Client"
ItemsSource
=
"{Binding}"
DataMemberBinding
=
"{Binding ClientID}"
DisplayMemberPath
=
"Name"
SelectedValueMemberPath
=
"ID"
/>
<
telerik:GridViewComboBoxColumn
Header
=
"Personalist"
ItemsSourceBinding
=
"{Binding AvailablePersons}"
DataMemberBinding
=
"{Binding PersonID}"
DisplayMemberPath
=
"Name"
SelectedValueMemberPath
=
"ID"
/>
</
telerik:RadGridView.Columns
>
</
telerik:RadGridView
>
DataClassesDataContext db = new DataClassesDataContext();
((GridViewComboBoxColumn)this.RadGridView1.Columns[0]).ItemsSource = db.Clients;
this.AddHandler(RadComboBox.SelectionChangedEvent, new SelectionChangedEventHandler(comboSelectionChanged));
private void comboSelectionChanged(object sender, SelectionChangedEventArgs e)
{
RadComboBox comboBox = (RadComboBox)e.OriginalSource;
if (comboBox.SelectedValue == null
|| comboBox.SelectedItem.GetType() != typeof(Client))
return;
Assign assign= comboBox.DataContext as Assign;
assign.ClientID = (int)comboBox.SelectedValue;
}
public IEnumerable<
Person
> AvailablePersons
{
get
{
return from p in db.Persons
where p.ClientID == this.ClientID //???????????????????????????
select p;
}
}
<
Style
TargetType
=
"telerik:StackedBar"
x:Key
=
"CommonContextMenu"
>
<
Setter
Property
=
"Template"
>
<
Setter.Value
>
<
ControlTemplate
TargetType
=
"telerik:StackedBar"
>
<
Canvas
Opacity
=
"0"
x:Name
=
"PART_CanvasContainer"
>
<
telerik:RadContextMenu.ContextMenu
>
<
telerik:RadContextMenu
ItemClick
=
"RadContextMenu_ItemClick"
>
<
telerik:RadMenuItem
Header
=
"Go To Home Page"
/>
<
telerik:RadMenuItem
Header
=
"Go To Employee Page"
/>
</
telerik:RadContextMenu
>
</
telerik:RadContextMenu.ContextMenu
>
<
Rectangle
x:Name
=
"PART_DefiningGeometry"
Height
=
"{TemplateBinding ItemActualHeight}"
Width
=
"{TemplateBinding ItemActualWidth}"
Style
=
"{TemplateBinding ItemStyle}"
RadiusX
=
"{StaticResource BarRadiusX}"
RadiusY
=
"{StaticResource BarRadiusY}"
/>
<
Rectangle
Height
=
"{TemplateBinding ItemActualHeight}"
Width
=
"{TemplateBinding ItemActualWidth}"
RadiusX
=
"{StaticResource BarRadiusX}"
RadiusY
=
"{StaticResource BarRadiusY}"
OpacityMask
=
"{StaticResource BarOpacityMaskBrush}"
Fill
=
"{StaticResource BarMaskBrush}"
/>
<
Rectangle
Height
=
"{TemplateBinding ItemActualHeight}"
Width
=
"{TemplateBinding ItemActualWidth}"
RadiusX
=
"{StaticResource BarRadiusX}"
RadiusY
=
"{StaticResource BarRadiusY}"
Fill
=
"{StaticResource BarTopMaskBrush}"
/>
<
Canvas.RenderTransform
>
<
ScaleTransform
x:Name
=
"PART_AnimationTransform"
ScaleY
=
"0"
/>
</
Canvas.RenderTransform
>
</
Canvas
>
</
ControlTemplate
>
</
Setter.Value
>
</
Setter
>
</
Style
>
var grids = grid1.ChildrenOfType<
RadGridView
>();
var rows = grid1.ChildrenOfType<
GridViewRow
>();
[MediatorMessageSink(MediatorConstants.Cashbook_ChildStatementLineFocus)]
private void Cashbook_ChildStatementLineFocusMessageSink(int currentRowIndex)
{
if (grid1.ItemsSource != null)
{
grid1.ExpandHierarchyItem(this.grid1.Items[currentRowIndex]);
Dispatcher.BeginInvoke((Action)delegate
{
var grids = grid1.ChildrenOfType<
RadGridView
>();
var rows = grid1.ChildrenOfType<
GridViewRow
>();
foreach (var row in rows)
{
if (grid1.SelectedItem == this.grid1.Items[currentRowIndex])
{
var child = row.ChildrenOfType<
RadGridView
>().FirstOrDefault();
child.SelectedItem = child.Items[0];
var column = child.Columns[1];
var cellToEdit = new GridViewCellInfo(child.SelectedItem, column, child);
child.CurrentCellInfo = cellToEdit;
child.BeginEdit();
}
}
});
//RadGridView childGrid = this.grid1.ChildrenOfType<
RadGridView
>().FirstOrDefault(x => ((DOFinBankStatementTran)x.ParentRow.DataContext).BankStatementTranID == ((DOFinBankStatementTran)this.grid1.CurrentItem).BankStatementTranID);
//if (childGrid != null)
//{
// var item = childGrid.Items[0];
// var column = this.grid1.Columns[1];
// var cellToEdit = new GridViewCellInfo(item, column, childGrid);
// childGrid.CurrentCellInfo = cellToEdit;
// childGrid.BeginEdit();
//}
}
}
private void ExecuteDissectionCommand()
{
try
{
DOFinBankStatementTran currentLine = SelectedStatementLine;
if (currentLine == StatementLinesSource.Last())
{
AddNewLineCommand.Execute(true);
}
if (currentLine.Children == null)
{
currentLine.Children = new List<
DOFinBankStatementTran
>();
DOFinBankStatementTran line = CurrentClientHelper.ClientFinancial.CreateBankStatementTran(currentLine.GLBankAccount);
line.ParentStatementTranID = currentLine.BankStatementTranID;
line.GLBankAccountID = currentLine.GLBankAccountID;
line.GLBankAccount = currentLine.GLBankAccount;
line.HasChildren = false;
line.ImageForIsEditable = currentLine.ImageForIsEditable;
line.IsActive = true;
line.IsDeleted = false;
line.IsPosted = false;
line.IsReconciled = false;
currentLine.Children.Add(line);
currentLine.HasChildren = true;
}
int i = StatementLinesSource.IndexOf(currentLine);
StatementLinesSource.RemoveAt(i);
StatementLinesSource.Insert(i, currentLine);
Mediator.Instance.NotifyColleagues<
int
>(MediatorConstants.Cashbook_ChildStatementLineFocus, i);
}
catch (Exception ex)
{
//check if exception type is global exception and throw
ExceptionHelper.CheckExceptionType(ex, typeof(GlobalException));
_messageBoxService.ShowError("DissectionCommand Error:"+ex.Message);
CurrentClientHelper.ClientAudit.LogException(ex, EventCategory.Client);
}
}
<
telerik:RadGridView
x:Name
=
"grid1"
Grid.Row
=
"1"
Grid.Column
=
"0"
ShowGroupPanel
=
"False"
AutoGenerateColumns
=
"False"
RowIndicatorVisibility
=
"Collapsed"
IsReadOnly
=
"False"
CanUserInsertRows
=
"False"
EditTriggers
=
"CellClick"
RowLoaded
=
"grid1_RowLoaded"
ItemsSource
=
"{Binding StatementLinesSource,Mode=TwoWay}"
SelectedItem
=
"{Binding SelectedStatementLine, Mode=TwoWay}"
BeginningEdit
=
"grid1_BeginningEdit"
IsSynchronizedWithCurrentItem
=
"False"
aps:SingleEventCommand.RoutedEventName
=
"CellEditEnded"
aps:SingleEventCommand.CommandParameter
=
"{Binding ElementName=grid1, Path=CurrentCell.Column.UniqueName}"
aps:SingleEventCommand.TheCommandToRun
=
"{Binding CellEditEndedCommand}"
abs:RadGridViewKeyboardBehaviour.IsEnabled
=
"True"
abs:RadGridViewKeyboardBehaviour.EnterDirection
=
"MoveNext"
ScrollViewer.HorizontalScrollBarVisibility
=
"Auto"
EnableColumnVirtualization
=
"True"
EnableRowVirtualization
=
"True"
UseLayoutRounding
=
"False"
>
<
telerik:RadGridView
x:Name
=
"gridChildren"
CanUserFreezeColumns
=
"False"
AutoGenerateColumns
=
"False"
ItemsSource
=
"{Binding Children}"
ShowGroupPanel
=
"False"
CanUserInsertRows
=
"True"
SelectionChanged
=
"gridChildren_SelectionChanged"
RowEditEnded
=
"gridChildren_RowEditEnded"
RowValidating
=
"gridChildren_RowValidating"
RowLoaded
=
"gridChildren_RowLoaded"
abs:RadGridViewKeyboardBehaviour.IsEnabled
=
"True"
abs:RadGridViewKeyboardBehaviour.EnterDirection
=
"MoveNext"
EditTriggers
=
"CellClick"
IsTabStop
=
"True"
DataLoaded
=
"gridChildren_DataLoaded"
>
Is it possible to change this behavior and make tab content static?