Unbound Child combo: Row Count and adding extra rows

3 replies. Last post: February 16, 2010 10:47 PM by Andi Santoso
Tags :
  • (None)
  • New Discussion
  • New Question
  • New Product Feedback
Ellen Member

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.


All times are GMT -5. The time now is 9:21 PM.
Previous Next