totalcomplete変数をgridProgressにあるlblCompleteにバインドしたいのですが、その方法がわかりません。誰か助けてもらえますか?
ASPコード:
<asp:GridView ID="gridProgress" runat="server" AutoGenerateColumns="False">
<Columns>
<asp:TemplateField HeaderText="Complete">
<ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="10%" />
<HeaderStyle HorizontalAlign="Center" />
<ItemTemplate>
<asp:Label ID="lblComplete" runat="server"></asp:Label>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
C#コード:
da = new SqlDataAdapter(sql, oConn);
da.Fill(ds);
//count number of tasks completed, not completed
int count = ds.Tables[0].Rows.Count;
string value = ds.Tables[0].Rows[0]["Completed"].ToString();
int completed = 0;
for (int i = 0; i < count; i++)
{
if (value == "No")
{
completed++;
}
int totalcomplete = completed;
//here i want to bind totalcomplete to my lblCompleted
}