Users will want to change column width's, and if you
don't let them, they'll consider it obnoxious. It's too
ingrained in folks these days.
I totally agree with the other two posts.
Either hide it totally...
http://www.c-
sharpcorner.com/FAQ/Part1Howdos.asp
Or use a query on the DB side to limit the data from
coming in at all. For instance, if you pull back a
DataTime and you don't want time, specify that in your
query.....NEt will acknoledge its type if you use Parse().
Trapping the resize event is the 3:33t programmer way of
doing it and it's an excellent method if you Really need
to stop it. Similarly,you could subclass the grid, and
override column resizing in your class.
However, a lot of people spent a lot of time building
that functionality into the grid and users from people
who use Enterprise Manager to Excel and everyone in
between are used to it.... I don't know that I'd put a
lot of effort into reducing functionality. Whatever the
reason is for not allowing the resize, there's probably
another way to get there without hitting the grid.
BTW, you posted b/c you need a solution, not a lecture,
so if it sounded like one....didn't mean to. The last
thing developers usually want to here is 'why do you want
to do that'. If you need help with the subclassing, SQL
or trapping the event, I'll be glad to assist.
Good Luck,
Bill
Cordially,
W.G. Ryan
(e-mail address removed)
www.knowdotnet.com