Skip to main content

CODING

C# - Sorting a List Collection of Classes With Properties

In one of our previous articles we described how to add values to ComboBox together with Ids in C# using class for keeping Id and Value.

Simillar to this logic, you can easily find yourself in a situation that you need to sort values in the list by some of the class property.

Here is, by our opinion, the easiest way for sorting a list collection of classes by some of its properties in C#. In this example we'll use "Name" as a class' property.

C# - How to Add Value with ID to Combobox

Combobox is a C# class that displays values in a dropdown list. Usually, it keeps simple string data only, but often we need to know an  identificator of selected string value.

This article contains information how to add values with Id to combobox in C#. The trick is to use a class with properties, Id and Name and to add an instance of the class as the combobox item.

MySQL INT Field Length/Size

A very common question regarding integer datatype in MySQL is: "Are INT(1) and INT(10) the same?" or "What is difference between INT(1) and INT(10)?"

The answer is YES, they are actually exactly the same!

An unsigned int uses 4 bytes of data and it has the max value of 4294967295. It doesn't matter whether it is represented as INT(1) or INT(10)

SQL - Change Column Size

We hope that the examples below will help you if you want to change the size of a column in SQL.

SilverStripe - Most Popular Articles

We received a lot of questions how to show most popular articles and posts regarding our tutorial about implementing page view counter in SilverStripe.

Here is the solution that we also implemented on our blog system.

Let's say that we have blog article page represented with class BlogPostPage and implemented logic for page hit/view counter.