Answer the question
In order to leave comments, you need to log in
How to find component in DataTeplate?
So. We have a table (telerik: RadGridView), columns are dynamically added to it:
IrregGridView.Columns.Add(new GridViewDataColumn()
{
UniqueName = string.Format("Column{0}",x.DayNumber),
Header = x.DayNumber.ToString(),
HeaderTextAlignment = TextAlignment.Center,
TextAlignment = TextAlignment.Center,
Width = GridViewLength.Auto,
MaxWidth = 90,
IsFilterable = false,
CellTemplate = (System.Windows.DataTemplate)
XamlReader.Load(string.Format(@"<DataTemplate
xmlns='http://schemas.microsoft.com/client/2007'
xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml'>
<StackPanel Orientation=""Vertical"" Margin=""-2,0,-2,0"" MinWidth=""38"">
<TextBox Text=""{{Binding Path=Results[{0}].ModelVLimit}}"" />
<TextBox Text=""{{Binding Path=Results[{0}].ModelVSum}}""/>
<TextBox Name=""tbVLimit{0}"" Text=""{{Binding Path=Results[{0}].VLimit, Mode=TwoWay}}"" />
<TextBox Text=""{{Binding Path=Results[{0}].VSum, Mode=TwoWay}}"" />
</StackPanel>
</DataTemplate>", x.DayNumber-1)) });
var column=IrregGridView.Columns[string.Format("Column{0}", x.DayNumber)];
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question