﻿<?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 do I find the value for ListDataTextField value given the ListDataValueField for a dropdown</title><link>http://www.intersoftsolutions.com/Community/WebGrid/How-do-I-find-the-value-for-ListDataTextField-value-given-the-ListDataValueField-for-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>How do I find the value for ListDataTextField value given the ListDataValueField for a dropdown</title><link>http://www.intersoftsolutions.com/Community/WebGrid/How-do-I-find-the-value-for-ListDataTextField-value-given-the-ListDataValueField-for-a-dropdown/</link><pubDate>Thu, 10 Jun 2010 15:01:08 GMT</pubDate><dc:creator>JohnnyBravo</dc:creator><description>&lt;p&gt;OK, I may have found somthing which works for me.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;I have found that the values held for the drop down list are stored somewhere in the current page in a &amp;lt;select  where the id for the object is &amp;lt;gridname&amp;gt;_&amp;lt;tablename&amp;gt;_&amp;lt;columnname&amp;gt;. I can then acess this in jQuery and get the text value with the following.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;// assume that the select object on the webpage is named grid1_table1_mycolumn&lt;/p&gt;
&lt;p&gt;// assume that the value of the cell is held in the cellValue variable.&lt;/p&gt;
&lt;p&gt; var dropdownTextValue = $("#grid1_table1_mycolumn option[value='" &amp;#43; cellValue &amp;#43; "']").text();&lt;/p&gt;</description></item><item><title>How do I find the value for ListDataTextField value given the ListDataValueField for a dropdown</title><link>http://www.intersoftsolutions.com/Community/WebGrid/How-do-I-find-the-value-for-ListDataTextField-value-given-the-ListDataValueField-for-a-dropdown/</link><pubDate>Thu, 10 Jun 2010 10:49:01 GMT</pubDate><dc:creator>JohnnyBravo</dc:creator><description>&lt;p&gt;This doesn't work for me. Let's assume that I do not want to use the OnEnterEditMode because people can enter the edit mode if they want so it would be called in multiple instances. &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Let's say in javascript I have the value for the dropdown. I obviously know the grid and column I'm working with.&lt;/p&gt;
&lt;p&gt;How can I get to the list of values/text values for the dropdown?&lt;/p&gt;
&lt;p&gt;I've tried grid.RootTable.Columns.GetNamedItem("site").ValueList but there is no data to be pulled. It's DataRetrieved attribute is false.&lt;/p&gt;</description></item><item><title>How do I find the value for ListDataTextField value given the ListDataValueField for a dropdown</title><link>http://www.intersoftsolutions.com/Community/WebGrid/How-do-I-find-the-value-for-ListDataTextField-value-given-the-ListDataValueField-for-a-dropdown/</link><pubDate>Wed, 09 Jun 2010 22:57:37 GMT</pubDate><dc:creator>Glayaar</dc:creator><description>In order to retrieve the text, assuming you are using BatchUpdate WebGrid, you will need to set the value of the cell with the value and invoke ActivateEdit function. Afterward during the OnEnterEditMode client side event handler you will need to retrieve the text from the editobject, in this case a HTML select element. Here is the snippet, assuming we are trying to set the &lt;em&gt;Interest&lt;/em&gt; column second row of WebGrid with the value of 2:&lt;br /&gt;&lt;pre&gt;function UpdateGrid()&lt;br /&gt;{&lt;br /&gt;    var wgTest = ISGetObject("wgTest");&lt;br /&gt;    var row = wgTest.RootTable.GetRow(2);&lt;br /&gt;    var cells = row.GetCells();&lt;br /&gt;    var interestCell = cells.GetNamedItem('Interest');&lt;br /&gt;&lt;br /&gt;    interestCell.SetValue("1");&lt;br /&gt;    row.Select();&lt;br /&gt;    interestCell.ActivateEdit();&lt;br /&gt;    &lt;br /&gt;    row.SetDataChanged();&lt;br /&gt;    row.Update();&lt;br /&gt;&lt;br /&gt;    wgTest.MarkEdit();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function wgTest_OnEnterEditMode(controlId, tblName, editObject)&lt;br /&gt;{&lt;br /&gt;    var wgTest = ISGetObject(controlId);&lt;br /&gt;    var selIndex = editObject.element.selectedIndex&lt;br /&gt;    var selText = editObject.element.options[selIndex].text;&lt;br /&gt;&lt;br /&gt;    editObject.ToCellObject().SetText(selText);&lt;br /&gt;}&lt;/pre&gt;Another suggestion is, depending on the search functionality, you could try retrieving both the cell WebValueList value and cell WebValueList name during the search function. &amp;nbsp; &lt;br /&gt;</description></item><item><title>How do I find the value for ListDataTextField value given the ListDataValueField for a dropdown</title><link>http://www.intersoftsolutions.com/Community/WebGrid/How-do-I-find-the-value-for-ListDataTextField-value-given-the-ListDataValueField-for-a-dropdown/</link><pubDate>Wed, 09 Jun 2010 10:43:46 GMT</pubDate><dc:creator>JohnnyBravo</dc:creator><description>&lt;p&gt;I have a WebGrid and I'm using a dropdown for a column (location). The column is part of a record representing a phone in an office (location, phone number extension).&lt;/p&gt;
&lt;p&gt;The source of the dropdown is a stored procedure.&lt;/p&gt;
&lt;p&gt;There are multiple ways of editing here, but one of the options is when the clicks a button, a 'search' window appears allowing the user to select a different office phone. When this is done, I get the location code of the new phone.&lt;/p&gt;
&lt;p&gt;I can get the location code (which is the ListDataValueField for the dropdown) but how can I get the ListDataText field value?&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;In other words, I only have the Value for the cell. How can I get the Text value from the dropdown when given the Value of the cell?&lt;/p&gt;</description></item></channel></rss>