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: Allow end user Sort Grid created programatically
Steve Knowles
Posts: 657
Top 10 forum poster: 657 posts
 
Allow end user Sort Grid created programaticallyYour last visit to this thread was on 1/1/1970 12:00:00 AM
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
[Reply][Quote]
Frank Chaffin
Posts: 475
 
Re: Allow end user Sort Grid created programaticallyYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 01 Sep 06 8:50 AM
fiogf49gjkf0d
Here is a thread on this subject...

http://www.slxdeveloper.com/forum.aspx?forumid=2000&postid=369
[Reply][Quote]
Steve Knowles
Posts: 657
Top 10 forum poster: 657 posts
 
Re: Allow end user Sort Grid created programaticallyYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 01 Sep 06 9:05 AM
fiogf49gjkf0d
Ok, I tried to populate the SQL property of the grid at design time and set sortable to true. Now my grid returns nothing.. what might I be missing?
[Reply][Quote]
Frank Chaffin
Posts: 475
 
Re: Allow end user Sort Grid created programaticallyYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 01 Sep 06 9:46 AM
fiogf49gjkf0d
Do you have a DataGrid.Refresh on the WhenChange (or WhenOpen) event ot the form?

If you are using the BindID did you set it properly?

Check your SQL statement.
[Reply][Quote]
Steve Knowles
Posts: 657
Top 10 forum poster: 657 posts
 
Re: Allow end user Sort Grid created programaticallyYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 01 Sep 06 9:51 AM
fiogf49gjkf0d
Hmmm, now I can get the data to show up if I uncheck the sortable property.. when I check the property the data disappears..
[Reply][Quote]
Frank Chaffin
Posts: 475
 
Re: Allow end user Sort Grid created programaticallyYour last visit to this thread was on 1/1/1970 12:00:00 AM
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.
[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:43:48 AM