i am trying to create a program that displays some information in a table format. The number of rows of this table can change and therefore the table may or may not be fully vieweable on one viewing of the webpage.
Is there a way where i can show parts of the table over time? For example: show rows 1-30 for 1 minute, then show rows 31-50 for 1 minute, and then back to rows 1-30 for another minute and so forth.
The code i have so far is:
XAML:
<Grid x:Name="LayoutRoot" Background="White">
<Grid.RowDefinitions>
<RowDefinition Height="50"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Grid x:Name="InnerGrid" Grid.Row="1" Background="White">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
</Grid>
</Grid>
using system;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Diagnostics;
namespace MyNameSpace
{
public partial class MainPage : UserControl
{
//The value of numRows will depend on a value from a database, so it may change every once in a while.
int numRows = 45;
Border border = new Border();
Border border2 = new Border();
public MainPage()
{
InitializeComponent();
createRows();
}
public Border initializeBorder(Border b)
{
b.BorderBrush = new SolidColorBrush(Colors.Black);
b.BorderThickness = new Thickness(1);
return b;
}
public void createRows()
{
//This for loop creates the necessary amount of rows.
for (int i = 0; i < numRows; i++)
{
RowDefinition rd = new RowDefinition();
rd.Height = new GridLength(20);
InnerGrid.RowDefinitions.Add(rd);
}
//This for loop creates and applies the borders that make the table "appear"
for (int i = 0; i < numRows; i++)
{
Border b = new Border();
Border b2 = new Border();
Grid.SetColumn(initializeBorder(b), i);
Grid.SetRow(initializeBorder(b2), i);
Grid.SetColumnSpan(b, 11);
Grid.SetColumnSpan(b2, 11);
Grid.SetRowSpan(b, numRows);
Grid.SetRowSpan(b2, numRows);
InnerGrid.Children.Add(b);
InnerGrid.Children.Add(b2);
}
}
}
}