Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Tuesday, November 26, 2024 
 
slxdeveloper.com Community Forums  
   
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!
 Architect Forums - SalesLogix Scripting & Customization
Forum to discuss writing script in Architect plugins for SalesLogix & general SalesLogix customization topics (for Windows client only). View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to SalesLogix Scripting & Customization | New ThreadView:  Search:  
 Author  Thread: Add to a DataGrid without Edit View?
Marc Johnson
Posts: 252
 
Add to a DataGrid without Edit View?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 09 Aug 06 1:02 PM
fiogf49gjkf0d
This question is actually a two parter.

I have a data grid that is populated from an edit view and it work but isn't efficient for the end users.

What I'm wanting to do is allow the users to add a new line item to the grid without using an Edit view. I want this to happen by the first column being a drop down of avalible options (also pulled from another table). Once they've chosen the initial value the other fields will auto fill based on business logic that will be scripted.

Question 1: Is this even possible?
Question 2: Can a datagrid pick list be dynamically created from a table?

Thanks!

Marc
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Add to a DataGrid without Edit View?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 09 Aug 06 1:34 PM
fiogf49gjkf0d
Answer 1: Yes
Answer 2: Yes (as long as you're on 6.2 or higher)



I've done this many times. What I do (to add a new blank row to the grid) is this:

1) Add a button to "Add" a new item somewhere
2) When the user clicks the button you add a new row to the underlying table (populating only the pertinent ID fields, create & modify fields, etc)
3) Using the ID for the new row you created, position the grid to select that row (using the grid'd selection collection)
4) I usually set a field on the new row to be something like "" or something so the user knows to edit those values. Also, if the user clicks out of that new row I can remove it (by checking to see if the primary value was still "". In your case you'll want the first item in the dropdown column to be something like "Select an item" so you'll know if nothing was set by the user if they click away from the row. Kno what I mean?

As far as having a picklist of items (populated from a table), use a Combo column in the grid. You can (at runtime) get a reference to that column and add any items you grab from a table or elsewhere to the Items collection of that column.

-Ryan
[Reply][Quote]
Jeremy Brayton
Posts: 491
Top 10 forum poster: 491 posts
 
Re: Add to a DataGrid without Edit View?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 09 Aug 06 5:30 PM
fiogf49gjkf0d
I'm anal with my primary keys and I haven't tested this theory but couldn't you create the record in the updateable recordset, let the grid manipulate it, perform validation, fill in the primary key, then call .update to sync the change back to the database?

It seems very hokey but at least possible enough for me to try to revive my dead inline-only modification to the only customization where each field is present on the grid.
[Reply][Quote]
Timmus Agersea
Posts: 328
 
Re: Add to a DataGrid without Edit View?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 09 Aug 06 5:51 PM
fiogf49gjkf0d
You can set the recordset's activeconnection to nothing after the data has loaded, let the user do all the editing they want (including adds and deletes) then via an event of your choice you can reconnect the recordset and updatebatch.

Timmus
[Reply][Quote]
Marc Johnson
Posts: 252
 
Re: Add to a DataGrid without Edit View?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 11 Aug 06 10:59 AM
fiogf49gjkf0d
This particular project has been put on hold for now. We are waiting to see what 7.0 has for us in this area before investing more time into this particular issue.

Thanks for the answers though. I've archived them away incase I need them.

Marc
[Reply][Quote]
 Page 1 of 1 
  You can subscribe to receive a daily forum digest in your user profile. View the site code of conduct for posting guidelines.

   Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
 

 
 slxdeveloper.com is brought to you courtesy of Ryan Farley & Customer FX Corporation.
 This site, and all contents herein, are Copyright © 2024 Customer FX Corporation. The information and opinions expressed here are not endorsed by Sage Software.

code of conduct | Subscribe to the slxdeveloper.com Latest Article RSS feed
   
 
page cache (param): 11/26/2024 10:33:24 AM