If you’re trying to upgrade your D-Link DIR-655 Extreme-N Gigabit Wireless Router to the latest firmware (1.35NA US version as of this post), you may encounter a weird problem: firmware uploads without errors, router says it is being reprogrammed, but after reboot old version is displayed.
To solve it – try following these steps
- Save your current settings (Tools -> System -> Save Configuration) – you should do it prior any update anyway
- This what does the trick: On the same screen click “Restore Factory Default” – this will restore router default settings (one more reason why it’s important to do the update over wired connection)
- Flash your firmware
- Restore setting saved in Step 1 and reboot the router
Profit! You’re now on the latest firmware
Let’s say you’re writing T-SQL code and need to make sure that your query returns one and only row. If no records returned – an error message needs to be shown. If more than one record is returned – another error message needs to be show. The code goes something like this:
-- ... query runs here and returns row
IF @@ROWCOUNT = 0 RAISERROR('No records found', 18, 1)
ELSE IF @@ROWCOUNT > 0 RAISERROR('More than one record found', 18, 1)
-- ... continue when exactly one row is returned
Now if your query returns 3 records you’d expect it to trip the second IF statement and raise error with correct message. Unfortunately this doesn’t happen. The reason being – the first IF statement resets @@ROWCOUNT to 0. So, to avoid this we need to preserve the @@ROWCOUNT value in a local variable:
DECLARE @iRowCount int
-- ... query runs here and returns row
SET @iRowCount = @@ROWCOUNT
IF @iRowCount = 0 RAISERROR('No records found', 18, 1)
ELSE IF @iRowCount > 0 RAISERROR('More than one record found', 18, 1)
-- ... continue when exactly one row is returned
This way count of rows returned by the query is saved and is not affected by any following statements.
If you’re still using classic Infragistics Controls and want to make them work in modern browsers, sometimes a little additional work is required. Hopefully this little trick will save you some time.
UltraWebGrid has a neat property TopItemSpacing, when set to Auto it automatically spreads top level menu items across the menu control, giving them nice spacing in between. Unfortunately this property seems to work in Internet Explorer only, in Firefox (and Chrome and etc.) it is ignored, rendering menu in Compact mode giving top level items crowded “too-close-for-comfort” look.
The solution is to take spacing in our own hands. Set TopItemSpacing to Compact and instead add right padding to TopLevelParentItemStyle and TopLevelLeafItemStyle elements of the menu. For example (from the markup point of view):
<TopLevelLeafItemStyle Cursor="Hand" Height="18px" BorderWidth="1px" Font-Size="8pt">
<Padding Right="6px" />
</TopLevelLeafItemStyle>
Actual pixel value of the padding is up to your particular scenario, but the final result is top level menu items will be nicely spaced both in IE and in Firefox.
Often, when drawing a chart, there’s a need to show a threshold – basically a line that indicates whether your values are going above or below it. Take for example this ColumnChart:

Let’s say we need to show a threshold for the value of 7. Here’s how. Continue reading 'How to add threshold line to MSChart in ASP.NET'»
If you working with Infragistics Aikido controls and your WebDataGrid or WHDG is too long – a common approach to make content scrollable is to place grid control inside of a DIV with fixed dimensions and overflow set to auto:

It works fine, but there’s one drawback: if you scroll your grid horizontally and then select a row – grid’s scroll position snaps back to the leftmost position. Infragistics says that it’s a browser bug and we need to talk to browser vendor about it. Wanting to solve the problem in this century I looked for alternatives and this is what I found. Continue reading 'WebDataGrid: Prevent scrolling on row selection'»

It used to be a bit of a pain to install a 3rd party keyboard on Kindle Fire – you had to work with SQL Lite and ADB Shell and there were a few other requirements. But thanks to Tivan from samsung-tablets.com it’s down to 3 easy steps (one requirement remains: Your Kindle Fire has to be rooted with Android Market app installed). Continue reading 'Russian Keyboard on Kindle Fire'»
If you tried to use Infragistics classic UltraWebMenu control in IE9 you may experience issue (even in the latest version, 11.2 at the time of this post) whereby menu items don’t change background on mouse hover even though background is specified in menu’s HoverItemStyle property.
The solution is specify BorderStyle in HoverItemStyle. It can be any value besides NotSet, but the actual attribute has to be there. So for example if you want your hover style to have no borders and your original style looks like:
<HoverItemStyle
ForeColor="White"
BackColor="#81C0E9"
Height="18px"
BorderWidth="0px">
</HoverItemStyle>
change it to
<HoverItemStyle
ForeColor="White"
BackColor="#81C0E9"
Height="18px"
BorderWidth="0px"
BorderStyle="None">
</HoverItemStyle>
I don’t know why border style affects showing of the background, but there you have it. Adding BorderStyle to HoverItemStyle will enable displaying of background color on hover.
This was one weird mystery. I have used ASP.NET’s method ClientScript.RegisterStartupScript countless times to inject client-side JavaScript into page’s markup from the server-side code and it always worked perfectly. This time I created a very basic page from scratch:
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>My Page</title>
<script type="text/javascript" src="script1.js" />
<script type="text/javascript" src="script2.js" />
<script type="text/javascript" src="script3.js" />
</head>
<body>
<form id="xfrmMain" runat="server">
</form>
</body>
</html>
And then injected client-side script into it:
ClientScript.RegisterStartupScript(Me.GetType, "JSCode", "ProcessData();", True)
where ProcessData() is function from one of the scripts, loaded in the HEAD tag. The script injected just fine, I got a beautiful insert at the bottom of the rendered page:
<script type="text/javascript">
//<![CDATA[
ProcessData();//]]>
</script>
The problem was – it didn’d do squat – the script did not execute. Why? Continue reading 'ClientScript.RegisterStartupScript: script injected, but not executed'»
Let’s say you have a Web page that displays “widgets” a small islands of information. And internally those widgets are IFRAME elements, whose source is loaded dynamically from the same server at runtime in client side JavaScript. So, you have a code similar to this:
var aIframes = document.getElementsByTagName('IFRAME');
for (var I = 0; I < aIframes.length; I++) {
aIframes[I].src = aIframes[I].getAttribute('originalURL')
}
This (oversimplified) code assumes that URL for IFRAME source already stored as a custom attribute ‘originalURL’ of IFRAME element (for example placed there by server-side code), but it can equally come from other sources. This approach is usually taken so IFRAMES can initially display a static page with “Please wait. Loading…” animation meanwhile dynamically loading real data – creates a better user experience.
The code loops thru all IFRAMEs setting their SRC attribute, displaying content, so you would see something like

It’s all well and good, but there’s a small problem. SRC of IFRAMEs is assigned in order of their appearance on the page and if URLs are pointing to the same server and one of the earlier IFRAMEs takes a long time to load – it will block the rest of the IFRAMEs from loading. Continue reading 'How to load IFRAMEs in order according to priority'»
I’ve been successfully using manual load on demand in WebHierarchicalDataGrid for a while now, but recently noticed strange thing. The deeper in grid’s hierarchy I expanded the children – the slower it went.
In my case every time user clicks [+] to expand a row, VB.NET code calls an SQL Server Stored procedure to bring in child rows. I grew suspicious and fired up SQL Profiler. What I saw surprised me. Number of calls to the stored procedure increased the deeper in grid’s hierarchy I expanded the children. When I clicked [+] on the root level it resulted in 1 SP call. Clicking [+] on the child to expand grandchild – 2 calls. Expanding grandchild to see grand-grandchild rows – 3 calls, etc. Continue reading 'WHDG: RowIslandsPopulating event fires multiple times'»