﻿<?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 - How to add filter to FilteredColumns if filtered column is a value list</title><link>http://www.intersoftsolutions.com/Community/WebGrid/How-to-add-filter-to-FilteredColumns-if-filtered-column-is-a-value-list/</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>How to add filter to FilteredColumns if filtered column is a value list</title><link>http://www.intersoftsolutions.com/Community/WebGrid/How-to-add-filter-to-FilteredColumns-if-filtered-column-is-a-value-list/</link><pubDate>Sun, 27 Jun 2010 23:05:45 GMT</pubDate><dc:creator>Glayaar</dc:creator><description>&lt;p&gt;In order to show the filter text for dropdownlist when you are filtering programmatically you will need to set the filter text manually in the corresponding filter row cell.&lt;/p&gt;&lt;p&gt;Here is a snippet for such scenario, the value of the filter is &lt;em&gt;2&lt;/em&gt; while the filter text is &lt;em&gt;Interest 1&lt;/em&gt; and the filtered cell is the fourth cell in the WebGrid:&lt;/p&gt;&lt;pre&gt;function FilterGrid() &lt;br /&gt;{&lt;br /&gt;    var grid = ISGetObject("wgTest");&lt;br /&gt;&lt;br /&gt;    var newFilter = new WebGridFilter(); // create new Filter configuration&lt;br /&gt;    newFilter.ColumnMember = "Interest";&lt;br /&gt;    newFilter.FilterType = "EqualTo";&lt;br /&gt;    newFilter.FilterText = "2";&lt;br /&gt;&lt;br /&gt;    grid.RootTable.FilteredColumns.Add(newFilter);&lt;br /&gt;    grid.RootTable.FilteredColumns.Add(newFilter2);&lt;br /&gt;    grid.RootTable.UpdateUI();&lt;br /&gt;    grid.Refresh(); // apply changes&lt;br /&gt;&lt;br /&gt;    var colHeaderRows = grid.RootTable.GetElement(WG40.COLHEADER, WG40.HTMLROW).getElementsByTagName("tr");&lt;br /&gt;    for(var i = 0; i &amp;lt; colHeaderRows.length; i&amp;#43;&amp;#43;)&lt;br /&gt;    {&lt;br /&gt;        var colHeader = colHeaderRows[i];&lt;br /&gt;        if (colHeader.getAttribute("type") == "FilterRow") &lt;br /&gt;        {&lt;br /&gt;            colHeader.getElementsByTagName("td")[4].getElementsByTagName("span")[0].innerHTML = "Interest 1";&lt;br /&gt;&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;/pre&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;  &lt;/p&gt;</description></item><item><title>How to add filter to FilteredColumns if filtered column is a value list</title><link>http://www.intersoftsolutions.com/Community/WebGrid/How-to-add-filter-to-FilteredColumns-if-filtered-column-is-a-value-list/</link><pubDate>Fri, 25 Jun 2010 11:33:30 GMT</pubDate><dc:creator>NK1958</dc:creator><description>&lt;p&gt;I have applied filter to a valuelist(dropdown).  Even filter works properly, it is not selected item in a dropdown filter? How to make it selected item?&lt;/p&gt;</description></item><item><title>How to add filter to FilteredColumns if filtered column is a value list</title><link>http://www.intersoftsolutions.com/Community/WebGrid/How-to-add-filter-to-FilteredColumns-if-filtered-column-is-a-value-list/</link><pubDate>Sun, 20 Jun 2010 23:29:57 GMT</pubDate><dc:creator>Glayaar</dc:creator><description>&lt;p&gt;From my test, the code will be the same, adding WebGrid filter to FilteredColumns collection. However, if you are using WebValueList, the filter text will be the value of the DataValueField you assign in the WebValueList. &lt;br /&gt;&lt;/p&gt;</description></item><item><title>How to add filter to FilteredColumns if filtered column is a value list</title><link>http://www.intersoftsolutions.com/Community/WebGrid/How-to-add-filter-to-FilteredColumns-if-filtered-column-is-a-value-list/</link><pubDate>Sun, 20 Jun 2010 18:41:33 GMT</pubDate><dc:creator>NK1958</dc:creator><description>&lt;span style="font-size: 13px; color: #0000ff"&gt;&lt;span style="font-size: 13px; color: #0000ff"&gt;
&lt;p&gt;Hello InterSoft,&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;I need to add filter to grid FilteredColumns collection in javascript. If filter is a simple textbox then code below works fine.&lt;/p&gt;
var&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 13px"&gt; gridName = fnGetActiveGrid(&lt;/span&gt;&lt;span style="font-size: 13px; color: #0000ff"&gt;&lt;span style="font-size: 13px; color: #0000ff"&gt;true&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 13px"&gt;); &lt;/span&gt;&lt;span style="font-size: 13px"&gt;&lt;/span&gt;&lt;span style="font-size: 13px; color: #0000ff"&gt;&lt;span style="font-size: 13px; color: #0000ff"&gt;var&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 13px"&gt; filter = &lt;/span&gt;&lt;span style="font-size: 13px; color: #0000ff"&gt;&lt;span style="font-size: 13px; color: #0000ff"&gt;new&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 13px"&gt; WebGridFilter(); filter.ColumnMember = &lt;/span&gt;&lt;span style="font-size: 13px; color: #800000"&gt;&lt;span style="font-size: 13px; color: #800000"&gt;"BATCH_ID" 
&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 13px"&gt;&lt;p&gt;filter.FilterType = &lt;span style="font-size: 13px; color: #800000"&gt;&lt;span style="font-size: 13px; color: #800000"&gt;"EqualTo"&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 13px"&gt;;&lt;p&gt;filter.FilterText = "xyz";&lt;/p&gt;&lt;p&gt;grid.RootTable.FilteredColumns.Add(filter);&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;How to do the same functionality for a filter in a grid&amp;nbsp;which is a valuelist (dropdown)? I assume that I need to point from cell to combo and than use &lt;strong&gt;combo.SetAdditionalFilters()&lt;/strong&gt; function. What is a code to do it?&amp;nbsp; I am doing it from cell_click event so I know columnId,cellId ...&lt;/p&gt;&lt;p&gt;Thank you&lt;/p&gt;&lt;p&gt;Thank you&lt;/p&gt;&lt;/span&gt;&lt;/p&gt;&lt;/span&gt;&lt;span style="font-size: 13px; color: #800000"&gt;&lt;span style="font-size: 13px; color: #800000"&gt;"EqualTo"&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 13px"&gt;;&lt;p&gt;filter.FilterText = "xyz";&lt;/p&gt;&lt;p&gt;grid.RootTable.FilteredColumns.Add(filter);&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;How to do the same functionality for a filter in a grid&amp;nbsp;which is a valuelist (dropdown)? I assume that I need to point from cell to combo and than use &lt;strong&gt;combo.SetAdditionalFilters()&lt;/strong&gt; function. What is a code to do it?&amp;nbsp; I am doing it from cell_click event so I know columnId,cellId ...&lt;/p&gt;&lt;p&gt;Thank you&lt;/p&gt;&lt;p&gt;Thank you&lt;/p&gt;&lt;/span&gt;</description></item></channel></rss>