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!
|
|
Allow end user Sort Grid created programatically
Posted: 01 Sep 06 8:40 AM
|
fiogf49gjkf0d I have a grid I create programatically like so: With grdIR ' 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 h.historyID, h.startdate as [Start Date], h.Description as Program, h.userID, " & _ "c.received_by as [Received by], c.Call_Complete [Call Complete] " & _ "FROM C_History c, HISTORY h " & _ "WHERE h.ContactID = '" & application.basicfunctions.currentContactID & "' " & _ "AND h.historyID=c.historyID order by h.startdate desc" .Refresh ' Pull the recordset from grid to determine fields in query Set rs = .Recordset For Each fld In rs.Fields If fld.Name="Start Date" Then 'col.format="Date" col.width=75 End If If fld.Name="Call Complete" Then Set col = .Columns.Add(4) Else Set col = .Columns.Add(0) End If If fld.Name="Program" Then col.width=75 End If If fld.Name="Received By" Then col.width=75 End If col.FieldName = fld.Name col.Caption = fld.Name ' If field ends in "ID" then assume that field is hidden If Right(LCase(fld.Name), 2) = "id" Then col.Visible = False Next .ReadOnly = True .RowSelect = True .Refresh End With
Code borrowed from this site if I am not mistaken.. My question is can I allow users to sort the grid by clicking the columns?
Thanks |
|
|
| |
| |
| |
| |
|
Re: Allow end user Sort Grid created programatically
Posted: 01 Sep 06 10:44 AM
|
fiogf49gjkf0d Very strange. What other properties do you have set? What does the SQL statement lool like?
Is there a script that is messing with the grid?
Something may be messed up. I would add a new grid and use the design time tools to set up the grid. Keep it simple: just show the HistoryID and make it sortable. Don't forget to add the gird.refresh. |
|
|
|