简体   繁体   English

如何动态更改gridview列的顺序?

[英]How i change order of my gridview columns dynamically?

I have an application in asp.net web .net. 我在ASP.NET Web .NET中有一个应用程序。 this application have a collection of dogs and i can display this dog with specific criteria. 此应用程序具有狗的集合,我可以根据特定条件显示此狗。 For do this, i have one gridview bind to my dogs collection and i looking for how i can generate dynamically the order columns of my gridview using databinding. 为此,我将一个gridview绑定到我的dogs集合,并且寻找如何使用数据绑定来动态生成gridview的订单列。

This looks like a duplicate of this question. 这看起来像是这个问题的重复。 The answer looks like it would help you: How to reorder columns in gridview dynamically 答案似乎对您帮助: 如何动态重新排列gridview中的列

You can use the InsertAt , Remove and CloneFields methods of Gridview.Columns to help you reorder columns. 您可以使用Gridview.ColumnsInsertAtRemoveCloneFields方法来帮助您对列进行重新排序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM