根据另一个数据库表中的权重对 GridView 进行排序
我有一个从我们内部使用的非 SQL 数据库填充的 GridView。这些字段之一是仓库位置。 (例如:AAA、AAB、AAC 等)
在另一个数据库 (SQL) 中,我保留所有库房的列表并赋予它们权重。权重只是一个整数;整数越大,库房距离越远。
我需要根据这些库房权重对 GridView 进行排序。如何让 GridView 排序依赖于另一个表中的数据?这看起来应该是一个简单的解决方案,但我陷入困境。如果重要的话,GridView 绑定到 System.Collections.ObjectModel.Collections<> 。班级。
I have a GridView being populated from a non-SQL database that we use internally. One of those fields is a stockroom location. (Example: AAA, AAB, AAC, etc.)
In another database (SQL) I keep a list of all stockrooms and give them a weight. The weight is just an integer; the higher the integer, the further away the stockroom is.
I need to sort my GridView based on those stockroom weights. How can I have my GridView sort depend on data from another table? This seems like it should be an easy solution, but I'm getting stuck. If it matters, the GridView is bound to a System.Collections.ObjectModel.Collections<> class.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
SortExpression 属性确实支持“复杂”属性导航。您是否尝试过使用它作为 GridView 列的 SortExpression:
The SortExpression property does support "complex" property navigation. Have you tried using this as the SortExpression for your GridView column:
我假设您已经制定了数据访问代码。所以,我的建议是;
I am assuming that you have the data access code already worked out. So, my suggestion would be to;