It depends on what you are using to display the data.
If you are using a DataGridView, then it will provide all the facilities you will need:
MSDN[
^]
"Thanks for Reply. But I am using controls which includes textboxes. I am adding at them at run time. so In that case how can I add columns and row. Please reply"
Sorry? Do I understand you right that you are trying to add rows and columns of textboxes? If so, then why? Why make life difficult for yourself?
You can do it - just create them using
TextBox tb = new TextBox();
Set the Location and Size properties, and add them to the forms Controls list:
for (int i = 0; i < 5; i++)
{
TextBox tb = new TextBox();
tb.Size = new Size(100, 25);
tb.Location = new Point(25, 25 + (i * 30));
Controls.Add(tb);
}
But it's a clumsy, inefficient, and hard-to-maintain way to do it.
Why not use a control that is built to do exactly what you need: provide rows and columns of cells...the DataGridView. It will save you a lot of hassle in the long run...