An interesting issue came up today that, although it now looks simple, did not have an immediately obvious solution. Specifically, what if you want to set properties of individual columns of a GridView at run-time (via C# code) rather than at design time in the aspx code. For example, let's say you want to set the DataFormatString property of a BoundField column. In short, it is a 2-part solution. First, you must positionally extract your column out of the GridView's Columns property while casting ......
Often when a new language features come out (in this case anonymous method) we often see syntax examples like this: delegate void SomeDelegate();public void InvokeMethod(){ SomeDelegate del = delegate() { MessageBox.Show("Hello"); }; del(); } and we say, great but when is code like THAT ever going to be useful to me? In that trivial example, of course that's not very useful. But when you consider the power anonymous methods gives you both to pass in parameters and also make use of local objects then ......