Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.4k views
in Technique[技术] by (71.8m points)

model view controller - Kendo Grid alphaNumeric column sorting trick, causes filtering problem

I have a column containing an alphanumeric format.And kendo grid sorts that column like this: 1399/1

1399/100

1399/2

I created a model proprety

  public string DisplayNoX
        {
            get
            {
                if (this.DisplayNo != null)
                {
                    return Regex.Replace(this.DisplayNo, "[0-9]+", match => match.Value.PadLeft(10, '0'));
                }

                return this.DisplayNo;
            }

        }

in Grid:

 columns.Bound(p => p.DisplayNoX).Title("?????").Width(130).ClientTemplate("#=DisplayNo#");

It is okay for sorting,But filtering not work because what user search as "1399/1" is "0000001399/0000000001" I don't know how to handle this ? for both sort and filter. I read some posts about custom sorting and filtering.

But I can not figure out what is the best and the fastest solution for my situation with hundreds of thousands records.

question from:https://stackoverflow.com/questions/65924021/kendo-grid-alphanumeric-column-sorting-trick-causes-filtering-problem

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...