We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Platform : Windows Forms
|
Category : Datagrid

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

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.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.