﻿<?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 - WebCombo - Defaultvalue for WebCombo</title><link>http://www.intersoftsolutions.com/Community/WebCombo/Defaultvalue-for-WebCombo/</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>Defaultvalue for WebCombo</title><link>http://www.intersoftsolutions.com/Community/WebCombo/Defaultvalue-for-WebCombo/</link><pubDate>Sun, 29 Nov 2009 22:35:32 GMT</pubDate><dc:creator>handy@intersoftpt.com</dc:creator><category>Default Selected</category><description>&lt;p&gt;Hi Michael,&lt;/p&gt;&lt;p&gt;I don't suggest you to use that way. If you don't want to define the index manually (data[i]), it would be better if you are using the workaround below.&lt;/p&gt;
&lt;p /&gt;&lt;pre&gt;rowChange.Row.Cells.GetNamedItem("SupplierID").Text&lt;/pre&gt;
&lt;p&gt;Hope this helps.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Handy&lt;/p&gt;
&lt;p /&gt;</description></item><item><title>Defaultvalue for WebCombo</title><link>http://www.intersoftsolutions.com/Community/WebCombo/Defaultvalue-for-WebCombo/</link><pubDate>Fri, 27 Nov 2009 05:56:00 GMT</pubDate><dc:creator>Michael</dc:creator><category>Default Selected</category><description>&lt;p&gt;Hi Yudi&lt;/p&gt;
&lt;p&gt;Why doesn't this not work:&lt;/p&gt;
&lt;p&gt;Supplier = rowChange.Data[&lt;strong&gt;&lt;em&gt;rowChange.Row.Cells.IndexOf(SupplierID)&lt;/em&gt;&lt;/strong&gt;].NewText;&lt;/p&gt;
&lt;p&gt;IndexOf() get always -1!&lt;/p&gt;</description></item><item><title>Defaultvalue for WebCombo</title><link>http://www.intersoftsolutions.com/Community/WebCombo/Defaultvalue-for-WebCombo/</link><pubDate>Thu, 26 Nov 2009 06:07:03 GMT</pubDate><dc:creator>Michael</dc:creator><category>Default Selected</category><description>&lt;p&gt;Only one word: &lt;strong&gt;&lt;span style="color: #ff0000"&gt;great!&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="short_text"&gt;&lt;span title="ich habe noch eine kürzere Variante" style="background-color: #ebeff9" closure_hashcode_luba6k="34"&gt;&lt;span class="medium_text" id="result_box"&gt;&lt;span title="Weil ich für ComputerID und SystemID die Valuelist verwende, muss ich DefaultText und DefaultValue speichern." style="background-color: #fff" closure_hashcode_luba6k="90"&gt;&lt;span style="font-size: 10pt"&gt;I still have a shorter version.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="short_text"&gt;&lt;span title="ich habe noch eine kürzere Variante" style="background-color: #ebeff9" closure_hashcode_luba6k="34"&gt;&lt;span class="medium_text"&gt;&lt;span title="Weil ich für ComputerID und SystemID die Valuelist verwende, muss ich DefaultText und DefaultValue speichern." style="background-color: #fff" closure_hashcode_luba6k="90"&gt;&lt;span style="font-size: 10pt"&gt;Because I use System&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="short_text"&gt;&lt;span title="ich habe noch eine kürzere Variante" style="background-color: #ebeff9" closure_hashcode_luba6k="34"&gt;&lt;span class="medium_text"&gt;&lt;span title="Weil ich für ComputerID und SystemID die Valuelist verwende, muss ich DefaultText und DefaultValue speichern." style="background-color: #fff" closure_hashcode_luba6k="90"&gt;&lt;span style="font-size: 10pt"&gt;ID and ComputerID with ValueList, I need to save default text and default value. Now it works fine!!!&lt;img style="border-bottom: medium none; border-left: medium none; border-top: medium none; border-right: medium none" src="http://www.intersoftpt.com/WebResources/Images/Community/Editor/smiley2.gif" /&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;pre&gt;    &amp;lt;script language="javascript" type="text/javascript" id="grd_OnAddPendingChanges"&amp;gt;
		&amp;lt;!--
		function grd_OnAddPendingChanges(controlId, table, rowChange)
		{
		    var grd = ISGetObject(controlId);
		    
		    grd.RootTable.Columns.GetNamedItem("ComputerID").DefaultValue = rowChange.Data[1].NewValue;
		    grd.RootTable.Columns.GetNamedItem("ComputerID").DefaultText = rowChange.Data[1].NewText;
		    grd.RootTable.Columns.GetNamedItem("SystemID").DefaultValue = rowChange.Data[2].NewValue;
		    grd.RootTable.Columns.GetNamedItem("SystemID").DefaultText = rowChange.Data[2].NewText;
		    grd.RootTable.Columns.GetNamedItem("Name").DefaultValue = rowChange.Data[3].NewValue;
			
			return true;
		}
		--&amp;gt;
    &amp;lt;/script&amp;gt;&lt;/pre&gt;
&lt;p&gt;Great job, Yudi!&lt;/p&gt;
&lt;p&gt;Thanks a lot.&lt;/p&gt;
&lt;p&gt;Michael&lt;/p&gt;</description></item><item><title>Defaultvalue for WebCombo</title><link>http://www.intersoftsolutions.com/Community/WebCombo/Defaultvalue-for-WebCombo/</link><pubDate>Thu, 26 Nov 2009 04:43:29 GMT</pubDate><dc:creator>yudi</dc:creator><category>Default Selected</category><description>&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;Handy is not present today and I’m here to help him to provide you a solution for your scenario.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;I’d like to propose another solution for your scenario. There is a property called “DefaultValue” in WebGridColumn that specify the default value of the column when new row is added. We can take the advantage of this property to set the default value of WebCombo (as edit type of the column) in new row of WebGrid.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;I enclosed one simple sample to be tested on your end. In the sample, WebGrid is bind to table “Products” of Northwind database where the columns are: [ProductID]; [ProductName]; [SupplierID]; and [CategoryID]. Value list is added into [SupplierID] and [CategoryID] column in order to have WebGrid shows [CompanyName] and [CategoryName] respectively. Two WebCombos are also added as the edit type of [SupplierID] and [CategoryID] column.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;I simply create two global variables to store cached new cells value. These values are initially set with no value (empty). On AddPendingChanges event, the cached new cells value is stored into the global variable and then set the “DefaultValue” of [SupplierID] and [CategoryID] column with the stored values.&lt;/span&gt;&lt;/p&gt;&lt;pre&gt;&amp;lt;script type="text/javascript"&amp;gt;
    &amp;lt;!--
    var Supplier;
    var Category;

    function WebGrid1_OnAddPendingChanges(controlId, table, rowChange) {
        var WebGrid1 = ISGetObject(controlId);

        //store added pending changes of Supplier and Categories
        Supplier = rowChange.Data[2].NewText;
        Category = rowChange.Data[3].NewText;

        //set default value of SupplierID and CategoryID column
        WebGrid1.RootTable.Columns.GetNamedItem("SupplierID").DefaultValue = Supplier;
        WebGrid1.RootTable.Columns.GetNamedItem("CategoryID").DefaultValue = Category;

        return true;
    }
    --&amp;gt;
&amp;lt;/script&amp;gt;&lt;/pre&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;For more detail information, please check the attached sample.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;Hope this help.&lt;/span&gt;&lt;/p&gt;</description></item><item><title>Defaultvalue for WebCombo</title><link>http://www.intersoftsolutions.com/Community/WebCombo/Defaultvalue-for-WebCombo/</link><pubDate>Wed, 25 Nov 2009 09:15:38 GMT</pubDate><dc:creator>Michael</dc:creator><category>Default Selected</category><description>&lt;p&gt;Hi Handy&lt;/p&gt;
&lt;p&gt;Thanks for your last post!&lt;/p&gt;
&lt;p&gt;I use OnAddPendingChanges to store rowdata in hidden input text:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;span style="color: #ff0000"&gt;document.getElementById("Hidden1").value = rowChange.Data[1].NewValue;&lt;/span&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;span style="color: #ff0000"&gt;document.getElementById("Hidden2").value = rowChange.Data[1].NewText;&lt;/span&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;span style="color: #ff0000"&gt;document.getElementById("Hidden3").value = rowChange.Data[2].NewValue;&lt;/span&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="short_text" id="result_box"&gt;&lt;span title="und so weiter" style="background-color: #fff" closure_hashcode_ay4uv3="22"&gt;&lt;span style="font-size: 10pt"&gt;and so on...&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="short_text"&gt;&lt;span title="und so weiter" style="background-color: #fff" closure_hashcode_ay4uv3="22"&gt;&lt;/span&gt;&lt;/span&gt; &lt;/p&gt;
&lt;p&gt;&lt;span class="short_text"&gt;&lt;span title="und so weiter" style="background-color: #fff" closure_hashcode_ay4uv3="22"&gt;For reading from hidden input text i use OnRowSelect:&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="short_text"&gt;&lt;span title="und so weiter" style="background-color: #fff" closure_hashcode_ay4uv3="22"&gt;&lt;em&gt;&lt;span style="color: #ff0000"&gt;if (rowEl.getAttribute("type") == "NewRow") {&lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="short_text"&gt;&lt;span title="und so weiter" style="background-color: #fff" closure_hashcode_ay4uv3="22"&gt;&lt;em&gt;&lt;span style="color: #ff0000"&gt;&lt;span class="short_text"&gt;&lt;span title="und so weiter" style="background-color: #fff" closure_hashcode_ay4uv3="22"&gt;&lt;span style="color: #000000"&gt;But how can i restore?&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="short_text"&gt;&lt;span title="und so weiter" style="background-color: #fff" closure_hashcode_ay4uv3="22"&gt;&lt;em&gt;&lt;span style="color: #ff0000"&gt;}&lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="short_text"&gt;&lt;span title="und so weiter" style="background-color: #fff" closure_hashcode_ay4uv3="22"&gt;&lt;span style="color: #000000"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; &lt;/p&gt;
&lt;p&gt;&lt;span class="short_text"&gt;&lt;span title="und so weiter" style="background-color: #fff" closure_hashcode_ay4uv3="22"&gt;I try this:&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="short_text"&gt;&lt;span title="und so weiter" style="background-color: #fff" closure_hashcode_ay4uv3="22"&gt;        rowEl.cells[4].innerHTML = document.getElementById("Hidden1").value;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="short_text"&gt;&lt;span title="und so weiter" style="background-color: #fff" closure_hashcode_ay4uv3="22"&gt;or this:&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="short_text"&gt;&lt;span title="und so weiter" style="background-color: #fff" closure_hashcode_ay4uv3="22"&gt;       var newRow = grd.RootTable.NewRow();&lt;br /&gt;       var cells = newRow.GetCells();&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="short_text"&gt;&lt;span title="und so weiter" style="background-color: #fff" closure_hashcode_ay4uv3="22"&gt;       cells.GetNamedItem("Column1").SetValue(document.getElementById("Hidden1").value, false);&lt;br /&gt;&lt;span class="short_text"&gt;&lt;span title="und so weiter" style="background-color: #fff" closure_hashcode_ay4uv3="22"&gt;       cells.GetNamedItem("Column1").SetText(document.getElementById("Hidden2").value, false);&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="short_text"&gt;&lt;span title="und so weiter" style="background-color: #fff" closure_hashcode_ay4uv3="22"&gt;       cells.GetNamedItem("Column2").SetValue(document.getElementById("Hidden3").value, false);&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="short_text"&gt;&lt;span title="und so weiter" style="background-color: #fff" closure_hashcode_ay4uv3="22"&gt;Which is the best way to do this?&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="short_text"&gt;&lt;span title="und so weiter" style="background-color: #fff" closure_hashcode_ay4uv3="22"&gt;Thanks for a sample.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="short_text"&gt;&lt;span title="und so weiter" style="background-color: #fff" closure_hashcode_ay4uv3="22"&gt;Best regards&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="short_text"&gt;&lt;span title="und so weiter" style="background-color: #fff" closure_hashcode_ay4uv3="22"&gt;Michael&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;</description></item><item><title>Defaultvalue for WebCombo</title><link>http://www.intersoftsolutions.com/Community/WebCombo/Defaultvalue-for-WebCombo/</link><pubDate>Sun, 15 Nov 2009 22:04:58 GMT</pubDate><dc:creator>handy@intersoftpt.com</dc:creator><category>Default Selected</category><description>&lt;p&gt;Hi Michael,&lt;/p&gt;&lt;p&gt;I think use Input Text hidden is better than using cookies. It also easier to use. &lt;/p&gt;
&lt;p&gt;When you at BatchUpdate scenario, those events would not be fired. It is a default behaviour. The correct event you should be looking for, is OnAddPendingChanges client side event.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Handy&lt;/p&gt;</description></item><item><title>Defaultvalue for WebCombo</title><link>http://www.intersoftsolutions.com/Community/WebCombo/Defaultvalue-for-WebCombo/</link><pubDate>Fri, 13 Nov 2009 01:42:55 GMT</pubDate><dc:creator>Michael</dc:creator><category>Default Selected</category><description>&lt;p&gt;Hi Handy&lt;/p&gt;
&lt;p&gt;I want to do the following:&lt;/p&gt;
&lt;p&gt;When a user adds a new row, I want cache the new cell values. If the user adds an another row, i want to use the cached cell values as default values. Maybe can i use Cookies?&lt;/p&gt;
&lt;p&gt;With batch update the client side events OnAfterAdd/OnBeforeAdd are not fired!&lt;/p&gt;
&lt;p&gt;Which event do I need?&lt;/p&gt;
&lt;p&gt;Serverside or Clientside?&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;
&lt;p&gt;Michael&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;</description></item><item><title>Defaultvalue for WebCombo</title><link>http://www.intersoftsolutions.com/Community/WebCombo/Defaultvalue-for-WebCombo/</link><pubDate>Thu, 12 Nov 2009 22:16:12 GMT</pubDate><dc:creator>handy@intersoftpt.com</dc:creator><category>Default Selected</category><description>&lt;p&gt;Hi Michael,&lt;/p&gt;&lt;p&gt;Normally, when you integrate WebCombo into WebGrid, the default value or text should be fit with WebGrid cell value text. I don't quite understand about what your requirement. But If you want to set default value of WebCombo, you can set WebCombo1.Value at page load server side.&lt;br /&gt;Or if you want to set text of WebGridRow (WebCombo depend on this value), you need to specify at &lt;b&gt;&lt;i&gt;OnInitilizeRow&lt;/i&gt;&lt;/b&gt; event. Hope this helps.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;HAndy &lt;/p&gt;</description></item><item><title>Defaultvalue for WebCombo</title><link>http://www.intersoftsolutions.com/Community/WebCombo/Defaultvalue-for-WebCombo/</link><pubDate>Thu, 12 Nov 2009 11:26:13 GMT</pubDate><dc:creator>Michael</dc:creator><category>Default Selected</category><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;I have integrated WebCombo in WebGrid.&lt;/p&gt;
&lt;p&gt;For a better usability, i want set the default value of WebCombo. The default value should be the previous value that the user has chosen. The frist time the default value is empty.&lt;/p&gt;
&lt;p&gt;Some tips, how i can do this?&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
&lt;p&gt;Michael&lt;/p&gt;</description></item></channel></rss>