﻿<?xml version="1.0" encoding="utf-8"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>Intersoft Community - WebGrid Enterprise - WebGrid 7 - Selecting Sort From Column Context Menu Crashes</title><link>http://www.intersoftsolutions.com/Community/WebGrid/WebGrid-7---Selecting-Sort-From-Column-Context-Menu-Crashes/</link><description /><generator>http://www.intersoftsolutions.com</generator><language>en</language><copyright>Copyright 2002 - 2015 Intersoft Solutions Corp. All rights reserved.</copyright><ttl>60</ttl><item><title>WebGrid 7 - Selecting Sort From Column Context Menu Crashes</title><link>http://www.intersoftsolutions.com/Community/WebGrid/WebGrid-7---Selecting-Sort-From-Column-Context-Menu-Crashes/</link><pubDate>Fri, 19 Mar 2010 00:21:23 GMT</pubDate><dc:creator>andi@intersoftpt.com</dc:creator><description>&lt;p&gt;&lt;span style="font-size: 9pt; "&gt;Hi Yousif,&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 9pt; "&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; Forgive me, actually, when we are sorting using ContextMenu, the ColumnMember property is not designed for that scenario (using context menu). Since, basically the ColumnMember returns a string value of its column name, here is snippet of the workaround to get the column name every time we do sort either with context menu or from column header:&lt;/span&gt;&lt;/p&gt;
&lt;p /&gt;&lt;pre&gt;        function WebGrid1_OnColumnSort(controlId, columnObject)
        {
            var WebGrid1 = ISGetObject(controlId);
            if (columnObject.DataMember == null)
                alert(columnObject.ColumnMember);
            else
                alert(columnObject.DataMember);
           
            return true;
        }&lt;/pre&gt;
&lt;p&gt; &lt;span style="font-size: 9pt; "&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;I hope it helps. Thank you and have a nice day.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 9pt; "&gt;Best Regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 9pt; "&gt;Andi Santoso&lt;/span&gt;&lt;/p&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p /&gt;</description></item><item><title>WebGrid 7 - Selecting Sort From Column Context Menu Crashes</title><link>http://www.intersoftsolutions.com/Community/WebGrid/WebGrid-7---Selecting-Sort-From-Column-Context-Menu-Crashes/</link><pubDate>Thu, 18 Mar 2010 10:07:20 GMT</pubDate><dc:creator>PRISMAY</dc:creator><description>&lt;p&gt;Hi Andi,&lt;/p&gt;
&lt;p&gt;You have to actually act on the undefined object.  My example above was just to show you that it IS undefined.  If you then act on the object, it'll cause an exception and therefore kill the sort.  So do something like this, for example, assuming oGrid is your grid object:&lt;/p&gt;&lt;pre&gt;oGrid.AddInput("UserColumnMember", columnObject.ColumnMember);
&lt;/pre&gt;
&lt;p&gt;If you put this line BEFORE the alert, the call will cause an exception when ColumnMember is underfined and will crash the call and never gets to the alert and therefore never finishes the routine.&lt;/p&gt;
&lt;p&gt;And even if the sort still works due to no code possibly causing an exception, you need to let the development team know about this problem so they can fix it.  This property should be populated regardless of where the user is sorting.&lt;/p&gt;</description></item><item><title>WebGrid 7 - Selecting Sort From Column Context Menu Crashes</title><link>http://www.intersoftsolutions.com/Community/WebGrid/WebGrid-7---Selecting-Sort-From-Column-Context-Menu-Crashes/</link><pubDate>Tue, 16 Mar 2010 22:39:41 GMT</pubDate><dc:creator>andi@intersoftpt.com</dc:creator><description>&lt;p&gt;&lt;span style="font-size: 9pt; "&gt;Hi Yousif,&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 9pt; "&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; Forgive me again, however, I am not able to replicate the issue.&amp;nbsp;&lt;a href="http://www.intersoftpt.com/tdn/downloads/SortingAvi.zip" target="_blank"&gt;Here&lt;/a&gt;&amp;nbsp;is a link of video that I made, it demonstrates the scenario. If we are using context menu, the columnObject.ColumnMember, it is not existed that is why it gives us an undefined alert. In my video, even after I try to sort using context menu and the alert is undefined, the sorting is still working.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 9pt; "&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; I hope it helps. Thank you and have a nice day.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 9pt; "&gt;Best Regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 9pt; "&gt;Andi Santoso&lt;/span&gt;&lt;/p&gt;</description></item><item><title>WebGrid 7 - Selecting Sort From Column Context Menu Crashes</title><link>http://www.intersoftsolutions.com/Community/WebGrid/WebGrid-7---Selecting-Sort-From-Column-Context-Menu-Crashes/</link><pubDate>Mon, 15 Mar 2010 12:31:27 GMT</pubDate><dc:creator>PRISMAY</dc:creator><description>&lt;p&gt;If you create a function that's called as your OnColumnSort client-side handler and you try to access &lt;strong&gt;columnObject.ColumnMember&lt;/strong&gt; when it's undefined, your method will crash and therefore crashes the sort routine altogether because the method never returns true.  This is because, as I explained, when called from the context menu, this object's member is undefined.&lt;/p&gt;
&lt;p&gt;Creating a simple grid and using the sort isn't sufficient.  Use a simple javascript function like this and then sort using both the column header and the context menu:&lt;/p&gt;&lt;pre&gt;    function OnColumnSort(controlId, columnObject)
    {
        alert(columnObject.ColumnMember);
    }&lt;/pre&gt;
&lt;p&gt;Of course make sure to assign this function to your grid's client side settings.&lt;/p&gt;</description></item><item><title>WebGrid 7 - Selecting Sort From Column Context Menu Crashes</title><link>http://www.intersoftsolutions.com/Community/WebGrid/WebGrid-7---Selecting-Sort-From-Column-Context-Menu-Crashes/</link><pubDate>Sun, 14 Mar 2010 23:37:13 GMT</pubDate><dc:creator>andi@intersoftpt.com</dc:creator><description>&lt;p&gt;&lt;span style="font-size: 9pt; "&gt;Hi Yousif,&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 9pt; "&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; Forgive me, however, I am not able to replicate the issue of yours. Perhaps, I am missing on someting. It would be much better if you can kindly give me your simple running sample that replicate the issue. Because I have tried to create a simple WebGrid and I have tried to do both sorting ways, from column header and context menu, and the results was just fine.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 9pt; "&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; Thank you and have a nice day.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 9pt; "&gt;Best Regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 9pt; "&gt;Andi Santoso&lt;/span&gt;&lt;/p&gt;</description></item><item><title>WebGrid 7 - Selecting Sort From Column Context Menu Crashes</title><link>http://www.intersoftsolutions.com/Community/WebGrid/WebGrid-7---Selecting-Sort-From-Column-Context-Menu-Crashes/</link><pubDate>Fri, 12 Mar 2010 15:48:23 GMT</pubDate><dc:creator>PRISMAY</dc:creator><description>&lt;p&gt;The grid sorts just fine when we click on the column header.  However, when we select sort from the column context menu, it causes a javascript crash.&lt;/p&gt;
&lt;p&gt;I found the problem.  The columnObject passed to the OnColumnSort client-side handler is different when sorting from the menu than directly from the column header.&lt;/p&gt;
&lt;p&gt;Sorting on column header produces:&lt;/p&gt;&lt;pre&gt;  columnObject.Name         "assignedToLastFirstName"
&lt;strong&gt;  columnObject.ColumnMember "assignedToLastFirstName"
&lt;/strong&gt;  columnObject.SortOrder    "Descending"

&lt;/pre&gt;
&lt;p&gt;Where sorting from the context menu does not populate ColumnMember:&lt;/p&gt;&lt;pre&gt;  columnObject.Name	 "assignedToLastFirstName"
&lt;strong&gt;  columnObject.ColumnMember	 undefined
&lt;/strong&gt;  columnObject.SortOrder	 "Ascending"
&lt;span style="background-color: #fffce1; font-family: courier new"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;</description></item></channel></rss>