Hi,
I have this RadGridView:
This give me something like the image in attachments.
As you can see I have 2 TextBlock for each row (column categories). But I want to fill the GridView table with information that I have in a a class that i created (number of categories is dynamic, so I want the number of TextBlock for each row depends how many categories i have in a list):
How can I solve this problem?
I have this RadGridView:
<
telerik:RadGridView
x:Name
=
"RadGridView1"
GroupRenderMode
=
"Flat"
IsSynchronizedWithCurrentItem
=
"True"
IsReadOnly
=
"True"
AutoGenerateColumns
=
"False"
CanUserFreezeColumns
=
"False"
CanUserResizeColumns
=
"True"
>
<
telerik:RadGridView.Columns
>
<
telerik:GridViewDataColumn
Header
=
"#Case"
DataMemberBinding
=
"{Binding caseId}"
Width
=
"Auto"
></
telerik:GridViewDataColumn
>>
<
telerik:GridViewDataColumn
Name
=
"CategoriesGridViewDataColumn"
Header
=
"Categories"
Width
=
"Auto"
>
<
telerik:GridViewDataColumn.CellTemplate
>
<
DataTemplate
>
<
Grid
Margin
=
"0"
Name
=
"categoriesGird"
>
<
Grid.RowDefinitions
>
<
RowDefinition
Height
=
"1*"
/>
</
Grid.RowDefinitions
>
<
Grid.ColumnDefinitions
>
<
ColumnDefinition
Width
=
"1*"
/>
<
ColumnDefinition
Width
=
"1*"
/>
</
Grid.ColumnDefinitions
>
<
TextBlock
Grid.Row
=
"0"
Grid.Column
=
"0"
Background
=
"Red"
></
TextBlock
>
<
TextBlock
Grid.Row
=
"0"
Grid.Column
=
"1"
Background
=
"Blue"
></
TextBlock
>
</
Grid
>
</
DataTemplate
>
</
telerik:GridViewDataColumn.CellTemplate
>
</
telerik:GridViewDataColumn
>
</
telerik:RadContextMenu.ContextMenu
>
</
telerik:RadGridView
>
This give me something like the image in attachments.
As you can see I have 2 TextBlock for each row (column categories). But I want to fill the GridView table with information that I have in a a class that i created (number of categories is dynamic, so I want the number of TextBlock for each row depends how many categories i have in a list):
public
class
EmailTest
{
public
EmailTest() { }
public
EmailTest(
string
caseId, List<TextBlock> categories)
{
this
.caseId = caseId;
this
.categories= categories;
}
public
string
caseId{
get
;
set
; }
public
List<TextBlock>categories{
get
;
set
; }
}
How can I solve this problem?