我已经用数据填充了listBox并将其分配给gridview,但它并没有。我通过将列表的数量设置为变量进行验证,它显示3,完美但在将其分配给gridview后,gridview的计数显示为0.为什么?
protected void btnShowTempFeatures_Click(object sender, EventArgs e)
{
try
{
int count = ListBoxFeatures.Items.Count; //returns 3
grdViewTemporaryFeatures.DataSource = ListBoxFeatures.DataSource;
grdViewTemporaryFeatures.DataBind();
int CountGrid= grdViewTemporaryFeatures.Rows.Count; //return 0
}
}
答案 0 :(得分:1)
解决了
sort