Click to See Complete Forum and Search --> : Control in C#


TusharM
February 12th, 2003, 05:09 AM
Hi,All

I am writing Grid Like Control in C#.I am drawing the grid(Rectangles) on control.
i have written a class called CellInfo
class CellInfo
{
int x;
int y;
int width;
int height;
int Data;
Color BackColor;

}
which represents one cell(Rectangle) in the grid.

Now i have Arraylist Cells[Rows],which contains ArrayLists[Columns] of CellInfo objects.

Now i want user should be able to change some properties of CellInfo(e.g. data,BackColor)(one rectangle in Grid)at DesignTime.
Something like Items property in ListView.

How should i declare the property.
If i write the property which returns ArrayList containing CellInfo Objects,it does'nt understand CellInfo!

I hope u understand my Problem!

Thanks
Tushar.

pareshgh
February 12th, 2003, 11:10 AM
first of all (I can't stop writing grid control though) why are you writing (reinventing the wheel) the Grid control when you can customise the DataGrid control.

second thing is from your problem it seems that you have a
just column,
have multi-dimensional array which will occupy columns as well as row.

to do this you will need an arraylist of column and arraylist which will be suitable for rows and add columns in it.

(you will need to think a bit on this but you will get it)

the
[browsable(true)] is the attribute which will show user what you want at design time. and if you want to have a property then declare your objects as property rather than int or string...

hope this helps
Paresh