Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Best "grid" component for editing recordset with columns NOT in order 2

Status
Not open for further replies.

UBfoolin

Programmer
Nov 29, 2001
32
US
What is the best data "grid" type component to use? My users need to edit, insert and delete records. I am using ADO recordsets pulled from a mySQL data base. It is a hard requirement that I rearrange the order of the columns\fields. When the user sees the grid, the columns need to be in the specified order, which is NOT the same as the field order of the underlying table.

I have tried a datagrid and made some of the columns invisible, but don't know how to rearrange the remaining columns. I'm trying MSFlexGrid now, but don't think I can rearrange columns in it either.

HELP!

Thank you.
 
Janus is good. You can put the columns in any order you wish. Also the users can re-order them, sort up and down and group by them. Peter Meachem
peter @ accuflight.com

 
You can use the MSFlexGrid to accomplish what you need. The grid will have to be UNBOUND. You get your data and place it in an array. Then loop through the array to fill the grid. You use the formatstring property to set your column names and order. To make it editable you will need to add a floating text box.

It all sounds complicated but is really very simple. If you are interested in this method I can send you a small test project that will demonstrate this. Just all your email address to your reply. Thanks and Good Luck!

zemp
 
zemp,

Thanks so much. You can email me directly at dje60@aol.com. I've been playing with the MSFlexGrid and would really appreciate your test project.

Thanks.

 
I agree with Peters recommendation, go with Janus. It handles all the data for you. Zemp is quite right that the flex grid can be setup as an editable grid using text boxes positioned over the cells, although it works I feel it makes the app look a tad clunky in operation. If you do go this route it is slow to load especially if 100's or 1000's of records are to be shown.

Regards,
Nick Winslade.
nickwinslade@msn.com
 
If you want to use the DataGrid and have the columns in a certain order, and only need certain field, just set the recordset that the grid is bound to with the correct fields and their order.

If you are using a DataControl, then set the RecordSource property to something like:

SELECT Field2, Field4, Field1 FROM myTable

Replacing myTable with the correct table name and FieldX with the correct field names.

The grid with be (in the above example) made up of 3 selected fields from the table and will display in the order given in the SELECT staement. [/b][/i][/u]*******************************************************[sub]
General remarks:
If this post contains any suggestions for the use or distribution of code, components or files of any sort, it is still your responsibility to assure that you have the proper license and distribution rights to do so!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top