Live Chat Icon For mobile
Live Chat Icon

Can I display the rows in my datagrid in a free-form layout using textboxes on a panel

Platform: WinForms| Category: Datagrid

Here is a VB and C# sample showing how you might do this.

The idea is to add textboxes and labels to a panel with whatever layout you want to use.

Then use DataBindings.Add calls to bind the textboxes to columns in your grid (actually in your grid’s datasource). Then, since the grid and the textboxes share the same BindingContext, you can move the BindingManagerBase.Position property to scroll through the rows in your grid, and the textboxes will remain in sync. You can hide the grid just to show the textboxes if you do not want the grid to have a presence. Also, any edits in the textboxes will appear in the DataGrid and vice versa.

Share with

Share on twitter
Share on facebook
Share on linkedin

Related FAQs

Couldn't find the FAQs you're looking for?

Please submit your question and answer.