I have a grid view code below which have divided into 3 column. But i have a problem with the code is that. When multiple data is retrieved
A stack panel would have your items display one above the other, though, you may lose relationships between the 3 columns. You could also simply set the grid.row to an index.
int i = 0;
foreach (var title in titleSpan)
{
{...}
Grid.SetColumn(titleTxtBlock, 1);
Grid.SetRow(titleTxtBlock, i);
schedule.Children.Add(titleTxtBlock);
}
Do that for each of your for loops and you'll keep the relationship between the elements. If there isn't a relationship between your elements (ie, the first title isn't related to the first category which isnt' related to the first time) then a stackpanel will likely be the best way to go.