Double columns in GridView, building from code behind in C#
<p>I'm trying to fill a GridView with a RadioButton and data from a CreditCardList. However, it's doubling the columns for each field... one full set of columns then another complete set (sans the RadioButton)  I've checked creditCardList.items.Count and made sure it's just 1 (which it is).  What am I doing wrong?</p>

<p>aspx:</p>

<pre><code>&lt;asp:GridView ID="gvCards" runat="server" CellPadding="4" ForeColor="#333333" GridLines="None"&gt;
        &lt;Columns&gt;
            &lt;asp:TemplateField HeaderText="Sel"&gt;
                &lt;ItemTemplate&gt;
                    &lt;asp:RadioButton ID="Sel" runat="server" GroupName="rad" /&gt;
                &lt;/ItemTemplate&gt;
            &lt;/asp:TemplateField&gt;

            &lt;asp:BoundField DataField="Name" HeaderText="Name" /&gt;
            &lt;asp:BoundField DataField="Customer ID"  /&gt;
            &lt;asp:BoundField DataField="Card ID" HeaderText="Card ID" /&gt;
            &lt;asp:BoundField DataField="Card Number" HeaderText="Card Number" /&gt;
            &lt;asp:BoundField DataField="Expiration" HeaderText="Expiration" /&gt;
            &lt;asp:BoundField DataField="State" HeaderText="State" /&gt;
        &lt;/Columns&gt;

    &lt;/asp:GridView&gt;
</code></pre>

<p>Code behind:</p>

<pre><code>DataTable dt = new DataTable();
dt.Columns.Add("Name", typeof(string));
dt.Columns.Add("Customer ID", typeof(string));
dt.Columns.Add("Card ID", typeof(string));
dt.Columns.Add("Card Number", typeof(string));
dt.Columns.Add("Expiration", typeof(string));
dt.Columns.Add("State", typeof(string));
        for (var i = 0; i &lt; creditCardList.items.Count; i++)
        {
            DataRow row1 = dt.NewRow();
            row1["Name"] = creditCardList.items[i].first_name + " " + creditCardList.items[i].last_name;
            row1["Customer ID"] = creditCardList.items[i].external_customer_id;
            row1["Card ID"] = creditCardList.items[i].id;
            row1["Card Number"] = creditCardList.items[i].number;
            row1["Expiration"] = creditCardList.items[i].expire_month + "/" + creditCardList.items[i].expire_year;
            row1["State"] = creditCardList.items[i].state;
            dt.Rows.Add(row1);
        }
        gvCards.DataSource = dt;
        gvCards.DataBind();
</code></pre>

<p>Output:
Sel Name        Card ID Card Number Expiration  State   Name    Customer ID Card ID Card Number Expiration  State
    Steve Ricketts  %40LDN CON  CARD-3F3    xxxxxxxxxxx1000 3/2020  ok  Steve Ricketts  %40LDN CON  CARD-3F3    xxxxxxxxxxx1000 3/2020  ok</p>