1

我有一个gridview,它有一个对象列表的数据源。但它似乎在 DataBind 步骤上有问题。它不会在网站上显示任何内容。

List<StringTR> strResult_List = new List<StringTR>();

foreach (TSService.STs ST in ST_Returned_list) //I'm converting ST_Returned_list to StringResult as ST_Returned_list has some custom type fields and they are not working with Gridview
{
    strResult_List.Add(new StringResult(ST));
}

ResultsGridView.DataSource = strResult_List;
                    ResultsGridView.DataBind(); // this is where it is failing. when I step through it, it says "Step into: Stepping over method without symbols" 


public class StringResult
    {
         string str_SName { get; set; }
         string IPAddressUsed { get; set; }
         string BTypeUsed { get; set; }
         string SResult { get; set; }

        public StringResult(TestScriptsService.Sel_Test ST)
        {

                str_SName = ST.SName.ToString();
                IPAddressUsed = ST.IPAddressUsed;
                BTypeUsed = ST.BTypeUsed.ToString();
                SResult = ST.SResult.ToString();

        }
    }
4

1 回答 1

0

在数据绑定步骤放置一个断点并检查数据源中的内容。这将消除疑虑。

于 2013-02-16T13:00:52.320 回答