jonorossi Posted May 12, 2005 Posted May 12, 2005 Can you use the DataGrid control for non-bound data? Eg. Use it like you would a ListBox and add items? Quote
Phylum Posted May 16, 2005 Posted May 16, 2005 Simply fill a DataSet with the info you want and then bind it to the datagrid. Voila, no DB needed :) ... Quote
AlexCode Posted May 16, 2005 Posted May 16, 2005 Just to add... Datasource of a grid can either be a collection... You can create a class, put some properties in it (note that only properties will appear as columns), and then instanciate a collection os that class and there you go... Alex :p Quote Software bugs are impossible to detect by anybody except the end user.
jonorossi Posted May 17, 2005 Author Posted May 17, 2005 Thanks but it is a little late, i worked out a similar way to what AlexCode said. I created a class and is an IList (ArrayList). Then i set the datasource to the ArrayList. I still have a problem though. When you have a class the columns are in order from A-Z because they are properties. I haven't been able to find information on using DataGridTableStyle which i think your are meant to use. I am also trying to delete an item from the list. I have tried DatGrid1.DataBindings.RemoveAt(index) but it doesn't have any items. Currently i am unbinding the DataGrid, removing the item and rebinding. Please help Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.