0

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.

2
Contributors
3
Replies
4
Views
6 Years
Discussion Span
Last Post by dnanetwork
0

binding of gridview is done using adapter
is colums are autogenerated / you are using ItemTemplate..

also does you grid involve any edit & delete operations..?

0

is colums are autogenerated / you are using ItemTemplate..

also does you grid involve any edit & delete operations..?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.