<p>Using an ORM approach in applications can often lead to the scenario where you have a collection of objects you've retrieved and would like to display them in a tabular view using a DataGridView.</p>

<p>In my (limited) experience, binding collections of objects using a custom BindingList to a DataGridView results in poor performance and unsatisfactory sorting.  I'm looking for a generic solution to this problem such that it's straightforward to populate a DataGridView and also extract the underlying objects later.</p>

<p>I will describe a good solution I've found, but I'm looking for alternatives.</p>

I don't think the language supports a construct like this. The only way I can see to generalize this in any way is:
```
```
def foo(prompt)
  prompt.echo = false
end
new_pass = ask("Enter your new password: ") { |prompt| foo(prompt) }
verify_pass = ask("Enter again to verify: ") { |prompt| foo(prompt) }
```
```
It doesn't really shorten the code, though it does remove some duplication--if you wanted to do more than set
```
prompt.echo
```
to
```
false
```
, you'd only have to add code in one place.