Is it possible to use indexers
with extension
methods.
eg. Consider it as an example only.
public static object SelectedValue(this DataGridView dgv, string ColumnName)
{
return dgv.SelectedRows[0].Cells[ColumnName].Value;
}
EDIT
usage
mygrid.SelectedValue("mycol")
How to use it as an indexer
mygrid.SelectedValue["mycol"]
rather than above one.Is it possible to use it like this as well ?
mygrid.SelectedValue["mycol"](out somevalue);
What are the syntax of getting this kind of values. Any simple example or link will work.