﻿<?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 - Lounge - Custom Row sorting in web Grid</title><link>http://www.intersoftsolutions.com/Community/Lounge/Custom-Row-sorting-in-web-Grid/</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>Custom Row sorting in web Grid</title><link>http://www.intersoftsolutions.com/Community/Lounge/Custom-Row-sorting-in-web-Grid/</link><pubDate>Wed, 18 Mar 2015 04:12:36 GMT</pubDate><dc:creator>yudi</dc:creator><category>web Grid custom row sorting</category><description>&lt;blockquote&gt;can we have two header rows in a grid?&lt;/blockquote&gt;&lt;p&gt;&lt;span style="color: #1f497d;"&gt;Yes, you can utilize the ColumnSet feature to have two header rows in a grid. For example: following snippet code will create two header rows in WebGrid based on the grid's layout that you post on March 5, 2015.&lt;/span&gt;&lt;/p&gt;&lt;pre&gt;&amp;lt;ISWebGrid:WebGrid ID="WebGrid1" runat="server" ...&amp;gt;
    &amp;lt;RootTable DataKeyField="CustomerID" RowLayout="ColumnSet"&amp;gt;
        &amp;lt;Columns&amp;gt;
            &amp;lt;ISWebGrid:WebGridColumn Caption="Numeric Value" DataMember="CustomerID" Name="CustomerID"
                Width="100px"&amp;gt;
            &amp;lt;/ISWebGrid:WebGridColumn&amp;gt;
            &amp;lt;ISWebGrid:WebGridColumn Caption="Alphabetical Value" DataMember="CompanyName" Name="CompanyName"
                Width="100px"&amp;gt;
            &amp;lt;/ISWebGrid:WebGridColumn&amp;gt;
            &amp;lt;ISWebGrid:WebGridColumn Caption="Numeric Value" DataMember="ContactName" Name="ContactName"
                Width="100px"&amp;gt;
            &amp;lt;/ISWebGrid:WebGridColumn&amp;gt;
            &amp;lt;ISWebGrid:WebGridColumn Caption="Numeric Value" DataMember="ContactTitle" Name="ContactTitle"
                Width="100px"&amp;gt;
            &amp;lt;/ISWebGrid:WebGridColumn&amp;gt;
        &amp;lt;/Columns&amp;gt;
        &amp;lt;ColumnSets&amp;gt;
            &amp;lt;ISWebGrid:WebGridColumnSet Caption="SI. No" ColumnCount="1" Name="ColumnSet0" Width="100px"&amp;gt;
                &amp;lt;Layout&amp;gt;
                    &amp;lt;ISWebGrid:WebGridRowLayout ColumnMember="[set your SI.No column member in here]" /&amp;gt;
                &amp;lt;/Layout&amp;gt;
            &amp;lt;/ISWebGrid:WebGridColumnSet&amp;gt;
            &amp;lt;ISWebGrid:WebGridColumnSet Caption="Name" ColumnCount="1" Name="ColumnSet1" Width="100px"&amp;gt;
                &amp;lt;Layout&amp;gt;
                    &amp;lt;ISWebGrid:WebGridRowLayout ColumnMember="[set your Name column member in here]" /&amp;gt;
                &amp;lt;/Layout&amp;gt;
            &amp;lt;/ISWebGrid:WebGridColumnSet&amp;gt;
            &amp;lt;ISWebGrid:WebGridColumnSet Caption="Mob. No." ColumnCount="1" Name="ColumnSet2" Width="100px"&amp;gt;
                &amp;lt;Layout&amp;gt;
                    &amp;lt;ISWebGrid:WebGridRowLayout ColumnMember="[set your Mob.No column member in here]" /&amp;gt;
                &amp;lt;/Layout&amp;gt;
            &amp;lt;/ISWebGrid:WebGridColumnSet&amp;gt;
            &amp;lt;ISWebGrid:WebGridColumnSet Caption="ID Mo." ColumnCount="1" Name="ColumnSet3" Width="100px"&amp;gt;
                &amp;lt;Layout&amp;gt;
                    &amp;lt;ISWebGrid:WebGridRowLayout ColumnMember="[set your Id.Mo column member in here]" /&amp;gt;
                &amp;lt;/Layout&amp;gt;
            &amp;lt;/ISWebGrid:WebGridColumnSet&amp;gt;
        &amp;lt;/ColumnSets&amp;gt;
        &amp;lt;ColumnSetSettings RowCount="1" ShowHeaders="Yes" /&amp;gt;
    &amp;lt;/RootTable&amp;gt;
&amp;lt;/ISWebGrid:WebGrid&amp;gt;&lt;/pre&gt;
&lt;br&gt;
&lt;p&gt;&lt;span style="color: #1f497d;"&gt;Result:&lt;/span&gt;&lt;/p&gt;
&lt;img src="http://www.intersoftpt.com/Community/Attachments/3898/TwoHeaderWebGrid.png"&gt;&lt;br&gt;&lt;p&gt;&lt;span style="color: #1f497d;"&gt;Hope this helps.&lt;/span&gt;&lt;/p&gt;</description></item><item><title>Custom Row sorting in web Grid</title><link>http://www.intersoftsolutions.com/Community/Lounge/Custom-Row-sorting-in-web-Grid/</link><pubDate>Tue, 17 Mar 2015 08:43:04 GMT</pubDate><dc:creator>devashish</dc:creator><category>web Grid custom row sorting</category><description>&lt;p class="MsoNormal"&gt;Hi,&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;For a workaround can we have two header rows in a grid i.e.one header and other sub header?&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p&gt;



&lt;/p&gt;&lt;p class="MsoNormal"&gt;Regards,&lt;br&gt;Dev&lt;/p&gt;</description></item><item><title>Custom Row sorting in web Grid</title><link>http://www.intersoftsolutions.com/Community/Lounge/Custom-Row-sorting-in-web-Grid/</link><pubDate>Tue, 10 Mar 2015 02:26:30 GMT</pubDate><dc:creator>yudi</dc:creator><category>web Grid custom row sorting</category><description>&lt;p&gt;&lt;span style="color: #1f497d;"&gt;I'm afraid that it is not possible to omit a row while sorting. In custom sorting approach, we simply define the Table; ColumnMember; and SortOrder of WebGridGroup object and there is no such options that meet your scenario.&lt;/span&gt;&lt;/p&gt;</description></item><item><title>Custom Row sorting in web Grid</title><link>http://www.intersoftsolutions.com/Community/Lounge/Custom-Row-sorting-in-web-Grid/</link><pubDate>Thu, 05 Mar 2015 05:46:46 GMT</pubDate><dc:creator>devashish</dc:creator><category>web Grid custom row sorting</category><description>&lt;p style="margin: 0in 0in 15pt;"&gt;&lt;span style="font-size: 10pt; font-family: 'Lucida Sans Unicode', sans-serif;"&gt;Hi Hans,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0in 0in 15pt;"&gt;&lt;span style="font-size: 10pt; font-family: 'Lucida Sans Unicode', sans-serif;"&gt;Is there a way I can omit&amp;nbsp;one row from getting sorted.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0in 0in 15pt;"&gt;&lt;span style="font-size: 10pt; font-family: 'Lucida Sans Unicode', sans-serif;"&gt;I have below grid &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;table class="MsoTableGrid" border="1" cellspacing="0" cellpadding="0" style="border-collapse:collapse;border:none;mso-border-alt:solid windowtext .5pt; mso-yfti-tbllook:1184;mso-padding-alt:0in 5.4pt 0in 5.4pt"&gt; &lt;tbody&gt;&lt;tr&gt;
  &lt;td valign="top" style="border: 1pt solid windowtext; padding: 0in 5.4pt;"&gt;
  &lt;p style="margin: 0in 0in 0.0001pt;"&gt;&lt;b&gt;&lt;span style="font-size: 10pt; font-family: 'Lucida Sans Unicode', sans-serif;"&gt;Sl. No&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;
  &lt;/td&gt;
  &lt;td valign="top" style="border-style: solid solid solid none; border-top-color: windowtext; border-right-color: windowtext; border-bottom-color: windowtext; border-top-width: 1pt; border-right-width: 1pt; border-bottom-width: 1pt; padding: 0in 5.4pt;"&gt;
  &lt;p style="margin: 0in 0in 0.0001pt;"&gt;&lt;b&gt;&lt;span style="font-size: 10pt; font-family: 'Lucida Sans Unicode', sans-serif;"&gt;Name &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;
  &lt;/td&gt;
  &lt;td valign="top" style="border-style: solid solid solid none; border-top-color: windowtext; border-right-color: windowtext; border-bottom-color: windowtext; border-top-width: 1pt; border-right-width: 1pt; border-bottom-width: 1pt; padding: 0in 5.4pt;"&gt;
  &lt;p style="margin: 0in 0in 0.0001pt;"&gt;&lt;b&gt;&lt;span style="font-size: 10pt; font-family: 'Lucida Sans Unicode', sans-serif;"&gt;Mob. No.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;
  &lt;/td&gt;
  &lt;td valign="top" style="border-style: solid solid solid none; border-top-color: windowtext; border-right-color: windowtext; border-bottom-color: windowtext; border-top-width: 1pt; border-right-width: 1pt; border-bottom-width: 1pt; padding: 0in 5.4pt;"&gt;
  &lt;p style="margin: 0in 0in 0.0001pt;"&gt;&lt;b&gt;&lt;span style="font-size: 10pt; font-family: 'Lucida Sans Unicode', sans-serif;"&gt;ID Mo. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;
  &lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
  &lt;td valign="top" style="border-style: none solid solid; border-right-color: windowtext; border-bottom-color: windowtext; border-left-color: windowtext; border-right-width: 1pt; border-bottom-width: 1pt; border-left-width: 1pt; padding: 0in 5.4pt;"&gt;
  &lt;p style="margin: 0in 0in 0.0001pt;"&gt;&lt;i&gt;&lt;span style="font-size: 10pt; font-family: 'Lucida Sans Unicode', sans-serif;"&gt;Numeric Value&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;
  &lt;/td&gt;
  &lt;td valign="top" style="border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;
  border-right:solid windowtext 1.0pt;mso-border-top-alt:solid windowtext .5pt;
  mso-border-left-alt:solid windowtext .5pt;mso-border-alt:solid windowtext .5pt;
  padding:0in 5.4pt 0in 5.4pt"&gt;
  &lt;p style="margin: 0in 0in 0.0001pt;"&gt;&lt;i&gt;&lt;span style="font-size: 10pt; font-family: 'Lucida Sans Unicode', sans-serif;"&gt;Alphabetical Value &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;
  &lt;/td&gt;
  &lt;td valign="top" style="border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;
  border-right:solid windowtext 1.0pt;mso-border-top-alt:solid windowtext .5pt;
  mso-border-left-alt:solid windowtext .5pt;mso-border-alt:solid windowtext .5pt;
  padding:0in 5.4pt 0in 5.4pt"&gt;
  &lt;p style="margin: 0in 0in 0.0001pt;"&gt;&lt;i&gt;&lt;span style="font-size: 10pt; font-family: 'Lucida Sans Unicode', sans-serif;"&gt;Numeric Value&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;
  &lt;/td&gt;
  &lt;td valign="top" style="border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;
  border-right:solid windowtext 1.0pt;mso-border-top-alt:solid windowtext .5pt;
  mso-border-left-alt:solid windowtext .5pt;mso-border-alt:solid windowtext .5pt;
  padding:0in 5.4pt 0in 5.4pt"&gt;
  &lt;p style="margin: 0in 0in 0.0001pt;"&gt;&lt;i&gt;&lt;span style="font-size: 10pt; font-family: 'Lucida Sans Unicode', sans-serif;"&gt;Numeric Value&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;
  &lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
  &lt;td valign="top" style="border-style: none solid solid; border-right-color: windowtext; border-bottom-color: windowtext; border-left-color: windowtext; border-right-width: 1pt; border-bottom-width: 1pt; border-left-width: 1pt; padding: 0in 5.4pt;"&gt;
  &lt;p style="margin: 0in 0in 0.0001pt;"&gt;&lt;span style="font-size: 10pt; font-family: 'Lucida Sans Unicode', sans-serif;"&gt;1&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
  &lt;/td&gt;
  &lt;td valign="top" style="border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;
  border-right:solid windowtext 1.0pt;mso-border-top-alt:solid windowtext .5pt;
  mso-border-left-alt:solid windowtext .5pt;mso-border-alt:solid windowtext .5pt;
  padding:0in 5.4pt 0in 5.4pt"&gt;
  &lt;p style="margin: 0in 0in 0.0001pt;"&gt;&lt;span style="font-size: 10pt; font-family: 'Lucida Sans Unicode', sans-serif;"&gt;Dev&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
  &lt;/td&gt;
  &lt;td valign="top" style="border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;
  border-right:solid windowtext 1.0pt;mso-border-top-alt:solid windowtext .5pt;
  mso-border-left-alt:solid windowtext .5pt;mso-border-alt:solid windowtext .5pt;
  padding:0in 5.4pt 0in 5.4pt"&gt;
  &lt;p style="margin: 0in 0in 0.0001pt;"&gt;&lt;span style="font-size: 10pt; font-family: 'Lucida Sans Unicode', sans-serif;"&gt;123456789&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
  &lt;/td&gt;
  &lt;td valign="top" style="border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;
  border-right:solid windowtext 1.0pt;mso-border-top-alt:solid windowtext .5pt;
  mso-border-left-alt:solid windowtext .5pt;mso-border-alt:solid windowtext .5pt;
  padding:0in 5.4pt 0in 5.4pt"&gt;
  &lt;p style="margin: 0in 0in 0.0001pt;"&gt;&lt;span style="font-size: 10pt; font-family: 'Lucida Sans Unicode', sans-serif;"&gt;555444666&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
  &lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr style="mso-yfti-irow:3;mso-yfti-lastrow:yes;height:18.4pt"&gt;
  &lt;td valign="top" style="border-style: none solid solid; border-right-color: windowtext; border-bottom-color: windowtext; border-left-color: windowtext; border-right-width: 1pt; border-bottom-width: 1pt; border-left-width: 1pt; padding: 0in 5.4pt; height: 18.4pt;"&gt;
  &lt;p style="margin: 0in 0in 0.0001pt;"&gt;&lt;span style="font-size: 10pt; font-family: 'Lucida Sans Unicode', sans-serif;"&gt;2&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
  &lt;/td&gt;
  &lt;td valign="top" style="border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;
  border-right:solid windowtext 1.0pt;mso-border-top-alt:solid windowtext .5pt;
  mso-border-left-alt:solid windowtext .5pt;mso-border-alt:solid windowtext .5pt;
  padding:0in 5.4pt 0in 5.4pt;height:18.4pt"&gt;
  &lt;p style="margin: 0in 0in 0.0001pt;"&gt;&lt;span style="font-size: 10pt; font-family: 'Lucida Sans Unicode', sans-serif;"&gt;Ashish&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
  &lt;/td&gt;
  &lt;td valign="top" style="border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;
  border-right:solid windowtext 1.0pt;mso-border-top-alt:solid windowtext .5pt;
  mso-border-left-alt:solid windowtext .5pt;mso-border-alt:solid windowtext .5pt;
  padding:0in 5.4pt 0in 5.4pt;height:18.4pt"&gt;
  &lt;p style="margin: 0in 0in 0.0001pt;"&gt;&lt;span style="font-size: 10pt; font-family: 'Lucida Sans Unicode', sans-serif;"&gt;987654321&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
  &lt;/td&gt;
  &lt;td valign="top" style="border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;
  border-right:solid windowtext 1.0pt;mso-border-top-alt:solid windowtext .5pt;
  mso-border-left-alt:solid windowtext .5pt;mso-border-alt:solid windowtext .5pt;
  padding:0in 5.4pt 0in 5.4pt;height:18.4pt"&gt;
  &lt;p style="margin: 0in 0in 0.0001pt;"&gt;&lt;span style="font-size: 10pt; font-family: 'Lucida Sans Unicode', sans-serif;"&gt;666444555&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
  &lt;/td&gt;
 &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;p style="margin: 0in 0in 15pt;"&gt;&lt;span style="font-size: 10pt; font-family: 'Lucida Sans Unicode', sans-serif;"&gt;On click of the column header I don’t want the row-0 to change its
position.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;









&lt;/p&gt;&lt;p style="margin: 0in 0in 15pt;"&gt;&lt;span style="font-size: 10pt; font-family: 'Lucida Sans Unicode', sans-serif;"&gt;Regards,&lt;br&gt;
Dev&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;</description></item><item><title>Custom Row sorting in web Grid</title><link>http://www.intersoftsolutions.com/Community/Lounge/Custom-Row-sorting-in-web-Grid/</link><pubDate>Thu, 13 Feb 2014 22:01:27 GMT</pubDate><dc:creator>Hans</dc:creator><category>web Grid custom row sorting</category><description>&lt;p&gt;Hello,&lt;br /&gt;&lt;br /&gt;Thank you for the question regarding WebGrid.&lt;br /&gt;&lt;br /&gt;You could do a custom sorting in “OnCustumSort” WebGrid’s server side event.&lt;br /&gt;Here’s the example snippet code regarding custom sorting:&lt;br /&gt;&lt;/p&gt;&lt;pre&gt;protected void WebGrid1_CustomSort(object sender, ISNet.WebUI.WebGrid.SortEventArgs e){
    WebGridGroup sortCol;
    sortCol = e.SortColumns.GetNamedItem("ContactName");
    WebGridGroup oldSortCol;
    oldSortCol = e.SortColumns.GetNamedItem("CustomerID");
    if (oldSortCol != null)
    {
        sortCol = new WebGridGroup();
        sortCol.Table = oldSortCol.Table;
        sortCol.ColumnMember = "ContactName";
        if (e.SortColumns.GetNamedItem("CustomerID").SortOrder == SortOrder.Ascending)
        {
            sortCol.SortOrder = SortOrder.Ascending;
        }
        else if (e.SortColumns.GetNamedItem("CustomerID").SortOrder == SortOrder.Descending)
        {
            sortCol.SortOrder = SortOrder.Descending;
        }
        e.SortColumns.Remove(oldSortCol); e.SortColumns.Add(sortCol);
    }
}&lt;/pre&gt;With this example line of code above, if you try to sort the “CustomerID” column, it will sort “ContactName” column.&lt;br /&gt;You could put any custom filter as you please.&lt;br /&gt;&lt;br /&gt;Before you use the “OnCustomSort” event, you should set the “AutomaticSort” property to "false".&lt;br /&gt;You can find the “AutomaticSort” property under “RootTable” tag.&lt;br /&gt;&lt;br /&gt;For further information about CustomSort event, you could see in WebGrid documentation.&lt;br /&gt;&lt;br /&gt;Hope this helps.&lt;br /&gt;&lt;br /&gt;Regards,&lt;br /&gt;Hans K.&lt;br /&gt;</description></item><item><title>Custom Row sorting in web Grid</title><link>http://www.intersoftsolutions.com/Community/Lounge/Custom-Row-sorting-in-web-Grid/</link><pubDate>Wed, 12 Feb 2014 01:30:55 GMT</pubDate><dc:creator>gajanaik</dc:creator><category>web Grid custom row sorting</category><description>&lt;p&gt;How to do custom row sorting in Web grid&lt;/p&gt;</description></item></channel></rss>