ActiveReports Developers 7 Now Available in Beta!! (click for details)

SharpGrid Support

Started by wisheslim at 12-14-2009 2:21 AM. Topic has 1 replies.

Print Search Rate
Sort Posts:    
   12-14-2009, 2:21 AM
wisheslim is not online. Last active: 12/14/2009 3:56:14 PM wisheslim

Not Ranked
Joined on 12-14-2009
Posts 1
selected drop down item not updated
Hi,

   I have encountered a problem in drop down in a cell.
Initially I populated the grid with data from database.
After that I select a new (different) value from the drop down in one of the cell. After that I exit the Edit mode or click on other row cell, the selected value of the cell will change back to the initial value from database.

   I am not sure which event changed my value to initial value.
The grid has set to AutoField= true and CacheAllRecords=true, sgBound. I have checked that the column is set to ReadOnly=false.
What do I need to do to solve the problem?

  Thanks.

Jerry

   Report 
   12-16-2009, 11:10 PM
Andrey - DD is not online. Last active: 8/25/2011 5:42:49 PM Andrey - DD

Top 25 Posts
Joined on 08-01-2007
Russia, Novosibirsk
Posts 671

DDStaff
Re: selected drop down item not updated
Jerry,

If you bind SharpGrid to recordset and want to change SharpGrid values (this will also change underlying database values), you should open recordset with parameters which allow it, for example:

Dim sSQL As String
    sSQL = "SELECT Year_, Number1, Data1 FROM Main"

    ' Create connection string
    Dim sConnection As String
    sConnection = "Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;Data Source=" & _
                 App.Path & "\ZP.mdb"
 
    ' Open recordset
    Dim rs As New ADODB.Recordset
    rs.Open sSQL, sConnection, adOpenKeyset, adLockOptimistic
 
    ' Bind grid to the recordsset
    SGGrid1.DataMode = sgBound
    Set SGGrid1.DataSource = rs

If this doesn't help, can you please send a small sample and steps to reproduce the issue?

Thank you,
Andrey T.

   Report 
GrapeCity » Product Support » SharpGrid Suppo... » Re: selected drop down item not updated

Privacy Policy | Copyright © 1997-2012 — GrapeCity, inc.
All trademarks mentioned are the property of their respective owners.