Click here to Skip to main content
15,897,032 members
Home / Discussions / C#
   

C#

 
AnswerRe: string ctor?? Pin
Nick Parker18-Oct-04 15:29
protectorNick Parker18-Oct-04 15:29 
GeneralRe: string ctor?? Pin
HahnTech18-Oct-04 16:28
HahnTech18-Oct-04 16:28 
GeneralRe: string ctor?? Pin
Nick Parker18-Oct-04 18:08
protectorNick Parker18-Oct-04 18:08 
Questionhow to make list in property grid? Pin
AlanJones18-Oct-04 11:10
AlanJones18-Oct-04 11:10 
AnswerRe: how to make list in property grid? Pin
Heath Stewart18-Oct-04 11:46
protectorHeath Stewart18-Oct-04 11:46 
GeneralRe: how to make list in property grid? Pin
AlanJones19-Oct-04 10:01
AlanJones19-Oct-04 10:01 
GeneralRe: how to make list in property grid? Pin
Heath Stewart19-Oct-04 11:07
protectorHeath Stewart19-Oct-04 11:07 
GeneralRe: how to make list in property grid? Pin
AlanJones23-Oct-04 13:00
AlanJones23-Oct-04 13:00 
Thanks for telling about this:read the C# Language Specification[^], specifically about Interfaces[^]. and it helped me alot but it didnt help me with my current problem. I did what I still trying to get any results from PropertyDescriptorCollection in propertygrid, but all I got is blank. I followed your suggestions and I got it all in collection from arrays.


public class CMainForm : System.Windows.Forms.Form
{
public void ShowPropertyGrid()//init. propertygrid with datas and objects
{
ArrayList arrayList = .....///stored the arraylist from other class
foreach(ILogical pILogical in arrayList
{
string[] strHeaderArray = null;
((IEVHeaderItem)pILogical).GetHeaderDetails(out strHeaderArray);
SubListInfo.Lists.List = "List" + nCount;);///List1, List2, List3,....
SubListInfo.Lists.Type = pILogical.Type;
for(int i=0; i < strHeaderArray.Length; i++)
{
string strValue;
((IEVHeaderItem)pILogical).GetDetailColumn(i, out strValue);
if(i == 3)
ListInfo.Lists.Color = strValue;
........
}
}
}
}


[TypeConverter(typeof(SurfaceConverter))]
public class SubListInfo : SubListData
{
private int m_nID = 0;
private string m_strColor = "";
.......
public SubListInfo()
{
}
[ReadOnly(true)]
public string Color
{
get { return m_strColor; }
set { m_strColor = value; }
}
..........
}
public class SubListData
{
private string m_strList = "";
......
public SubListData() {}

[Browsable(false)]
public string List
{
get { return m_strList; }
set { m_strList = value; }
}
....
}



public class CListInfo : ICustomTypeDescriptor
{
private ArrayList m_arrayList;
#region ICUSTOMTYPEDESCRIPTOR
public String GetClassName()
{
return TypeDescriptor.GetClassName(this,true);
}
... I followed those rest of them like you said from previous message.
public TypeConverter GetConverter()
{ return TypeDescriptor.GetConverter(this, true); }

public PropertyDescriptorCollection GetProperties()
{ return GetProperties(null); }

[TypeConverter(typeof(ListConverter))]
public PropertyDescriptorCollection GetProperties()
{
PropertyDescriptorCollection pds = new PropertyDescriptorCollection(null);
for(int i = 0; i < m_data.Count; i++)
{
SurfaceCollectionDesc pd = new SurfaceCollectionDesc(m_data,i);
pds.Add(pd);
}
return pds;

}
#endregion

}

internal class ListConverter : ExpandableObjectConverter
{
public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType )
{
if( destType == typeof(string) && value is SurfaceInfo )
{
ListInfo emp = (ListInfo)value;
return emp.List;///List1, List2, List3,....
}
return base.ConvertTo(context,culture,value,destType);
}
}


I tried to used those codes(below) if its collection(there is three lists for now) is working or not. so it showed only last List(List3) and it didnt displayed first two lists.

[TypeConverter(typeof(ListConverter))]//,CategoryAttribute("Lists")]
public SubListInfo Lists
{
get
{
return subLists;
}
}//////it showed only last List(List3)

Did I miss something important about PropertyDescriptorCollection or TypeConverter
that displays whole lists? I may overlooking something that I alway do that. Sigh | :sigh:
GeneralUsing SignatureCapturing in PocketPc Pin
mathon18-Oct-04 10:26
mathon18-Oct-04 10:26 
GeneralRe: Using SignatureCapturing in PocketPc Pin
Nick Parker18-Oct-04 15:37
protectorNick Parker18-Oct-04 15:37 
GeneralDataGrid Set Column Width Pin
mfcuser18-Oct-04 10:03
mfcuser18-Oct-04 10:03 
GeneralRe: DataGrid Set Column Width Pin
Heath Stewart18-Oct-04 11:53
protectorHeath Stewart18-Oct-04 11:53 
GeneralRe: DataGrid Set Column Width Pin
mfcuser19-Oct-04 8:03
mfcuser19-Oct-04 8:03 
GeneralRe: DataGrid Set Column Width Pin
Heath Stewart19-Oct-04 12:44
protectorHeath Stewart19-Oct-04 12:44 
GeneralText on Image control Pin
JAntonaccio18-Oct-04 9:31
JAntonaccio18-Oct-04 9:31 
GeneralRe: Text on Image control Pin
Heath Stewart18-Oct-04 11:50
protectorHeath Stewart18-Oct-04 11:50 
GeneralNtier app Pin
StephenMcAllister18-Oct-04 7:55
StephenMcAllister18-Oct-04 7:55 
GeneralRe: Ntier app Pin
Christian Graus18-Oct-04 10:08
protectorChristian Graus18-Oct-04 10:08 
GeneralRe: Ntier app Pin
Colin Angus Mackay18-Oct-04 11:46
Colin Angus Mackay18-Oct-04 11:46 
GeneralRe: Ntier app Pin
StephenMcAllister18-Oct-04 16:28
StephenMcAllister18-Oct-04 16:28 
GeneralRe: Ntier app Pin
Salil Khedkar19-Oct-04 22:40
Salil Khedkar19-Oct-04 22:40 
GeneralRe: Ntier app Pin
Carl Mercier21-Oct-04 18:50
Carl Mercier21-Oct-04 18:50 
GeneralRe: Ntier app Pin
StephenMcAllister23-Oct-04 7:53
StephenMcAllister23-Oct-04 7:53 
GeneralAdjusting the columns on the datagrid Pin
steve_rm18-Oct-04 5:54
steve_rm18-Oct-04 5:54 
GeneralRe: Adjusting the columns on the datagrid Pin
Heath Stewart18-Oct-04 7:31
protectorHeath Stewart18-Oct-04 7:31 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.