The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
|
|
Setting a grid cell value
Posted: 23 Apr 08 7:49 AM
|
I'm this question has been asked before, but I couldn't find it. Here is what I am trying to do: I have a normal datagid (not populated by code) with only 2 columns. I am using Ryan's method of adding a record without an edit form. After adding a record to the grid the user selects a value from a picklist in the grid then, depending on what value they select, I want to set the value of the second cell. After setting the value, the user could change it, but I need to set the value first. I am really hoping to not have to resort to SQL to set the value since I would like use this routine on several grids.
Thanks for the help. |
|
|
| |
|
Re: Setting a grid cell value
Posted: 24 Apr 08 5:54 AM
|
Probably...you can call "On Change " Event for the paricular grid record..and add some lines of coding to change the second column cell value....hope it would help you...
|
|
|
|
Re: Setting a grid cell value
Posted: 24 Apr 08 8:44 AM
|
This is an interesting way to handle record additions to a grid. Can you point me to the article or post that discusses this? I was unable to find it. Thanks!
C. Burriss HELP Solutions |
|
|
|
Re: Setting a grid cell value
Posted: 29 Apr 08 11:08 AM
|
Chris,
Not sure if you were asking me the question or Sathish. I still can find a method to do this.
Thanks,
|
|
|
|
Re: Setting a grid cell value
Posted: 29 Apr 08 1:42 PM
|
To anyone and everyone really. Thanks for responding. I was curious if anyone had a write-up or code example on how to do this. Thanks.
C. Burriss |
|
|
|
Re: Setting a grid cell value
Posted: 29 Apr 08 3:13 PM
|
When you inline edit a single grid cell, SLX immediately fires off a SQL Statement to update the value. So I capture this event and fire off my own script to calculate the other cells new value (like change the Quantity, so multiply Price * Quantity to derive Amount). And then fire off a SQL statement to update the hard drive.
I've done stuff where you keep track of 'dirty' rows (those that have had data changes).....and when you are all done then you fire off a mass of SQL statements.....but that's a real pain to code.
See the Opp Product stuff......also the Add Edit Product form has great examples on disconnected grids and how to keep track of stuff and eventually store it back to the drive. |
|
|
|