Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Wednesday, November 27, 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: Datagrid Not Allowing Any Changes
John Steele
Posts: 12
 
Datagrid Not Allowing Any ChangesYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 13 Mar 07 9:20 AM
fiogf49gjkf0d
I need to create a datagrid that will allow the user to quickly review and update a couple of fields over many of the records on our database. I believe that I am close to having what I need, but no matter what I try, I can not get the datagrid to allow any changes. The datagrid is being populated with correct data. I just can’t change that data in any way.

For all columns and the datagrid, I have the ReadOnly property set to false. Where else could I be going wrong? Below is my code. Any help would be appreciated. Thanks!

Dim rs
Dim col
Dim fld
Dim i

With DataGrid1

' Remove any existing columns
If (.Columns.Count > 0) Then
For i = 0 To .Columns.Count - 1
.Columns.Item(0).Delete
Next
End If

'Add new SQL and refresh so grid is bound
.SQL.Text = "SELECT ACCOUNTID AS 'Account', " & _
"SDBR_CURRTEST AS 'Pick List', " & _
"SDBR_CURRYEARAPPRVCODE AS 'Check Box' " & _
"FROM SD_BestRewards "

.Refresh

.ReadOnly = False

With .Columns
'Account column setup
Set col = .Add(0)
col.FieldName = "Account"
col.Caption = "Account"
col.ReadOnly = False

'Current Fiscal Year Approval Code
Set col = .Add(15)
col.FieldName = "Pick List"
col.Caption = "Pick List"
col.ReadOnly = False
col.DisableEditor = False
col.PickListName = "Best Rewards"
col.AutoDropDown = True

'Current Fiscal Year Switch
Set col = .Add(4)
col.FieldName = "Check Box"
col.Caption = "Check Box"
col.ReadOnly = False
col.DisableEditor = False
End With

.ReadOnly = False
.RowSelect = False
.Refresh
End With
[Reply][Quote]
Lloy Sanders
Posts: 69
 
Re: Datagrid Not Allowing Any ChangesYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 13 Mar 07 2:30 PM
fiogf49gjkf0d
Try adding the AccountId as a column as well. You can set col.Visible = False
[Reply][Quote]
John Steele
Posts: 12
 
Re: Datagrid Not Allowing Any ChangesYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 13 Mar 07 2:49 PM
fiogf49gjkf0d
The first column in my table is the AccountId.

By the way, I meant to mention in my first posting that I am using version 6.2.3 of SLX.
[Reply][Quote]
Lloy Sanders
Posts: 69
 
Re: Datagrid Not Allowing Any ChangesYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 13 Mar 07 2:54 PM
fiogf49gjkf0d
Yes, but you are removing all of the columns, and not re-adding it in your script.
[Reply][Quote]
Lloy Sanders
Posts: 69
 
Re: Datagrid Not Allowing Any ChangesYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 13 Mar 07 3:18 PM
fiogf49gjkf0d
Ok, my bad... I see you are adding AccountId, just calling it Account. You also need to add the column that is the Primary Key field of the table, so in this case, you want to add SD_BestRewardsID as a column also. You may also have to do this ... DataGrid1.KeyField = "SD_BestRewardsID"
[Reply][Quote]
Mike Spragg
Posts: 1226
Top 10 forum poster: 1226 posts
 
Re: Datagrid Not Allowing Any ChangesYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 14 Mar 07 2:55 AM
fiogf49gjkf0d
Is there any need to complicate this at all ?? This looks just like an ordinary grid - why are you doing this dynamically ?
Just create the grid as normal, add your columns and then set each column to read/write with relevant drop-downs, picklists etc. your grid is then in-cell editable.

?
[Reply][Quote]
John Steele
Posts: 12
 
Re: Datagrid Not Allowing Any ChangesYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 14 Mar 07 7:30 AM
fiogf49gjkf0d
Thanks Lloy. The KeyField was what I needed. You are a scholar and a gentleman!
[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/27/2024 6:26:32 AM