likemike Posted June 17, 2023 Share Posted June 17, 2023 Hello! I want do change a field content in a TUnimDBGrid when certain circumstances arise. In TUniDBGrid there is a method called OnSetCellValue. This method is missing in TUnimDBGrid. I've tried to use OnDrawColumnCell. I used a dirty workaround to hide some content: Attribs.Font.Color:=Attribs.Color; But this is not perfect, because the user could make the content visible by mouse-marking. I've searched in the forum but I couldn't find anything that helps. Any suggestions would be appreciated! Regards Mike Link to comment Share on other sites More sharing options...
Sherzod Posted June 17, 2023 Share Posted June 17, 2023 Hello, Can you describe in full what you want to achieve? Link to comment Share on other sites More sharing options...
likemike Posted June 18, 2023 Author Share Posted June 18, 2023 Sure! I have a TunimDBGrid connected to a query. Under certain circumstances I want to hide some fields from displaying. But there's only one method (OnDrawColumnCell) in TunimDBGrid which effects the display in a grid. Example (a grid of Name, Sex and Age): Name Sex Age ---------------------------- Peter M 44 John M 40 Cindy F Although the age of Cindy is stored in the table, it shouldn't be displayed (women don't like that 😉 ) Link to comment Share on other sites More sharing options...
Sherzod Posted June 19, 2023 Share Posted June 19, 2023 Hello, 21 hours ago, likemike said: Although the age of Cindy is stored in the table, it shouldn't be displayed (women don't like that 😉 ) Yes that's right ) Well, there are several options I think. Here is one of them: https://docwiki.embarcadero.com/Libraries/Sydney/en/Data.DB.TField.GetText Link to comment Share on other sites More sharing options...
likemike Posted June 21, 2023 Author Share Posted June 21, 2023 Hi Sherzod! I don't know, how to use GetText to change the content of a UnimDBGrid during runtime. You gave this answer in that post too, but it seems, that Denton didn't understand this, too, because he solved his problem with calculated fields. What I need is the method OnSetCellValue like it already exists in the non mobile version of TUnimDBGrid - or a workaround. Regards Mike Link to comment Share on other sites More sharing options...
Recommended Posts