DataGrid datagridtextcolumn
public class TaskTable
{
public string cID { get; set; }
public string cName { get; set; }
}
List<TaskTable> t = new List<TaskTable>();
t.Add(new TaskTable { cName = "aa", cID = "2" });
dataTable.ItemsSource = t;
<data:DataGrid x:Name="dataTable" Margin="0,50,0,0" >
<data:DataGrid.Columns>
<data:DataGridTextColumn Header="cID" Binding="{Binding cID}" />
<data:DataGridTextColumn Header="cName" Binding="{Binding cName}" />
</data:DataGrid.Columns>
</data:DataGrid>
错误信息
unhandled error in silverlight 2 application datagridtextcolumn 不支持将 作为内容
[解决办法]
没发现什么错误,应该是跟放在ChildWindow里有关,你放在其他地方看看