Save classes in Datagrid 
Author Message
 Save classes in Datagrid

Hy!

I got a UserControl, which Ive made from the .NET Datgrid. I made this
because we wanted ComboBoxes, CheckBoxes and so on in the grid and I dont
like the .NET Datgrid.
In my Project for each row in the Grid I use an Instance of a class. Now I
want to save the Instance in the specified Row somehow. The problem is I
dont have any ideas how I can do this.
I think of somehing like the Tag fom the treeView.

Anybody Good ideas?

Ronny



Sun, 22 May 2005 23:45:21 GMT  
 Save classes in Datagrid
Ronald,

    What do you mean you want to save the instance?  If you are using
classes as your data source, then when you change the value in the grid, the
underlying value in the instance will be changed as well.  Or do you want to
save it to some other medium?  If that is the case, then I would look into
serialization.

    Hope this helps.

--
               - Nicholas Paldino [.NET/C# MVP]


Quote:
> Hy!

> I got a UserControl, which Ive made from the .NET Datgrid. I made this
> because we wanted ComboBoxes, CheckBoxes and so on in the grid and I dont
> like the .NET Datgrid.
> In my Project for each row in the Grid I use an Instance of a class. Now I
> want to save the Instance in the specified Row somehow. The problem is I
> dont have any ideas how I can do this.
> I think of somehing like the Tag fom the treeView.

> Anybody Good ideas?

> Ronny



Sun, 22 May 2005 23:50:05 GMT  
 Save classes in Datagrid
Hy!

Let me explain it:
I got a form in which I got my DAtagrid. Then Ive got a class A which
returns me one row for the DAtagrid.
In the form I make an Instance of the class A for each row and set the data
to the grid.

My problem is that i want to save the Instance of the Loader class A somehow
in the row. I could realize this by adding some kind of Collection to the
Form but then I got to update it everytime when IO change the grid.

Ronny



Quote:
> Ronald,

>     What do you mean you want to save the instance?  If you are using
> classes as your data source, then when you change the value in the grid,
the
> underlying value in the instance will be changed as well.  Or do you want
to
> save it to some other medium?  If that is the case, then I would look into
> serialization.

>     Hope this helps.

> --
>                - Nicholas Paldino [.NET/C# MVP]



> > Hy!

> > I got a UserControl, which Ive made from the .NET Datgrid. I made this
> > because we wanted ComboBoxes, CheckBoxes and so on in the grid and I
dont
> > like the .NET Datgrid.
> > In my Project for each row in the Grid I use an Instance of a class. Now
I
> > want to save the Instance in the specified Row somehow. The problem is I
> > dont have any ideas how I can do this.
> > I think of somehing like the Tag fom the treeView.

> > Anybody Good ideas?

> > Ronny



Mon, 23 May 2005 19:11:53 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. datagrid: how to get a class to display in a datagrid

2. Saving changes made in a DataGrid

3. Saving from a datagrid

4. Binding a DataGrid Web Control to a Collection of Custom Classes

5. Problems with DataGrid in a View class

6. any way to make the scroll in one datagrid bind to the scroll in another datagrid

7. changing row colors in DataGrid (not a web DataGrid)

8. XMLSerializer to save a class instance

9. Small Question: Saving parts of classes/structs

10. Saving and retrieving Ole-Automation objects from Dao and MFC using CLongBinary class

11. saving class containing pointers

12. How to trace save/saveas in base class

 

 
Powered by phpBB® Forum Software