public void BindingData() { bool enableCache = (CDHelper.Config.EnableCache == "true"); List <Comments> result = null; List <Comments> list = CommentsHelper.GetAllComments(AccountID, 0, 5); if (list != null) { foreach (Comments comments in list) { if (comments.Content.Length > 25) { comments.Content = comments.Content.Substring(0, 25) + "..."; } } } result = list; DataGridView.DataSource = result; DataGridView.DataBind(); }