Windows Develop Bookmark and Share   
 index > Windows Forms General > Restoring the UI (width) changes in datagrid after refresh
 

Restoring the UI (width) changes in datagrid after refresh

Hi,

How to restore the UI changes like explicit change of width by user in data grid after refresh data?

In List view, when user change width, and data refreshed, width remains same. but for datagrid, it restores to original(default) width.

Krishna Sarma  Thursday, November 16, 2006 6:10 PM

save the original width on load:

Dim SavedWidth As Integer = 0

Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

SavedWidth = Me.DataGridView1.Width

End Sub

Reset the width in the prefered method with:

Me.DataGridView1.Width = SavedWidth

DMan1  Thursday, November 16, 2006 7:23 PM

You can use google to search for other answers

Custom Search

More Threads

• Picture Resizing
• Print Preview problem
• Performance question: Arrays vs. Public Variables
• Center child control in FlowLayoutPanel
• Dear friends, how can I do to create a custom TreeNode as a Custom Control
• Panning in Printpreview
• The well know listview and Application.EnableVisualStyles bug, still problems after workaround
• crystal report
• Creating Custom Explorer Bars, Tool Bands, and Desk Bands (The .NET Way)
• listBoxes tabulator order