Sunday, February 8, 2015

HTML5 CSS3 Triangle | HTML 5 & CSS 3 - Create a Triangle

CSS 3 Triangle Code


The code below creates a black triangle

<style>
.triangle {
 width: 0;
 height: 0;
 border-left: 50px solid transparent;
 border-right: 50px solid transparent;
 border-bottom: 100px solid black;
}
</style>
<div class="triangle"></div>


CSS3 Add Border Color

If we give the borders a color, what will happen?
<style>
.triangle2 {
 width: 0;
 height: 0;
 border-left: 50px solid red;
 border-right: 50px solid blue;
 border-bottom: 100px solid black;
}
</style>
<div class="triangle2"></div>



Create a Successful Online Store at Bigcommerce! Try it Free Now!

Friday, February 6, 2015

RadRibbonBar Application Menu | Telerik Winforms 2010 SP1 - RibbonBar - Hide the Application Menu Button

RadRibbonBar Default View

Telerik Winforms provides a RibbonBar control you can build user interfaces similar to those used in Microsoft Office 2007. The control has an Application Menu Button which is located on the upper left corner as shown below:


Sometimes you may want to hide the Application Menu Button. If you change its size to 0, you will get an error. While if you change its size to 1 (the minimal possible value), you will get something like:

Remove Application Menu Button From RadRibbonBar

To completely hide the button, try this:

this.RibbonBarElement.ApplicationButtonElement.Visibility = ElementVisibility.Collapsed;


Create a Successful Online Store at Bigcommerce! Try it Free Now!

Wednesday, February 4, 2015

RadGridView Multiple Columns Sorting | Telerik Winforms 2010 SP1 - RadGridView - Multiple Columns Sorting

RadGridView supports multiple columns sorting in three ways:

RadGridView Multiple Columns Sorting at Design Time

At design time, you can enable multiple columns sorting following these steps:
  1. Open designer view in Visual Studio;
  2. Right click and then select "Open Property Builder" in the context menu;
  3. In the property builder, select "GridViewTemplate" on the left pane;
  4. Select "Advanced" tab on the right pane;
  5. Search for "SortExpressions" in the property window below and then click the button on the right;
  6. In the "GridSortField Collection Editor" dialog, add columns to be sorted.

RadGridView Multiple Columns Sorting By Program

You can enable multiple columns sorting programmatically; following these steps described here

RadGridView Multiple Columns Sorting at Runtime

At runtime, you can enable multiple columns sorting by holding "Shift" key and click on the headers of the columns to be sorted.
gridview-sorting-setting-sorting-programmatically 001



Create a Successful Online Store at Bigcommerce! Try it Free Now!

C# - Convert Java Time (in Milliseconds) to Windows Time

Assume you have a frontend built with C# and a backend built with Java. In a grid view you want to display some data from a database table and one column uses numeric format to store date/time values.

If you simply do like the following way, you will get wrong answer.
  DateTime dateTime = DateTime.FromFileTime(javaTime);

  return dateTime.ToString("yyyy-MM-dd HH:mm:ss");

To get correct answer, use this code:

private static DateTime WINDOWS_EPOCH = new DateTime(1601, 1, 1, 0, 0, 0);
private static DateTime JAVA_EPOCH = new DateTime(1970, 1, 1, 0, 0, 0);

public static String FromJavaTime(long javaTime, string timeFormat)
{
  long epochDiff = (JAVA_EPOCH.ToFileTimeUtc() - WINDOWS_EPOCH.ToFileTimeUtc()) / TimeSpan.TicksPerMillisecond;

  DateTime dateTime = DateTime.FromFileTime((javaTime + epochDiff) * TimeSpan.TicksPerMillisecond);

  return dateTime.ToString(timeFormat);
}

Then if you run FromJavaTime(1420621059959, "yyyy-MM-dd HH:mm:ss"), you will get "2015-01-07 16:57:39".



Create a Successful Online Store at Bigcommerce! Try it Free Now!

Microsoft Excel - Create A Mulplication Table

The formula that you need for the multiplication table is a formula that will multiply whatever is in row 1 by whatever is in column A.
To have a reference that always points to row 1, use something in the format of X$1. To have a reference that points to column A, use a reference in the format of $An.

First, create something like:

Then enter $A2*B$1 into B2.

Next, copy the formula in B2 to the entire area and you will get the expected output:



Create a Successful Online Store at Bigcommerce! Try it Free Now!