Binding to grids in silverlight
I've just begun learning Silverlight (though I have 3 years C# experience). I'm trying to output a grid that will be used in a work timetracking application. I have a list of objects, each object looks like this
public class WorkItem
{
public int TaskId {get;set;}
public int WeekId {get;set;}
public DateTime Date {get;set;}
public decimal TimeSpent {get;set;}
public string TaskName {get;set;}
}
Obviously I could just set a grid's item source to a list of these objects and I'd end up with them output in some sort of grid. However I am wanting to output as grid with taskNames down the left handside and days of the week across the top. (i.e. just displaying one week at a time). Each cell would then just output a timeSpent value.
I've managed开发者_如何学JAVA to do this in ASP.Net MVC with just html table etc though I'm not really sure where to start with a silverlight version.
If anyone could point me in the right direction it would be much appreciated, (i.e. any pointers on what to read up on etc.)
Came up with my own solution, I just created a separate class that represented each row. The class has properties monday, tuesday wednesday etc that contained one of the objects described above.
精彩评论