Saturday, 28 May 2016

.Net sorting list with special characters

Sorting using c# .Net  doesn't use ASCII while sorting, It uses Unicode. When we perform a string sort, .Net by default uses the current culture.

Sorting a list in c# with special characters like "-", "/"

1.  Here is the Sample Data before sorting.

We can't get sort String having the special characters, Now we can do with RegExpression.

using System.Text.RegularExpressions;


response.Result = response.Result.OrderBy(f => Regex.Replace(f.Name.TrimStart().TrimEnd(), "[^a-zA-Z0-9_]+", " ")).ToList();


   response.Result = response.Result.OrderByDescending(f => Regex.Replace(f.Name.TrimStart().TrimEnd(), "[^a-zA-Z0-9_]+", " ")).ToList();


Friday, 20 May 2016

Remove numberer column in spreadsheet grid


This week am working with extjs spreadsheetModel grid. After adding the spreadsheetModel as selModel number column came.

There is a config option we can hide the numberer column using

        me.selModel: {
                type: 'spreadsheet',
                rowNumbererHeaderWidth: 0

numberer column to select the complete row, If you dont want to select the row you can use rowSelect: false to hide numberer column.