UIGridLayout doesn't order by Name

Hello! check this

image

It should sort by name regardless of layer order right?

image

Well the result is this:

image

No matter if I change the SortOrder, It will sort by layout order anyways :confused:

It sorts like that because sorting by name treats numbers as strings, not an actual number so in it’s head 10 comes before 2 because 10 starts with 1 which makes 10 higher than 2 in string wise sorting, what you should be doing is that set UIGridLayout’s SortOrder property to LayoutOrder then change every single image button’s LayoutOrder property to their names.

6 Likes

It should sort it by order if you put the ImageButtons out of this Scroll Frame parent and then back in.

1 Like

It is technically sorting by name, except just not in the way you might expect. I would suggest ordering them with LayoutOrder instead, so you don’t have this issue. You can set the LayoutOrder to the names of the ImageButtons.

1 Like

thank you, all of you. I didn’t know about the layout order property :heart: