Windows Develop Bookmark and Share   
 index > Windows Forms Data Controls and Databinding > DataGrid - Unbound Mode?
 

DataGrid - Unbound Mode?

I have an app that I am porting from VB5.  In it, I used an unbound grid to display a seating arrangement.  It allows people to be moved around the seating chart by right clicking a cell and selecting from a drop down list for seating.  Alternately, the user can select to delete a person from being seated.  The data was not bound because it is not stored in a row/col format that directly relates to the grid.  Instead, the data is stored as individual seating records for each person w/ a row and col value for each record.  I wrote the code to build the grid and display the info as well as the code to edit the dataset and re-display.  Now for my question...

Is there a way to work w/ the DataGrid control in an unbound mode?  I found the flexGrid ctl from ComponentOne Studio.Net.  I downloaded their trial version and it does what I want (i.e. unbound, add rows, add cols, and programmatically change cell values).  However, they have a steep price tag for me, ~$500US.  Can I do these sorts of things w/ the native DataGrid?  Please provide a link or ref if you have one.  Does anyone know of freeware versions?  Or, does anyone know of any cheaper versions (e.g. < $100US)?  Again, any links would be greatly appreciated.

The other tact that I have kicked around is to rearrange the data into a table compatible w/ binding to the DataGrid.  The only problem is that this is realtively circuitous.  It will shorten the time in getting data into the grid.  But, it creates a new problem.  How do I go about synching the temporary display table back w/ the original dataset tables?  Also, I think this will make porting some of the business logic (e.g. one seat per person, or one person per seat, etc.) more difficult.  Any thoughts on this will also be appreciated.

Finally, I should mention that I am also working to port the whole app to the Web in an ASP.Net scenario.  However, functionality like the seating chart will likely be served as a Web Deployed exe.  So, however I address this, it needs to be functional in a Web case.  For example, a web service will be used to supply disconnected data to the grid and allow updates to be sent back.  So, I have my work cut out for me and any assitance will be greatly appreciated...

-Jeff
MigrationUser 1  Wednesday, February 05, 2003 1:32 PM
Jeff-
This is a very interesting conundrum. i don't have an exact answer, but just wanted to add some thoughts for you.

First, a possible grid, though it doesn't meet your $$$ specs is Janus GridEx. It goes for $250. It is what I chose after battling with the DataGrid over some other issues for a while. I have not tried to use it without a dataset, but the first sentence in the description is "Add versatile data-bound or unbound grids." It is a great grid and I got a lot of input from friends in other .NET User Groups (I run one in Vermont) which is how I was pointed to Janus.

I totally understand what you are doing, because I have a VB6 that does something similar wtih a complicated grid that I manually populate and manipulate. But I used the flexgrid for that.

I have not had a need to do this in any of my WinForms apps as of yet. But out of curiousity I have just perused through the help file, and it looks like this is totally true! It says that all of the data manipulation happens in the dataset and the datagrid is just the UI to the dataset. I can't see (with the small amount of time I have spent) any references to some of the tools you would need to manually populate the grid. For example, AllowAddNew is gone.

Well, I hope you find some help in my musings.

julie lerman
MigrationUser 1  Thursday, February 13, 2003 10:28 PM
You're correct here (good to see you here, as well! This is my first visit), as far as I know. That is, the DataGrid control just provides a front end to some object that implements the IList or IListSource interface, including DataTable, DataView, DataSet, DataViewManager, and other objects. OTOH, one could always write code to fill a DataTable, or even a class of your own that implements IList, and bind the grid to that. That is, if you just want to display unbound data, the DataGrid control can certainly do it, albeit in a different way than in VB5/6. -- Ken
MigrationUser 1  Monday, February 17, 2003 4:58 PM

You can use google to search for other answers

Custom Search

More Threads

• Moving back and forth between records in a DataView
• Update database
• SQL Server Bulk Copy through Windows Forms
• DataGridView deleting while editing.
• Reading records from a .csv or a .txt file
• Advice requested: Windows Forms Binding:
• datagridview not updating correctly (row selection blocking?)
• Any Event which automatically fires after ItemCheck in checked listview
• random appearance of datagridview coloumn in DataSet (even when visible is set to "False")
• Search for a value in a DataGrid Column.