Wednesday, February 26, 2014

Web Forms: Getting the Bound DataRow Values of a Grid Row While in Read Only Mode

OK, I had a Telerik gridview, and I wanted to add a right click event on the rows that would pop a window.  I also wanted to pass some of the data elements on the row clicked in the URL string of the popup window.

On the MasterTableView I had the Primary Key ID in the DataKeyNames property, so I could get the primary key ID from the clicked row using this technique-

But what about the rest of the data?  I could try to get at the data in it's label form on the grid row, but what I really wanted was the underlying data that was bound to the grid.  After tweaking a using a little bit if Linq, I came up with this-

  protected void GridContextMenu_ItemClick ( object sender, RadMenuEventArgs e )  
     string radGridClickedRowIndex = Request.Form[ "radGridClickedRowIndex" ]; //hidden form field  
     int RowIndex = -1;  
     RowIndex = Convert.ToInt32 ( radGridClickedRowIndex );  
     GridDataItem gridRow = GridView.Items[ RowIndex ] as GridDataItem;  
     int ID = Convert.ToInt32(gridRow.GetDataKeyValue ( "ID" ).ToString ());  
     var rv = ( from myrow in ((DataView)GRIDDataSet.Select ( DataSourceSelectArguments.Empty )).ToTable().AsEnumerable ()  
           where ( myrow.Field<int> ( "ID" ) == ID )  
           select myrow ).FirstOrDefault ();  

And then you can access items in the bound data row like this

string myvalue = rv["column_name"].ToString();

Some of you will not get what I'm talking about.  But to a certain group of people I hope this is useful. Remember to include the System.Linq namespaces at the top of the code behind page.

Friday, February 21, 2014

American IT Job Market

So every once in a while I go to and do key word searches to kind of get an idea an idea of what is hot in the job market.  I'm not looking for a new job, but I like to keep track of what employers are actually looking for.

These are the numbers that I found on my latest searches.  The take aways are up to you.

I did my search on February 20th, 2014. Listed below is the keyword I searched on and the number of jobs that were listed for the USA in the last 30 days.

Java 16109
java developer 10015
UX Developer 1024
HTML 5 2780

Flash 716
javascript 11260
c# 8240
php 3568
Objective C 1893
.net 9332
Ruby on Rails 951

iOS 2584
mobile 9230
Android 2557
Rest 3466
WPF 824
metro 640
Linux 10941
ubuntu 288

Developer 27002
Administrator 8357
Network Administrator 2988
Security 16247
Telecommute 716
cisco 4370
DBA 2569

Monday, February 03, 2014

Firefox Not Working With Visual Studio 2012 / 2013

I did the new Visual Studio 2012/13's options to select which browser you want to debug in...but I ran into a snag lately.

When Firing up a website in Visual Studio 2012 using Firefox a few weird things happened.  First, I had to login...second I got an NT/Anonymous login error...all bad.

So after a few minutes of searching I found the fix.  Left here for reference and hopefully it might help you.  The underlying problem is actually with how Firefox handles SQL authentication.  The fix is opening up about:config in Firefox and changing a few entries.  Use the instructions in the link below and add "localhost".