Posts

Donate

CheckBoxList Control With Multi-Highlighting Support In C# Windows Forms

Image
If you want to customize the CheckBoxList control to support multi-highlighting (each checked item is highlighted), you can simply override the OnDrawItem() by adding Graphics statements as shown below: Here's an image sample of the extended CheckBoxList control: Code: protected override void OnDrawItem(DrawItemEventArgs e) { int index = e.Index; if ( this .GetItemCheckState(index) == CheckState.Checked) { string text = this .Items[index].ToString(); Graphics g = e.Graphics; Point point = this .GetItemRectangle(index).Location; point.X += estimated_point; //estimated point is a value you may set manually //background: SolidBrush backgroundBrush; backgroundBrush = reportsBackgroundBrushSelected; //estimated point is a value you may

Custom Extender Type Or Class Is Undefined In AjaxToolkit ASP.NET

Hi! When running an asp.net app that includes an ajax custom extender control, a javascript alert pops up message "EXTENDER is undefined". Sample error message: CustomExtenders.DisabledTextBehavior is undefined where: CustomExtenders.DisabledTextBehavior is Namespace.Type After troubleshooting for several hours, I came up with the solution: 1. Download Ajax Toolkit Stable Release for the specific .NET Framework.  I tried versions for September release and it's not working. 2. Replace code: CustomExtenders.DisabledTextBehavior.registerClass( 'CustomExtenders.DisabledTextBehavior' , AjaxControlToolkit.BehaviorBase); To CustomExtenders.DisabledTextBehavior.registerClass( 'CustomExtenders.DisabledTextBehavior' , Sys.Extended.UI.BehaviorBase); Note: AjaxControlToolkit.BehaviorBase is used in previous versions of AjaxToolkit. Cheers!

AjaxControlToolkit ExtenderControlBaseDesigner Class Requires T

Hello! The previous version of ExtenderControlBaseDesigner does not require T as parameter. However, in recent versions you might notice that the class is declared with T. Here's a sample declaration: AjaxControlToolkit.Design.ExtenderControlBaseDesigner<T> T means AjaxControlToolkit.ExtenderControlBase. In order for the Custom Extender Designer to work, supply the T with class that inherits the ExtenderControlBase. This sample class inherits the ExtenderControlBase: public class CustomPanelExtender : ExtenderControlBase { //your code goes here.... }

Show Smart Tag(Shift + Alt + F10) Is Disabled Or Greyed In ASP.NET Web Forms Server Control

When adding ajax extenders to asp.net server controls using Smart Tag, you often encounter an issue such as Show Smart Tag is greyed out/disabled. The best thing to do is to use the latest stable version of AjaxToolkit. And then, reset the toolbox. Sometimes, you have to close the Visual Studio IDE just to make sure. IDE Version: Visual Studio 2010 Professional Ajax Toolkit Binary: AjaxControlToolkit.Binary.NET4 (Stable Version) Cheers!

SQL Server 2012 Pre-Requisite Issue

Hi all! On a Windows 8 environment where in you have VS 2010 installed and you want to add SQL Server 2012 to your list of software, install first VS 2010 SP1 to make changes to setup configurations. Cheers!

Visual Studio 2008 Failed Install On WIndows 8 Operating System

Solution: Turn on .NET Framework 3.5 which is built-in Windows 8. Make sure windows updates is turned on also. Cheers!

Change BIOS Boot Options For Acer Aspire V5-431P/471P

Image
Hello and Good afternoon! Here's a useful Acer Aspire V5-431P/471P Tip that is to Change BIOS Boot Options for Acer Aspire V5-431P/471P (I Series) 1. Restart/Shutdown the Laptop 2. Tap F2 key on startup 3. When BIOS interface appears, go to Boot Menu 4. Change Boot Mode to Legacy BIOS. 5. Restart Again the laptop and perform step 2. 6. Set the Boot Priority of Devices using F5/F6.

SQL Server Function Date Range Example

The function below retrieves the top Freight amount specified by date range values use CompanySales IF object_id (N 'dbo.GetTopFreightValueRange' , N 'FN' ) IS NOT NULL drop function GetTopFreightValueRange go create function GetTopFreightValueRange ( @startDate nvarchar(50), @endDate nvarchar(50) ) returns decimal(10,2) as begin declare @ result varchar(50) set @ result = ( select FreightAmount from dbo.Orders where CONVERT (VARCHAR(10), ShippedDate, 120) >= @startDate and CONVERT (VARCHAR(10), ShippedDate, 120) <= @endDate ) return @ result end go -- select dbo.GetTopFreightValueRange('1996-11-01','1996-11-30') as freight_value;

SQL Server Function To Return Amount As Decimal

Here's a simple function that will return the freight amount in decimal format. use Your_Database_Name if object_id (N 'dbo.getFreightValue' , N 'FN' ) is not null drop function getFreightValue go create function getFreightValue ( @salesID nvarchar(50) ) returns decimal(10,2) as begin declare @ result varchar(50) set @ result = ( select Freight from dbo.Orders where OrderID = @salesID ) return @ result end go -- run function -- select dbo.getSomeValue(10248) as freight_value; Cheers!

Castle Windsor - Could Not Perform FindAll() For (Model) Using ActiveRecordBase in Castle.ActiveRecord ORM

When running a simple asp.net mvc project, I encountered an error which states the Model.FindAll() could not be performed. Model is a class that maps to a database table. After tracing my codes, I found out that I have mispelled the database name in my web.config as specified below: <add key= "connection.connection_string" value= "Data Source=MyComputerStation\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Blogs.mdf;Integrated Security=True;User Instance=True" /> What I did was change the database name from Blogs to Blog . That's it! :) Greg

Donate