﻿<?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 - Unbound Child combo: Row Count and adding extra rows</title><link>http://www.intersoftsolutions.com/Community/WebCombo/Unbound-Child-combo-Row-Count-and-adding-extra-rows/</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>Unbound Child combo: Row Count and adding extra rows</title><link>http://www.intersoftsolutions.com/Community/WebCombo/Unbound-Child-combo-Row-Count-and-adding-extra-rows/</link><pubDate>Tue, 16 Feb 2010 22:47:42 GMT</pubDate><dc:creator>andi@intersoftpt.com</dc:creator><description>&lt;p&gt;&lt;span style="font-size: 9pt; "&gt;Hi Ellen,&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 9pt; "&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; Forgive me for the mistake, yes, you can have a link unbound WebCombo with exception that, the child WebCombo should not be an unbound WebCombo. In that so, if we are trying to get the total row of the child WebCombo after the parent WebCombo is chosen, I am afraid, we cannot do that. Since, even though, we select the value in parent WebCombo, without showing the DropDownList of the child WebCombo, the data will not be loaded. That is why, the total row will become zero everytime we are trying to achieve it.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 9pt; "&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; The workaround to get the total row of the child WebCombo is by using the childCombo_OnShowDropDown client side event. With this event, I believe we can use&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: 'times new roman', serif; color: rgb(63, 63, 63); font-size: 9pt; "&gt;&lt;span style="font-size: 9pt; "&gt;var count = combo.GetRowsCount();.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'times new roman', serif; color: rgb(63, 63, 63); font-size: 9pt; "&gt;&lt;span style="font-size: 9pt; "&gt;     &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0); font-family: 'lucida sans unicode'; font-size: 9pt; "&gt;&lt;span style="font-size: 9pt; "&gt;I hope it helps and please do not hesitate to ask if you have any &amp;nbsp;other questions. Thank you.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 9pt; "&gt;Best Regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 9pt; "&gt;Andi Santoso&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Unbound Child combo: Row Count and adding extra rows</title><link>http://www.intersoftsolutions.com/Community/WebCombo/Unbound-Child-combo-Row-Count-and-adding-extra-rows/</link><pubDate>Tue, 16 Feb 2010 13:58:25 GMT</pubDate><dc:creator>ellpan</dc:creator><description>&lt;p&gt;Hi Andi,&lt;/p&gt;
&lt;p&gt;Thank you for replying. You were right about #2: I  missed to set Mode.MultipleColumns. &lt;/p&gt;
&lt;p&gt;As for #1, we can set a link and filter a dependent combo. It works fine in my case. The problem is how to get the correct number of retrieved rows after filtering.&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Ellen&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;</description></item><item><title>Unbound Child combo: Row Count and adding extra rows</title><link>http://www.intersoftsolutions.com/Community/WebCombo/Unbound-Child-combo-Row-Count-and-adding-extra-rows/</link><pubDate>Mon, 15 Feb 2010 02:12:43 GMT</pubDate><dc:creator>andi@intersoftpt.com</dc:creator><description>&lt;p /&gt;&lt;p class="MsoNormal" style="margin-top: 7.5pt; margin-right: 0in; margin-bottom: 7.5pt; margin-left: 0in; "&gt;&lt;span style="font-family: 'lucida sans unicode', sans-serif; color: black; font-size: 9pt; "&gt;&lt;span style="font-size: 9pt; "&gt;Hi Ellen,&lt;o:p /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin-top: 7.5pt; margin-right: 0in; margin-bottom: 7.5pt; margin-left: 0in; "&gt;&lt;span style="font-family: 'lucida sans unicode', sans-serif; color: black; font-size: 9pt; "&gt;&lt;span style="font-size: 9pt; "&gt;    
First of all, forgive me if I am wrong, but if I am not mistaken, when we use
Unbound to populate the data, we cannot create a link setting and filter
another WebCombo. So my suggestion is, since the return value is in data table
as well, why do not you use bound WebCombo. So instead of
cBoChild.PopulateUnboundData(dt,true), you can just put the data table in to
the data source, ex: cBoChild.DataSource = dt. In this way, now we can use the
link setting feature and we do not need the client side even of
"onAfterItemSelected". I believe it is more convenient.&lt;o:p /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin-top: 7.5pt; margin-right: 0in; margin-bottom: 7.5pt; margin-left: 0in; "&gt;&lt;span style="font-family: 'lucida sans unicode', sans-serif; color: black; font-size: 9pt; "&gt;&lt;span style="font-size: 9pt; "&gt;     For
the second problem, the column is not adding because you have not set the combo
mode into a multiple columns. Here a line code that you will need to add in
order to do so:&lt;o:p /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 252, 225); background-position: initial initial; background-repeat: initial initial; "&gt;&lt;span style="font-family: 'courier new'; color: black; font-size: 9pt; "&gt;&lt;span style="font-size: 9pt; "&gt;WebCombo2.LayoutSettings.ComboMode
= ISNet.WebUI.WebCombo.Mode.MultipleColumns;&lt;o:p /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin-top: 7.5pt; margin-right: 0in; margin-bottom: 7.5pt; margin-left: 0in; "&gt;&lt;span style="font-family: 'lucida sans unicode', sans-serif; color: black; font-size: 9pt; "&gt;&lt;span style="font-size: 9pt; "&gt;     I
hope it helps and please do not hesitate to ask if you have any other
questions. Thank you.&lt;o:p /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin-top: 7.5pt; margin-right: 0in; margin-bottom: 7.5pt; margin-left: 0in; "&gt;&lt;span style="font-family: 'lucida sans unicode', sans-serif; color: black; font-size: 9pt; "&gt;&lt;span style="font-size: 9pt; "&gt;Best Regards,&lt;o:p /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin-top: 7.5pt; margin-right: 0in; margin-bottom: 7.5pt; margin-left: 0in; "&gt;&lt;span style="font-family: 'lucida sans unicode', sans-serif; color: black; font-size: 9pt; "&gt;&lt;span style="font-size: 9pt; "&gt;Andi Santoso&lt;/span&gt;&lt;o:p /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p /&gt;</description></item><item><title>Unbound Child combo: Row Count and adding extra rows</title><link>http://www.intersoftsolutions.com/Community/WebCombo/Unbound-Child-combo-Row-Count-and-adding-extra-rows/</link><pubDate>Fri, 12 Feb 2010 13:55:06 GMT</pubDate><dc:creator>ellpan</dc:creator><description>
&lt;p style="margin-bottom: 0.0001pt; line-height: normal;" class="MsoNormal"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;times new roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;I have cboParent and cboChild: both
Unbound. &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0.0001pt; line-height: normal;" class="MsoNormal"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;times new roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0.0001pt; line-height: normal;" class="MsoNormal"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;times new roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;1. When a row is selected in a
cboParent, I need to get number of rows in cboChild. &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0.0001pt; line-height: normal;" class="MsoNormal"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;times new roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;I put a ClientSite code in
"OnAfterItemSelected" of cboParent: var combo =
ISGetObject("cboChild");&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0.0001pt; line-height: normal;" class="MsoNormal"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;times new roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;span style="" /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0.0001pt; line-height: normal;" class="MsoNormal"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;times new roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;Then I tried the following three
functions: &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0.0001pt; line-height: normal;" class="MsoNormal"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;times new roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;a) var count = combo.GetRowsCount();
&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0.0001pt; line-height: normal;" class="MsoNormal"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;times new roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;b) var count =
combo.TotalRetrievedRows; &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0.0001pt; line-height: normal;" class="MsoNormal"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;times new roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;c) var count = combo.TotalRows;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0.0001pt; line-height: normal;" class="MsoNormal"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;times new roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0.0001pt; line-height: normal;" class="MsoNormal"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;times new roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;In case (a), I get the total number
of records of cboChild without a filter that came from cboParent. &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0.0001pt; line-height: normal;" class="MsoNormal"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;times new roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;For example: I select a row in
cboParent. When I open cboChild, 12 records. The count gives 50 - what is total
number of possible records for cboChild regardless of filter from cboParent.&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0.0001pt; line-height: normal;" class="MsoNormal"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;times new roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0.0001pt; line-height: normal;" class="MsoNormal"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;times new roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;In cases (b) and (c), I get 0. How
to get the correct count?&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0.0001pt; line-height: normal;" class="MsoNormal"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;times new roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0.0001pt; line-height: normal;" class="MsoNormal"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;times new roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;2. I have another related problem. &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0.0001pt; line-height: normal;" class="MsoNormal"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;times new roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0.0001pt; line-height: normal;" class="MsoNormal"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;times new roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;I select a record in cboParent, and
cboChild is populated based on that selection. I need to add an additional row
to cboChild. &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0.0001pt; line-height: normal;" class="MsoNormal"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;times new roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;I populated cboChild with the
following code:&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0.0001pt; line-height: normal;" class="MsoNormal"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;times new roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;----------&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0.0001pt; line-height: normal;" class="MsoNormal"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;times new roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;cboChild.DataTextField =
"Description"&lt;br /&gt;
cboChild.DataValueField = "InstrumentGroupID"&lt;br /&gt;
cboChild.LayoutSettings.StatusBoxVisible = False&lt;br /&gt;
cboChild.Columns.Add("Description")&lt;br /&gt;
cboChild.Columns.Add("InstrumentGroupID")&lt;br /&gt;
cboChild.Columns.Add("TechniqueID")&lt;br /&gt;
cboChildo.Columns(2).Hidden = "True"&lt;br /&gt;
cboChild.Columns(2).RenderOnHidden = "True"&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0.0001pt; line-height: normal;" class="MsoNormal"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;times new roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;// then sql quiry ... and finally&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0.0001pt; line-height: normal;" class="MsoNormal"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;times new roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;cboChild.PopulateUnboundData(dt,
False)&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0.0001pt; line-height: normal;" class="MsoNormal"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;times new roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0.0001pt; line-height: normal;" class="MsoNormal"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;times new roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;// I tried to use the following
client-side code to add a row:&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0.0001pt; line-height: normal;" class="MsoNormal"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;times new roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;var combo =
ISGetObject("cboChild"); &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0.0001pt; line-height: normal;" class="MsoNormal"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;times new roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;var rows = combo.GetRows(); &lt;br /&gt;
var newRow = combo.NewRow("-1"); &lt;br /&gt;
var cells = newRow.GetCells(); &lt;br /&gt;
cells.GetNamedItem("Description").Text = "Test1"; &lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-bottom: 0.0001pt; line-height: normal;" class="MsoNormal"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;times new roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;cells.GetNamedItem("InsturmentGroupID").Text = "-1"; &lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0.0001pt; line-height: normal;" class="MsoNormal"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;times new roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;rows.Add(newRow);&lt;br /&gt;
combo.UpdateUI();&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0.0001pt; line-height: normal;" class="MsoNormal"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;times new roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0.0001pt; line-height: normal;" class="MsoNormal"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;times new roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;--------&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0.0001pt; line-height: normal;" class="MsoNormal"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;times new roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0.0001pt; line-height: normal;" class="MsoNormal"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;times new roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;The problem is: "cells"
has only one cell "Description" and the row was added as
"undefined". What am I doing wrong?&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-bottom: 0.0001pt; line-height: normal;" class="MsoNormal"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;times new roman&amp;quot;,&amp;quot;serif&amp;quot;;"&gt;Thanks.&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 12pt; font-family: &amp;quot;times new roman&amp;quot;,&amp;quot;serif&amp;quot;;" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description></item></channel></rss>