iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
I have cboParent and cboChild: both Unbound.
1. When a row is selected in a cboParent, I need to get number of rows in cboChild.
I put a ClientSite code in "OnAfterItemSelected" of cboParent: var combo = ISGetObject("cboChild");
Then I tried the following three functions:
a) var count = combo.GetRowsCount();
b) var count = combo.TotalRetrievedRows;
c) var count = combo.TotalRows;
In case (a), I get the total number of records of cboChild without a filter that came from cboParent.
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.
In cases (b) and (c), I get 0. How to get the correct count?
2. I have another related problem.
I select a record in cboParent, and cboChild is populated based on that selection. I need to add an additional row to cboChild.
I populated cboChild with the following code:
----------
cboChild.DataTextField = "Description" cboChild.DataValueField = "InstrumentGroupID" cboChild.LayoutSettings.StatusBoxVisible = False cboChild.Columns.Add("Description") cboChild.Columns.Add("InstrumentGroupID") cboChild.Columns.Add("TechniqueID") cboChildo.Columns(2).Hidden = "True" cboChild.Columns(2).RenderOnHidden = "True"
// then sql quiry ... and finally
cboChild.PopulateUnboundData(dt, False)
// I tried to use the following client-side code to add a row:
var combo = ISGetObject("cboChild");
var rows = combo.GetRows(); var newRow = combo.NewRow("-1"); var cells = newRow.GetCells(); cells.GetNamedItem("Description").Text = "Test1";
cells.GetNamedItem("InsturmentGroupID").Text = "-1";
rows.Add(newRow); combo.UpdateUI();
--------
The problem is: "cells" has only one cell "Description" and the row was added as "undefined". What am I doing wrong?
Thanks.
Hi Ellen,
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.
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:
WebCombo2.LayoutSettings.ComboMode = ISNet.WebUI.WebCombo.Mode.MultipleColumns;
I hope it helps and please do not hesitate to ask if you have any other questions. Thank you.
Best Regards,
Andi Santoso
Hi Andi,
Thank you for replying. You were right about #2: I missed to set Mode.MultipleColumns.
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.
Regards,
Ellen
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.
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 var count = combo.GetRowsCount();.
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname