﻿<?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 set the WebGrid's DropDownList field's Value?</title><link>http://www.intersoftsolutions.com/Community/WebGrid/How-to-set-the-WebGrids-DropDownList-fields-Value/</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 set the WebGrid's DropDownList field's Value?</title><link>http://www.intersoftsolutions.com/Community/WebGrid/How-to-set-the-WebGrids-DropDownList-fields-Value/</link><pubDate>Wed, 08 Dec 2010 03:10:00 GMT</pubDate><dc:creator>niven</dc:creator><description>&lt;p&gt;Hi Shawn,&lt;/p&gt;
&lt;p&gt;Since the DropDownList object already embedded in WebGrid's object it would be more efforts to get dropdown list object. I suggest you to use the WebCombo control by using the following code on OnRowSelect client-side event.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;&lt;pre&gt;function WebGrid1_OnRowSelect(controlId, tblName, rowIndex, rowEl) {
            var WebGrid1 = ISGetObject(controlId);
//            WebGrid1.GetSelectedObject().ToRowObject().GetCells()[2].SetText("Condiments", true);
            return true;
        }&lt;/pre&gt;

&lt;p&gt;And I for your second problems, I did not replicate on my side. Have you use the latest build?&lt;/p&gt;
&lt;p&gt;Thank you and have a nice day.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Niven.&lt;/p&gt;</description></item><item><title>How to set the WebGrid's DropDownList field's Value?</title><link>http://www.intersoftsolutions.com/Community/WebGrid/How-to-set-the-WebGrids-DropDownList-fields-Value/</link><pubDate>Thu, 02 Dec 2010 17:44:25 GMT</pubDate><dc:creator>SAgosto</dc:creator><description>&lt;p&gt;What is the proper way to set the WebGrid's DropDownList field's value?&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Currently, I am using the following method which uses the field's SetChanges method which allows me to set the text and value:&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;&lt;pre&gt;function WebGrid_SetDropDownListValue(field, text, value) 
{
    try 
    {
        // Set DropDownList's value
        if (field == null) { return; }
        field.SetChanges(text, value);
    }
    catch (ex) { ShowJSException(ex); }
}&lt;/pre&gt;
&lt;p&gt;This causes a few problems:&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;1) It will set the text regardless if the VALUE exists in the DropDownList control&lt;/p&gt;
&lt;p&gt;2) When binded, the VALUE is displayed instead of the TEXT. If you click the DropDownList control, the text is displayed. For example, if the following DropDownList contains 1/A and 2/B, if the underlying value is set to "B", the "B" is visible in the WebGrid unless the user clicks the control and then "2" is displayed.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;</description></item></channel></rss>