Category: .Net

Aug 26

How to: Hide a row in Telerik’s RadGrid

If you are looking for a way to programatically hide rows you don’t wish to show from your data source whether by triggering an event or by a condition you can do it. It’s actually pretty simple once you figure out the method exposed for you to use. Below is an example of what I …

Continue reading »

Jul 25

How to: Easily explore technical artifacts in SharePoint 2010 and even delete site collections and webs

As a SharePoint developer you probably find yourself in the situation where using the SharePoint central administration becomes a rather painful task as many of them take several clicks and it is not easy to obtain a nice tree view of all the information you need and take actions on them. However, if you look …

Continue reading »

Jul 25

How to: Telerik RadGrid loses it’s state of expanded and contracted groups whenever you databind

The grouping functionality of the Ajax control RadGrid from Telerik is probably one of its most attractive features. However, many users might encounter themselves in a situation where you can take action on any given element and you wish to update the information being displayed on-screen to correspond to the action you’ve taken on the …

Continue reading »

Jul 22

From where does ASP.Net tries to load Assembly files?

The answer can be found if you look at the error message when ASP.Net can’t find the assembly. Below is a list of places it would look for the assembly for Telerik.Web.UI: LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v2.0.50727/Temporary ASP.NET Files/root/7b4cc07f/99d5b9e0/Telerik.Web.UI.DLL. LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v2.0.50727/Temporary ASP.NET Files/root/7b4cc07f/99d5b9e0/Telerik.Web.UI/Telerik.Web.UI.DLL. LOG: Attempting download of new …

Continue reading »

Jul 19

How to: Call a base constructor in C#.Net

Recently I decided I wanted to start creating children classes to handle my Exceptions, but I ran into the issue that I couldn’t quite call the base constructor and I kept asking myself why if I didn’t define a constructor the class couldn’t use the base class and automatically expose them. So below is kind …

Continue reading »

Jun 16

How to: turn off custom errors for debugging mode in SharePoint 2010 application pages

Unfortunately custom errors is a setting that lives at the SharePoint site level, not at the ‘application page / _layouts’ level, so you will have to edit the web.config that applies to the entire SharePoint site which is located at: C:inetpubwwwrootwssVirtualDirectories Once there you’ll have to enable 3 different settings that should already be there for …

Continue reading »

Jun 16

What is the generic implementation of a HashTable?

The generic HashSet<T> class is a not ordered collection for containing unique elements which is the equivalent of the HashTable but for use with generics. For more information about this collection, see HashSet Collection Type at the MSDN website.

Jun 16

How to: Parse an Enumeration

  You can simply use the Enum.Parse() function as shown below: using System; [Flags] enum Colors { None=0, Red = 1, Green = 2, Blue = 4 }; public class Example { public static void Main() { string[] colorStrings = { "0", "2", "8", "blue", "Blue", "Yellow", "Red, Green" }; foreach (string colorString in colorStrings) …

Continue reading »

Jun 15

How to: Create a generic method constraining T to an Enumeration

Although I believe that as part of the .Net framework version 4 you can specify the Enumeration type that you need when you are creating a generic method, this is not available in the .Net framework 3.5 (or in previous releases for that matter). The problem then becomes that you don’t want to have a …

Continue reading »

Jun 14

How to: Initialize a .Net Dictionary at the variable declaration level

How to: Initialize a Dictionary with a Collection Initializer Sometimes in your project you want to initialize a Dictionary or other sort of collection at the declaration level so you don’t have to manually use the .add() methods and write a separate method in which to execute them. A prime example is a dictionary that …

Continue reading »

Load more