G
Greg Smith
Hi, I am working on my first web app that uses a datagrid. I can't seem to
find good examples of formatting the grid the way you can in a Windows
application. I am trying to do the following:
private void Page_Load(object sender, System.EventArgs e)
{
string strConnection = "blah, blah blah";
string strSQL = "SELECT RecordID, IP, UserFullName, MachineName,
NodeNumber, SubGroup, MachineLocation, JackNumber, MAC, ServiceTag FROM
tblInfo ORDER BY NodeNumber";
SqlConnection cn = new SqlConnection(strConnection);
SqlCommand cmd = new SqlCommand(strSQL, cn);
cn.Open();
dg.DataSource = cmd.ExecuteReader();
dg.DataBind();
cn.Close();
// dg.<something to make the first column, 'RecordID', not visible>
// dg.<something to change the width of column 'IP'>
// dg.<something to change the column header for 'UserFullName'>
}
Any help is greatly appreciated .
find good examples of formatting the grid the way you can in a Windows
application. I am trying to do the following:
private void Page_Load(object sender, System.EventArgs e)
{
string strConnection = "blah, blah blah";
string strSQL = "SELECT RecordID, IP, UserFullName, MachineName,
NodeNumber, SubGroup, MachineLocation, JackNumber, MAC, ServiceTag FROM
tblInfo ORDER BY NodeNumber";
SqlConnection cn = new SqlConnection(strConnection);
SqlCommand cmd = new SqlCommand(strSQL, cn);
cn.Open();
dg.DataSource = cmd.ExecuteReader();
dg.DataBind();
cn.Close();
// dg.<something to make the first column, 'RecordID', not visible>
// dg.<something to change the width of column 'IP'>
// dg.<something to change the column header for 'UserFullName'>
}
Any help is greatly appreciated .