简体   繁体   English

当前页面的AspxGridView更改数据表列值

[英]AspxGridView Change Datatable Column Value for Current Page

Problem : DataTable (50K+ Rows) is binded with Aspxgridview, now we want to change DataRow column Values... for example instead of UserId display UserName. 问题: DataTable(50K +行)已与Aspxgridview绑定,现在我们想更改DataRow列的Values ...,例如代替UserId显示UserName。 I can enumerate 50K rows and update userid with username at runtime but i want to enumerate AspxGridView current page DataRows and update their values only. 我可以枚举5万行,并在运行时使用用户名更新userid,但是我想枚举AspxGridView当前页面DataRows并仅更新其值。

Can anyone guide me ? 谁能指导我? which event to use to update dataRow values of current page only for Aspxgridview ? 哪个事件仅用于Aspxgridview来更新当前页面的dataRow值?

You should NOT iterate through the 50K records an update the UserId with the UserName. 您不应该遍历50K记录,用UserName更新UserId。

One, you probably cant because UserId sounds like a numeric field (or at least it should be) and UserName is a string field. 一种,您可能无法做到,因为UserId听起来像一个数字字段(或者至少应该是数字字段),而UserName是一个字符串字段。 You can't put a string in a number. 您不能在数字中输入字符串。

Two, You should change the way you get your data, likely from a database, to JOIN the table you have here to the table that has the user names, and bring in the data you want. 第二,您应该更改从数据库中获取数据的方式,以将此处拥有的表联接到具有用户名的表中,并引入所需的数据。 This way, it is done, and done fast. 这样,它就完成了,并且很快完成了。

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

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