datagridview - C# extend indexer? -


Is it possible to use expansion methods to expand the index? I want to be able to get the value of the cell from DataGridViewCell of the given DataGridViewCell using header text like this:

 object o = line ["HeaderText"];  

I have this code

 Public Static Class Extension {Public Data Object Cell (This Datagate WeaverRo R, String Header) {foreach (DataGridViewCell c in r.Cells) {if ( C. OwningColumn.HeaderText == header) {return c.value; }} Return tap; }}  

And I want a similar index. Thank you.

The index really has properties, and the extension properties are not present in the C #. So, the way you want to do it, can not be done.

Look for some background on this topic, and tell why that feature was considered, but eventually dropped from C # 3.0.

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -