我如何安排asp.net gridview中的列? [英] How can i arrange columns in asp.net gridview?

查看:96
本文介绍了我如何安排asp.net gridview中的列?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何安排asp.net gridview中的列?我想改变4列的位置。例如:


column1 | column2 | column3 |第4栏|

ChangeOrder()

column2 | column1 | column3 |第4栏|

ChangeOrder()

第4栏| column2 | column3 | column1 |

我想在Gridview中移动列。

解决方案

head:


  1. 关闭AutoGenerateColumns并自己添加
    列,将它们映射到
    在数据集中,
    以您想要的顺序存储。

  2. 更改您的SQL查询以按照您的顺序返回
    列希望。



How can i arrange columns in asp.net gridview? i want to change 4 columns' location. ForExample:

column1 | column2 | column3 | column4 |

ChangeOrder()

column2 | column1 | column3 | column4 |

ChangeOrder()

column4 | column2 | column3 | column1 |


I want to move columns in Gridview.

解决方案

2 options from the top of my head:

  1. Turn AutoGenerateColumns off and add the columns yourself, mapping them to what you want in the dataset and in the order you want them.

  2. Change your SQL query to return the columns in the order that you want.

这篇关于我如何安排asp.net gridview中的列?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆