I'm using a gridview that is working off an object data source. The object data source is connected to my class library, which has a function that delivers a data table to the gridview. This is the function:
public DataTable populateGrid(string command)
{
DB db = new DB();
SqlDataAdapter myAdapter = new SqlDataAdapter(command, db.getConn(connString));
DataTable t = new DataTable();
myAdapter.Fill(t);
return t;
}
The gridview is populated by my data table, but I want to make certain columns of the gridview read-only. How do I do this?
NOTE: I cant add the ReadOnly=true property since the gridview isnt creating any bound fields for some reason.