Get item text of property grid
Moderators: SDS, support, admin
Get item text of property grid
Hi,
I am geting property grid object values from code
foreach(PropertyDescriptor pd in pdc)
{
object objVal = pd.GetValue(propGrid.SelectedObject);
}
Now I want to get text part also.
Thanks & Regards
Sovan Bera
I am geting property grid object values from code
foreach(PropertyDescriptor pd in pdc)
{
object objVal = pd.GetValue(propGrid.SelectedObject);
}
Now I want to get text part also.
Thanks & Regards
Sovan Bera
Re: Get item text of property grid
Hello.
The property grid object represents the window where the properties of the selected entity can be viewed and modified. You don't need access entities' properties via property grid, you can access them directly from CADImage object via CADImage.Converter.Entities property. Please see help system.
Alexander.
The property grid object represents the window where the properties of the selected entity can be viewed and modified. You don't need access entities' properties via property grid, you can access them directly from CADImage object via CADImage.Converter.Entities property. Please see help system.
Alexander.
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support
Chat support on Skype: cadsofttools.support
Re: Get item text of property grid
Dear Alexander,
this is my first post ever and additionally I'm a newby in VB.NET - so pls. excuse, if the answer on my following question is self-explanatory for everybody else:
I also want to retrieve different properties of an entity selected in the CadEditorControl.
What I did, is to check, if there is any ojecct either in CadEditorControl, CADPictureBox PropertyGrid or CADImage.
I followed your advice from aboveds post to see for a Converter-object in CADImage-class - it is not there.
Pls. give some hints (or better: a short code-example), how to proceed.
By the way: I've purchased a licence for the professional version of CADImport.NET last monday.
Thanks in advance, Thomas
this is my first post ever and additionally I'm a newby in VB.NET - so pls. excuse, if the answer on my following question is self-explanatory for everybody else:
I also want to retrieve different properties of an entity selected in the CadEditorControl.
What I did, is to check, if there is any ojecct either in CadEditorControl, CADPictureBox PropertyGrid or CADImage.
I followed your advice from aboveds post to see for a Converter-object in CADImage-class - it is not there.
Pls. give some hints (or better: a short code-example), how to proceed.
By the way: I've purchased a licence for the professional version of CADImport.NET last monday.
Thanks in advance, Thomas
Re: Get item text of property grid
Hello.
Selected entity or entities can be found in CADImage.SelectedEntities collection. When you use CADEditorControl this collection can be accessed like shown in the following code sample. Please set the code to the new button in CADEditorControl demo project.Compile the project, create one or more entities then select some and click to button. You will see how many entities you selected.
You can access any property of any entity in collection. For example the following change in code:will show selected entity's handle property value if selected entity is Line.
Alexander.
Selected entity or entities can be found in CADImage.SelectedEntities collection. When you use CADEditorControl this collection can be accessed like shown in the following code sample. Please set the code to the new button in CADEditorControl demo project.
Code: Select all
Dim cadImage As CADImport.CADImage
Dim line As CADImport.CADLine
cadImage = Me.cadEditorControl.Image
If Not (cadImage Is Nothing) Then
If Not (cadImage.SelectedEntities Is Nothing) Then
MessageBox.Show(cadImage.SelectedEntities.Count.ToString())
End If
End If
You can access any property of any entity in collection. For example the following change in code:
Code: Select all
...
REM MessageBox.Show(cadImage.SelectedEntities.Count.ToString())
If (cadImage.SelectedEntities(0).EntType = CADImport.EntityType.Line) Then
line = cadImage.SelectedEntities(0)
MessageBox.Show(line.Handle.ToString())
End If
...
Alexander.
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support
Chat support on Skype: cadsofttools.support