<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.multitheftauto.com/wiki/DgsGridListGetAutoSortEnabled?action=history&amp;feed=atom</id>
	<title>DgsGridListGetAutoSortEnabled - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.multitheftauto.com/wiki/DgsGridListGetAutoSortEnabled?action=history&amp;feed=atom"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DgsGridListGetAutoSortEnabled&amp;action=history"/>
	<updated>2026-05-13T23:41:28Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DgsGridListGetAutoSortEnabled&amp;diff=54652&amp;oldid=prev</id>
		<title>Thisdp: Created page with &quot;__NOTOC__  {{Client function}} This function gets whether the auto sorting of grid list enabled.  Auto Sorting means when the grid list have target sorting column and sorting...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DgsGridListGetAutoSortEnabled&amp;diff=54652&amp;oldid=prev"/>
		<updated>2018-04-09T15:17:29Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;__NOTOC__  {{Client function}} This function gets whether the auto sorting of grid list enabled.  Auto Sorting means when the grid list have target sorting column and sorting...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
This function gets whether the auto sorting of grid list enabled.&lt;br /&gt;
&lt;br /&gt;
Auto Sorting means when the grid list have target sorting column and sorting function, grid list will start do sorting at the next frame.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool dgsGridListGetAutoSortEnabled( element gridlist )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''gridlist:''' The grid list which you want to get auto sorting state from.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if succeed, false otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
DGS = exports.dgs&lt;br /&gt;
&lt;br /&gt;
local sortfnc = [[&lt;br /&gt;
	local arg = {...}&lt;br /&gt;
	local a = arg[1]&lt;br /&gt;
	local b = arg[2]&lt;br /&gt;
	local column = dgsElementData[self].sortColumn&lt;br /&gt;
	local texta,textb = a[column][1],b[column][1]&lt;br /&gt;
	return texta &amp;lt; textb&lt;br /&gt;
]] -- Define our sorting function&lt;br /&gt;
&lt;br /&gt;
gridlist = DGS:dgsCreateGridList(300,50,600,600,false)&lt;br /&gt;
DGS:dgsGridListSetSortFunction(gridlist,sortfnc) -- set and load the sorting function&lt;br /&gt;
DGS:dgsGridListSetSortColumn(gridlist,2) -- choose which column to be sorted by.&lt;br /&gt;
&lt;br /&gt;
DGS:dgsGridListAddColumn(gridlist,&amp;quot;test1&amp;quot;,0.3)&lt;br /&gt;
DGS:dgsGridListAddColumn(gridlist,&amp;quot;test2&amp;quot;,0.2)&lt;br /&gt;
for i=1,50 do&lt;br /&gt;
	local row = DGS:dgsGridListAddRow(gridlist)&lt;br /&gt;
	DGS:dgsGridListSetItemText(gridlist,row,1,tostring(i))&lt;br /&gt;
	DGS:dgsGridListSetItemText(gridlist,row,2,50-tostring(i))&lt;br /&gt;
end&lt;br /&gt;
local state = DGS:dgsGridListGetAutoSortEnabled(gridlist) -- The default state is true which means on&lt;br /&gt;
outputChatBox(tostring(state))&lt;br /&gt;
&lt;br /&gt;
showCursor ( true )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{DGSFUNCTIONS}}&lt;/div&gt;</summary>
		<author><name>Thisdp</name></author>
	</entry>
</feed>