﻿<?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:  How to change a cell, based on the value in a dropdown?</title><link>http://www.intersoftsolutions.com/Community/WebGrid/WebGrid-How-to-change-a-cell-based-on-the-value-in-a-dropdown/</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:  How to change a cell, based on the value in a dropdown?</title><link>http://www.intersoftsolutions.com/Community/WebGrid/WebGrid-How-to-change-a-cell-based-on-the-value-in-a-dropdown/</link><pubDate>Wed, 08 Jun 2011 14:23:34 GMT</pubDate><dc:creator>MarTin</dc:creator><description>&lt;p&gt;Hello Jim,&lt;/p&gt;
&lt;p&gt;You can detect whether the value in the dropdownlist has changed by using OnExitEditMode client-side event in WebGrid.&lt;/p&gt;
&lt;p&gt;When you add new handler in OnAfterExitEditMode, the code will look like following:&lt;/p&gt;&lt;pre&gt;function WebGrid1_OnAfterExitEditMode(controlId, tableName, editObject)
{
   var WebGrid1 = ISGetObject(controlId); 
			
   return true;
}&lt;/pre&gt;
&lt;p&gt;editObject is the parameter that you can use to get the type of the edited object, which is dropdownlist.&lt;/p&gt;
&lt;p&gt;Then, you can determine the text selected from downdownlist by using editObject.cellElement.innerText. For example:&lt;/p&gt;&lt;pre&gt;function WebGrid1_OnAfterExitEditMode(controlId, tableName, editObject)
{
   var WebGrid1 = ISGetObject(controlId);
   alert(editObject.cellElement.innerText);
   return true;
}&lt;/pre&gt;
&lt;p&gt;With this way, you can determine the changes that you have made in the dropdownlist.&lt;/p&gt;
&lt;p&gt;Hope this helps. Thank you.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;-Martin-&lt;/p&gt;</description></item><item><title>WebGrid:  How to change a cell, based on the value in a dropdown?</title><link>http://www.intersoftsolutions.com/Community/WebGrid/WebGrid-How-to-change-a-cell-based-on-the-value-in-a-dropdown/</link><pubDate>Wed, 08 Jun 2011 08:01:01 GMT</pubDate><dc:creator>jdresser@idexcorp.com</dc:creator><description>&lt;p&gt;I have a WebGrid that has a dropdown list column and a text column:&lt;/p&gt;&lt;pre&gt;              &amp;lt;ISWebGrid:WebGridColumn Caption="Rule" DataMember="Rule" Name="Rule" Width="100px" ColumnType="Text"
                EditType="DropdownList"&amp;gt;
                &amp;lt;ValueList DataSourceID="SqlDataSource_Rule" DataTextField="DataText" DataValueField="DataValue" /&amp;gt;
              &amp;lt;/ISWebGrid:WebGridColumn&amp;gt;
              &amp;lt;ISWebGrid:WebGridColumn Caption="Threshold" DataMember="Threshold" Name="Threshold" Width="100px"&amp;gt;
&lt;/pre&gt;
&lt;p&gt;When the user makes a selection in the dropdown list, I want the value in the second column to change. &lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Example:   The dropdown list contains 2 items: 'KPH Limit' and 'MPH Limit'.   If the user changes the dropdown to 'KPH Limit', I want the second column to change to "100".   If the user changes the dropdown to 'MPH Limit', I want the second column to change to "65".&lt;/p&gt;
&lt;p&gt;How do I detect when the value in the dropdown list has changed?&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Jim&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description></item></channel></rss>