Hi. I have a test program written in VS 2005 with a DataGrid in it. The records are fetched from the database but I have a weird problem. The grid does not display the data if it starts with a Less Than symbol '<'. All it shows is a white space. When I check it on VS Visualizer, the data is being fetched correctly with the Less Than symbol.
The reason why I used a DataGrid instead of GridView is because the real application that I'm trying to fix was originally from VS2003 and just migrated to VS2005.
Here is my sample code:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class frmGrid : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
BindData();
}
private void BindData()
{
DatabaseConnection db = new DatabaseConnection();
GridView1.DataSource = db.GetAllClients();
GridView1.DataBind();
}
protected void GridView1_PageIndexChanged(object source, DataGridPageChangedEventArgs e)
{
GridView1.CurrentPageIndex = e.NewPageIndex;
BindData();
}
}