{"name":"tvSortByValue","title":"tvSortByValue","type":"command","url":"https://community.bistudio.com/wiki/tvSortByValue","revid":378381,"updated":"2026-04-04T04:47:06Z","groups":["GUI Control - Tree View"],"status":"ok","games":{"arma3":"0.74"},"since":"arma3 0.74","arma3_since":"0.74","description":"Sorts all children of given path. Value of Tree View entries is used for sorting. tvSetValue can be used to set the value for a given path.","syntaxes":[{"syntax":"control tvSortByValue [path, ascending]","params":[{"name":"control","type":"Control","type_expr":"Control"},{"name":"path","type":"Tree View Path","description":"the parent item to sort","type_expr":"Tree View Path"},{"name":"ascending","type":"Boolean","optional":true,"default":"false","description":"true to sort ascending, else descending","type_expr":"Boolean","text":"ascending: Boolean - (Optional, default false) true to sort ascending, else descending"}],"returns":{"type":"Nothing","type_expr":"Nothing"},"form":"binary","left":{"text":"control"},"right":{"text":"[path, ascending]"}},{"syntax":"tvSortByValue [idc, path, ascending]","params":[{"name":"idc","type":"Number","description":"control idc","type_expr":"Number"},{"name":"path","type":"Tree View Path","description":"the parent item to sort","type_expr":"Tree View Path"},{"name":"ascending","type":"Boolean","optional":true,"default":"false","description":"true to sort ascending, else descending.","type_expr":"Boolean","text":"ascending: Boolean - (Optional) true to sort ascending, else descending. Default: false"}],"returns":{"type":"Nothing","type_expr":"Nothing"},"form":"unary","right":{"text":"[idc, path, ascending]"}}],"examples":[{"code":["control tvSortByValue [[0], false];"]},{"code":["tvSortByValue [102, [0], false];"]}],"see_also":["lbSortBy","lnbSortBy","tvSortAll","tvSort","tvSortByValueAll"]}