简体   繁体   English

如何根据单元格值更改datagridview的值

[英]How to change value of datagridview based on cell value

i am fetching data from access table in datagridview. 我正在从datagridview中的访问表中获取数据。 Access table have one lookup column. 访问表具有一个查询列。 so when i fetch table in datagridview it is showing the value in numbers. 所以当我在datagridview中获取表时,它以数字显示值。

i want to get lookup value in datagridview not numbers. 我想在datagridview中获取查找值,而不是数字。

should i use some conditional formatting for is there any other way to do that. 我应该使用某种条件格式进行格式化吗?

Do not use lookup fields in table design. 不要在表设计中使用查找字段。 They only create the kind of problems that you are running into. 它们只会造成您遇到的那种问题。 Use a SQL statement or query as your datasource. 使用SQL语句或查询作为您的数据源。

Select T1.*, T2.DescriptionField FROM Table1 AS T1 INNER JOIN 
TABLE2 AS T2 ON T1.LookupField = T2.LookupField

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

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