I've 3 different DATA will load dynamic to _ListView.
With DATA1 I need to add more column for showing checkbox control in every row.
I can't get it work, output shows CheckBox as String like below
detail of CS file:
public void DataLoad1()
{
var rowDT = data.GetListData();
string[] str = new string[rowDT.Columns.Count];
// loop data
foreach (DataRow row in rowDT.Rows)
{
for (int i = 0; i <= rowDT.Columns.Count - 1; i++)
{
str[i] = row[i].ToString();
}
// create checkbox
CheckBox chk = new CheckBox
{
// checkbox properties
Content = str[0],
IsChecked = false,
IsEnabled = true
};
_listView.Items.Add(
new
{
chkBox = chk,
DocNo = str[0],
QtyReq = str[1],
Price = help.ThousandSeparator(str[2]),
Date = help.ConvertDate(str[3]),
Status = help.ConvertStatus(str[4]),
Confirm = help.ConvertConfirmed(str[5])
}
);
}
}
here is detail of XAML file :
<ListView x:Name="_listView" Height="365" Background="{DynamicResource {x:Static SystemColors.ControlBrushKey}}">
<ListView.ItemContainerStyle>
<Style TargetType="{x:Type ListViewItem}">
<Setter Property="BorderBrush" Value="LightGray" />
<Setter Property="BorderThickness" Value="0,0,1,1" />
</Style>
</ListView.ItemContainerStyle>
</ListView>
is it possible i can achieve this without editing XAML file?
