﻿<?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 - Binding WebCombo Client Side</title><link>http://www.intersoftsolutions.com/Community/WebCombo/Binding-WebCombo-Client-Side/</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>Binding WebCombo Client Side</title><link>http://www.intersoftsolutions.com/Community/WebCombo/Binding-WebCombo-Client-Side/</link><pubDate>Thu, 02 Jan 2014 21:32:10 GMT</pubDate><dc:creator>yudi</dc:creator><description>&lt;p&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;I enclosed one working sample of client-binding WebCombo which implements data-table rebind. Please have the attached sample evaluated on your end and let me hear your feedback.&lt;/span&gt;&lt;/p&gt;</description></item><item><title>Binding WebCombo Client Side</title><link>http://www.intersoftsolutions.com/Community/WebCombo/Binding-WebCombo-Client-Side/</link><pubDate>Sun, 29 Dec 2013 20:21:56 GMT</pubDate><dc:creator>simon.dunn</dc:creator><description>&lt;p&gt;Thanks for the Help Yudi. &lt;/p&gt;&lt;p&gt;However when I get to SetDataSource it is unknown. Same for DataBind, Render, cancelBubble and returnValue. Do I have to set something else for these events to register?&lt;/p&gt;</description></item><item><title>Binding WebCombo Client Side</title><link>http://www.intersoftsolutions.com/Community/WebCombo/Binding-WebCombo-Client-Side/</link><pubDate>Wed, 25 Dec 2013 20:28:34 GMT</pubDate><dc:creator>yudi@intersoftpt.com</dc:creator><description>&lt;p&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;Thank you for your recent inquiry regarding client-binding WebCombo.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;Could you please try to use different approach to load new data to the wcStock WebCombo (to re-bind data table instead of adding new rows)? Following snippet code shows a simple sample to rebind data table.&lt;/span&gt;&lt;/p&gt;&lt;pre&gt;function reloadStockItems (jsonItems)
{
    alert(jsonItems);
    var items = eval(jsonItems);
    
    var rows = purchaseOrder.wcStock.GetRows();
    for (var i = 0; rows[i] != null; i&amp;#43;&amp;#43;)
    {
        rows.Remove(rows[i], true);
    }
    
    purchaseOrder.wcStock.Values = null;
	
	var dataTable = new ISDataTable();
    var idColumn = new ISDataColumn(dataTable);
    var descriptionColumn = new ISDataColumn(dataTable);
	var categoryDescriptionColumn = new ISDataColumn(dataTable);
	var groupDescriptionColumn = new ISDataColumn(dataTable);	
    
	/* setup data columns */
    dataTable.Name = dataTable.TableName = "Root";
    idColumn.Name = idColumn.ColumnName = "ID";
    descriptionColumn.Name = textColumn.ColumnName = "Text";
    categoryDescriptionColumn.Name = checkColumn.ColumnName = "Bool";
    groupDescriptionColumn.Name = descColumn.ColumnName = "Desc";
	
	/* add columns to data table */
    dataTable.Columns.Add(idColumn);
    dataTable.Columns.Add(descriptionColumn);
    dataTable.Columns.Add(categoryDescriptionColumn);
    dataTable.Columns.Add(groupDescriptionColumn);
	
	/* add rows to data table */
    for (var i = 0; i &amp;lt; 100; i&amp;#43;&amp;#43;)
    {
        var dataRow = dataTable.NewRow();
        dataRow.Cells.GetNamedItem("ID").Value = i;
        dataRow.Cells.GetNamedItem("Text").Value = "Item " &amp;#43; i;
        dataRow.Cells.GetNamedItem("Bool").Value = (i % 3 != 0);
        dataRow.Cells.GetNamedItem("Desc").Value = "Description " &amp;#43; i;
        dataTable.Rows.Add(dataRow);
    }
	
	/* bind the data table to WebCombo */
    wcStock.SetDataSource(dataTable);
    wcStock.DataBind();
    wcStock.Render();
    event.cancelBubble = true;
    event.returnValue = false;
}
&lt;/pre&gt;
&lt;p&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;I found that (in a working sample) using this approach doesn’t trigger OnAfterItemSelected client-side event.&lt;br /&gt;
Please let us know whether this help or not.&lt;/span&gt;&lt;/p&gt;</description></item><item><title>Binding WebCombo Client Side</title><link>http://www.intersoftsolutions.com/Community/WebCombo/Binding-WebCombo-Client-Side/</link><pubDate>Mon, 23 Dec 2013 22:34:44 GMT</pubDate><dc:creator>simon.dunn</dc:creator><description>&lt;p&gt;Actually, I havent found the answer.  The rows.Clear() actually did absolutely nothing at all, and that is why the next time I used the combo, it had all the right values in it - because it never cleared any.  The incorrect values were all plugged onto the end....so still in the world of pain.&lt;/p&gt;</description></item><item><title>Binding WebCombo Client Side</title><link>http://www.intersoftsolutions.com/Community/WebCombo/Binding-WebCombo-Client-Side/</link><pubDate>Sun, 22 Dec 2013 23:11:43 GMT</pubDate><dc:creator>simon.dunn</dc:creator><description>&lt;p&gt;Ok found my own solution.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Instead of removing the old rows manually in a loop, instead simply use .Clear().&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Second problem averted by checking Disabling he WebCombo at the beginning of &lt;span style="background-color: rgb(255, 252, 225); font-family: 'courier new', tahoma; font-size: 9pt; color: rgb(63, 63, 63); line-height: 18px; white-space: pre-wrap;"&gt;reloadStockItems() &lt;/span&gt;&lt;span style="font-size: 10pt;"&gt;then enabling it at the end, after the&amp;nbsp;&lt;/span&gt;&lt;span style="background-color: rgb(255, 252, 225); font-family: 'courier new', tahoma; font-size: 9pt; color: rgb(63, 63, 63); line-height: 18px; white-space: pre-wrap;"&gt;UpdateUI(). &lt;/span&gt;&lt;span style="font-size: 10pt;"&gt;This didn't actually stop the&amp;nbsp;&lt;/span&gt;&lt;span style="background-color: rgb(255, 252, 225); font-family: 'courier new', tahoma; font-size: 9pt; color: rgb(63, 63, 63); line-height: 18px; white-space: pre-wrap;"&gt;_AfterItemSelected &lt;/span&gt;&lt;span style="font-size: 10pt;"&gt;being called, but inside I protected the action by checking webCombo.FrameObj.disabled.&lt;/span&gt;&lt;/p&gt;</description></item><item><title>Binding WebCombo Client Side</title><link>http://www.intersoftsolutions.com/Community/WebCombo/Binding-WebCombo-Client-Side/</link><pubDate>Sun, 22 Dec 2013 18:58:59 GMT</pubDate><dc:creator>simon.dunn</dc:creator><description>&lt;p&gt;I have been trying to bind a webcombo client side, as the other controls are all working client side and with it running server side I would lose other data.  I have given this a red-hot go and got it working for the initial load, but when the combo needs to be reloaded based on other changes on the page, and the second time around there are no "values" to retrieve.  &lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;pre&gt;                    &amp;lt;td class="EditField" colspan="7"&amp;gt;
                        &amp;lt;ISWebCombo:WebCombo ID="wcStock" runat="server" DataMember="Stock" DataValueField="ID" DataTextField="Description" UseDefaultStyle="true" DropDownRows="1000000" Width="232px" BindingOperationMode="ClientBinding"&amp;gt;
                            &amp;lt;Columns&amp;gt;
                                &amp;lt;ISWebCombo:WebComboColumn BaseFieldName="Description" HeaderText="Stock" Name="Description" Width="200px" /&amp;gt;
                                &amp;lt;ISWebCombo:WebComboColumn BaseFieldName="CategoryDescription" HeaderText="Category" Name="CategoryDescription" Width="120px" /&amp;gt;
                                &amp;lt;ISWebCombo:WebComboColumn BaseFieldName="GroupDescription" HeaderText="Group" Name="GroupDescription" Width="120px" /&amp;gt;
                                &amp;lt;ISWebCombo:WebComboColumn BaseFieldName="ID" Hidden="true" Name="ID" Bound="false" /&amp;gt;
                            &amp;lt;/Columns&amp;gt;
                            &amp;lt;LayoutSettings AlwaysShowHelpButton="false" ComboMode="MultipleColumns" AlwaysShowAllRowsOnDropdown="true"&amp;gt;
                                &amp;lt;ClientSideEvents OnAfterItemSelected="wcStock_AfterItemSelected" /&amp;gt;
                            &amp;lt;/LayoutSettings&amp;gt;
                        &amp;lt;/ISWebCombo:WebCombo&amp;gt;
                        &amp;lt;asp:RequiredFieldValidator ID="valReqStock" runat="server" ControlToValidate="wcStock" Display="Dynamic" ErrorMessage="Please select a stock item" ValidationGroup="valGrpItems" /&amp;gt;
                    &amp;lt;/td&amp;gt;
&lt;/pre&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;javascript to remove existing data and reload - this does as expected - rows are removed and new rows added, but the ID Value is not readable the second time through :&amp;gt;&lt;/p&gt;&lt;pre&gt;function reloadStockItems (jsonItems)
{
    alert(jsonItems);
    var items = eval(jsonItems);
    
    var rows = purchaseOrder.wcStock.GetRows();
    for (var i = 0; rows[i] != null; i&amp;#43;&amp;#43;)
    {
        rows.Remove(rows[i], true);
    }
    
    purchaseOrder.wcStock.Values = null;
    
    rows = purchaseOrder.wcStock.GetRows();
    for (i = 0; i &amp;lt; items.length; i &amp;#43;&amp;#43;)
    {
        var stock = items[i];
    
        stock = stock.split('|');
        var newRow = purchaseOrder.wcStock.NewRow(stock[0]);
        newRow.Value = stock[0];
        var cells = newRow.GetCells();
        cells.GetNamedItem("Description").Text = stock[1];
        cells.GetNamedItem("CategoryDescription").Text = stock[2];
        cells.GetNamedItem("GroupDescription").Text = stock[3];
        
        rows.Add(newRow);
    }
    purchaseOrder.wcStock.RefreshValueItems();    
    purchaseOrder.wcStock.UpdateUI();
        
}
&lt;/pre&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;pre&gt;function wcStock_AfterItemSelected(controlId)
{         
    purchaseOrder.wcStock.AddInput("SelectedSupplierValue", purchaseOrder.lstDDSupplier.getSelectedValue());
    purchaseOrder.wcStock.AddInput("SelectedStockValue", purchaseOrder.wcStock.Value);  // &amp;lt;----- problem occurs here in that the values are all set to 0.
    purchaseOrder.wcStock.SendCustomRequest();
    return true;
}
&lt;/pre&gt;
&lt;p&gt; &lt;/p&gt;
&lt;div&gt;My main issue is that after the combo is reloaded - the second time through (and every time afterwards) the Value is set to 0;&lt;/div&gt;
&lt;div&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;Me second problem, which is unpretty, is that for every row added to the combo, the AfterItemSelected event gets fired, without selection occuring (is before it is finished rendeering)&lt;/div&gt;
&lt;div&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;Any help would be appreciated.&lt;/div&gt;
&lt;div&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;cheers&lt;/div&gt;
&lt;div&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;Simon&lt;/div&gt;</description></item></channel></rss>