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!
|
|
Datagrid Not Allowing Any Changes
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 |
|
|
| |
|
Re: Datagrid Not Allowing Any Changes
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. |
|
|
| |
|
Re: Datagrid Not Allowing Any Changes
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" |
|
|
|
Re: Datagrid Not Allowing Any Changes
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.
?
|
|
|
| |
|