Autor Beitrag
erfahrener Neuling
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 233
Erhaltene Danke: 19

Win 7, Win 10
C#, ASP-MVC (VS 2017 Community), MS SQL, Firebird SQL
BeitragVerfasst: Di 12.04.16 13:20 
Hallo,

ich habe ein PropertyGrid, in dem verschiedene Eigenschaften angezeigt werden. Nun habe ich eine Eigenschaft, welche in mehreren Zeilen angezeigt werden soll. Ich habe schon überall geguckt, aber außer mir eine eigene PropertyGrid-Klasse zu erstellen (was ich nicht kann), hab ich nichts gefunden.

Bitte helft mir mit allem, was ihr wisst! Ich wäre euch sehr dankbar!

EDIT: Zeilenumbruch eines strings, wenn dieser an die Grenze der Property-Zelle gerät


Zuletzt bearbeitet von erfahrener Neuling am Di 12.04.16 13:30, insgesamt 1-mal bearbeitet
Ralf Jansen
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 4708
Erhaltene Danke: 991


VS2010 Pro, VS2012 Pro, VS2013 Pro, VS2015 Pro, Delphi 7 Pro
BeitragVerfasst: Di 12.04.16 13:23 
Wir brauchen mehr Details. Was meinst du genau mit mehreren Zeilen? Ist es eine komplexe Eigenschaft mit Untereigenschaften die in eigenen Zeilen angezeigt werden sollen oder geht es um Zeilenumbrüche in einem Text oder oder oder ....
erfahrener Neuling Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 233
Erhaltene Danke: 19

Win 7, Win 10
C#, ASP-MVC (VS 2017 Community), MS SQL, Firebird SQL
BeitragVerfasst: Di 12.04.16 13:29 
Es geht darum, dass wenn ein string eine bestimmte Länge überschreitet, ein Zeilenumbruch geschehen soll. (Vergleichbar mit Multiline-Eigenschaft einer Richtextbox)
Ralf Jansen
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 4708
Erhaltene Danke: 991


VS2010 Pro, VS2012 Pro, VS2013 Pro, VS2015 Pro, Delphi 7 Pro
BeitragVerfasst: Di 12.04.16 14:23 
Das geht nur im Editor den man im PropertyGrid öffnen kann nicht in der Zelle selbst.
erfahrener Neuling Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 233
Erhaltene Danke: 19

Win 7, Win 10
C#, ASP-MVC (VS 2017 Community), MS SQL, Firebird SQL
BeitragVerfasst: Di 12.04.16 15:55 
Ok ich werd mal gucken, was ich dazu finde
Ralf Jansen
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 4708
Erhaltene Danke: 991


VS2010 Pro, VS2012 Pro, VS2013 Pro, VS2015 Pro, Delphi 7 Pro
BeitragVerfasst: Di 12.04.16 16:08 
Du mußt in deiner Klasse einfach nur die Property attributieren so das der passende Editor benutzt wird

ausblenden C#-Quelltext
1:
2:
[Editor(typeof(MultilineStringEditor), typeof(UITypeEditor))]
public string MeinLieberMerzeiligerText { get; set; }


Wobei ich vermute das der MultilineStringEditor einfach nur mehrzeilig ist aber kein WordWrap unterstütz. Das müßtest du dann selbst programmieren.

Edit: Beispiel
stackoverflow.com/qu...ng-in-a-propertygrid

Da müßtest du wahrscheinlich an der textEditorBox nur noch WordWrap einschalten.

Für diesen Beitrag haben gedankt: erfahrener Neuling
erfahrener Neuling Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 233
Erhaltene Danke: 19

Win 7, Win 10
C#, ASP-MVC (VS 2017 Community), MS SQL, Firebird SQL
BeitragVerfasst: Mi 13.04.16 09:04 
Hi danke dafür. Aber welche Using-Direktiven verwendest du dafür (MultilineStringEditor + UITypeEditor)? Ich habe nur Microsoft.Practices.EnterpriseLibrary.Configuration.Design.ComponentModel.Editors gefunden, aber wo kriege ich die dll dafür her?
Ralf Jansen
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 4708
Erhaltene Danke: 991


VS2010 Pro, VS2012 Pro, VS2013 Pro, VS2015 Pro, Delphi 7 Pro
BeitragVerfasst: Mi 13.04.16 09:36 
Laut Hilfe liegt die Klasse in der System.Design Assemlby die müßtest du also erstmal referenzieren. Und der Namespace für dein using wäre laut Hilfe System.ComponentModel.

Für diesen Beitrag haben gedankt: erfahrener Neuling
erfahrener Neuling Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 233
Erhaltene Danke: 19

Win 7, Win 10
C#, ASP-MVC (VS 2017 Community), MS SQL, Firebird SQL
BeitragVerfasst: Mi 13.04.16 09:59 
ja passt :)

die korrekten using-direktiven waren jetzt:
System.ComponentModel.Design für MultiLineStringEditor und
System.Drawing.Design für UITypeEditor

Jetzt kann ich weitermachen :mrgreen: