Note that there are some explanatory texts on larger screens.

plurals
  1. POI want to bind a arraylist to grid in asp.net c#?
    text
    copied!<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="https://stackoverflow.com/questions/5334859/i-want-to-bind-a-arraylist-to-grid-in-asp-net-c">I want to bind a arraylist to grid in asp.net c#?</a> </p> </blockquote> <pre><code>nsecashservice serviceofgainers = new nsecashservice(); int idd = serviceofgainers.maxID(); System.Collections.ArrayList copygrid = new System.Collections.ArrayList(); System.Collections.ArrayList grid = new System.Collections.ArrayList(); grid = serviceofgainers.getdata(idd); copygrid = grid; System.Collections.ArrayList losers = new System.Collections.ArrayList(); this.dataGridView1.DefaultCellStyle.BackColor = Color.Bisque; dataGridView1.EnableHeadersVisualStyles = false; dataGridView1.ColumnHeadersDefaultCellStyle.BackColor = Color.Salmon; dataGridView1.Columns.Add("Sl.No", "Sl.No"); // Console.WriteLine("column width: " + dataGridView1.Columns[0].Width); dataGridView1.Columns.Add("scripName", "Company"); dataGridView1.Columns.Add("prevClose", "previousClose"); dataGridView1.Columns.Add("closeValue", "closeValue"); dataGridView1.Columns.Add("percentDiff", "percentDiff"); //int row = grid.Count - 1; for (int r = 0; r &lt;= 14; r++) { scripinfo inf = grid[r] as scripinfo; //Console.WriteLine("Row count" + dataGridView1.Rows.Count); dataGridView1.Rows.Add(); dataGridView1.Rows[r].Cells[0].Value = r + 1; dataGridView1.Rows[r].Cells[1].Value = inf.scripName; dataGridView1.Rows[r].Cells[1].Style.ForeColor = System.Drawing.Color.Blue; dataGridView1.Rows[r].Cells[2].Value = Math.Round(inf.prevClose, 2); dataGridView1.Rows[r].Cells[3].Value = Math.Round(inf.closeValue, 2); dataGridView1.Rows[r].Cells[4].Value = Math.Round(inf.percentDiff, 2); dataGridView1.Rows[r].Cells[4].Style.ForeColor = System.Drawing.Color.Green; } </code></pre> <p>this code i have done in window application i want to change it to asp.net c#. in this I am getting an array list of 1500 rows of data containing 4 columns of data. Please help me to to change this code. </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload