PC Review


Reply
Thread Tools Rate Thread

Can you write a general function to change a DataGrid?

 
 
Bob Rosen
Guest
Posts: n/a
 
      23rd Jul 2003
I have a simple subroutine SortRows, which takes a DataGrid and a sort
expression and is supposed to set the DataGrid to sort by the sort
expression. In fact, all it consists of is:

Public Sub SortRows(ByRef Grid As DataGrid, ByVal SortExpression As String)
Grid.Attributes("SortExpr") = SortExpression

End Sub

When I tried calling this subroutine and set a breakpoint at the End Sub, I
found that the value of Grid.Attributes("Sort_Expr") was indeed equal to the
value of SortExpression. But after I returned to the calling subroutine, I
found that the value of SampleGrid.Attributes("Sort_Expr") was a blank
string. It seems to me that even though the Grid argument is declared
ByRef, for at least its attributes it behaved as though it was declared
ByVal.

Is there any possible implementation of this subroutine that uses only the
information in its arguments? I know that this is a simple subroutine but
maybe in the future I will have the same problem with a more complex one.

Bob Rosen


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Change sheets within a read and write function... Naji Microsoft Excel Programming 14 15th Jan 2008 04:19 PM
Need to write function that will change column width based on a condition dunlapww Microsoft Excel Misc 2 28th Feb 2007 05:40 PM
How do I write a a general contract? =?Utf-8?B?Q2h1Y2sncyBDbGVhbmluZyBTZXJ2aWNl?= Microsoft Word Document Management 1 26th Jul 2006 09:31 AM
How do I write a general letter of introduction =?Utf-8?B?TWFjaA==?= Microsoft Word Document Management 2 9th Jun 2005 10:51 PM
Re: Can you write a general function to change a DataGrid? Bob Rosen Microsoft Dot NET 0 23rd Jul 2003 05:21 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:38 AM.