GridView排序问题 [英] Problem in sorting of gridview

查看:57
本文介绍了GridView排序问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我被困在一部分中以在asp.net中的gridview中对数据进行排序.我正在使用Visual Studio 2010,我想获取gridview的内容并将其放入新的数据表中,以便我可以对新的数据表进行排序,并且使它成为gridview的新资源.

我尝试过

Hi,

I am stuck in a part to sort the data in a gridview in asp.net.I am using visual studio 2010 i want to take the content of the gridview and place it into the a new datatable so that i can sort the new datatable and make it a new source for the gridview.

i tried as

dataTable forSortTable= GridView1.DataSource as DataTable;



但这对我没用
forSortTable始终获取空值.
谁能帮我这个.
谢谢
Arpan



but it didn''t work for me
the forSortTable is always getting a null value.
Can anyone help me with this.
Thank you,
Arpan

推荐答案

,这行不通.

使自己轻松起来,不要再尝试将方形钉固定在圆孔中了.

你已经倒退了.首先创建数据表,然后将网格绑定到该数据表.然后,您所有的输入都将最终出现在数据表中,而您无需执行任何操作!
And it''s not going to work.

Make it easy on yourself and stop trying to make a sqaure peg fit in a round hole.

You''ve done this backwards. Create the datatable first, then bind the grid to it. Then all of your entries will end up in the datatable without you having to do anything!


这篇关于GridView排序问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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