开发者

Which types use a FileNameEditor in a PropertyGrid?

开发者 https://www.devze.com 2022-12-30 03:10 出处:网络
I need to change the editor for a property attached to a .net PropertyGrid,开发者_StackOverflow社区 but I cannot set the Editor attribute of that property, because the property was generated by a tool

I need to change the editor for a property attached to a .net PropertyGrid,开发者_StackOverflow社区 but I cannot set the Editor attribute of that property, because the property was generated by a tool, including all attributes.

The desired editor is

System.Windows.Forms.Design.FileNameEditor

I can find many tutorials on the web to assign this editor to string properties by setting the editor attribute, but I cannot set the editor attribute in this case. However, I can advise the code generation tool to behave such that the string property which I want to be edited with the FileNameEditor becomes converted to another property with different type.

In order to do so, I would need to know which type is edited by the FileNameEditor as default. I didn't find any list on the web which would tell me for a given editor which types employ this editor automatically when displayed in a PropertyGrid.


This editor works with strings only and is not attached automatically to any other type.


According to Reflector, it's used only for 2 properties :

  • SqlConnectionStringBuilder.AttachDBFileName
  • OleDbConnectionStringBuilder.FileName
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号