开发者

Get DataGridView columns in order of user's ordering

I have an app that lets the user reorder开发者_如何学编程 columns in a DataGridView, and I want to save the "layout" upon closing the app...but it seems that when I iterate through the column collection, I get them in the order I added them, not the order they appear on screen. Is there a way to get the displayed ordering?

edit: found it, just check the DisplayIndex property of each column :)


You'll have to use the DataGridViewColumn.DisplayIndex property. http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridviewcolumn.displayindex.aspx

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜