Set webcombo value in grid when adding new row

Tags :
  • New Discussion
  • New Question
  • New Product Feedback
Gareth TholeMember

I am trying to set the value of a cell in a grid that is linked to a web combo when adding a new row programmically.  The grid also has 2 cells that share the same web combo.  I can't seem to set the value and text of the cell correctly.  It will only show me the ID value.

 

Here is my function in javascript to add the row. BeginStatusID and EndStatusID use the same web combo.  The function is being called from my initialize post back event in the VB code behind module that looks the data up to copy.

function addCopyRules(StatusRuleName, BeginStatusID, EndStatusID, Minutes, IssueID, BeginStatusName, EndStatusName) { var WebGrid1 = ISGetObject("WebGridStatusRule"); var newRow = WebGrid1.RootTable.NewRow(); // create new row object var cells = newRow.GetCells(); // get WebGrid cell collection // populate new row object cells.GetNamedItem("StatusRuleName").SetText(StatusRuleName); cells.GetNamedItem("StatusRuleName").SetValue(StatusRuleName); cells.GetNamedItem("AllowedMinutes").SetText(Minutes); cells.GetNamedItem("AllowedMinutes").SetValue(Minutes); cells.GetNamedItem("BeginStatusID").SetValue(BeginStatusID); cells.GetNamedItem("BeginStatusID").SetText(BeginStatusName); cells.GetNamedItem("EndStatusID").SetValue(EndStatusID); cells.GetNamedItem("EndStatusID").SetText(EndStatusName); cells.GetNamedItem("IssueID").SetText(IssueID); cells.GetNamedItem("IssueID").SetValue(IssueID);

newRow.Update(); // insert new record

return true;

}

 

Here is my web combo wcStatus:

<ISWebCombo:WebCombo ID="wcStatus" runat="server" DataValueField="StatusID" Height="20px" UseDefaultStyle="True" AllowWildCardSearch="True" DropDownRows="20" OnInitializeDataSource="wcStatus_InitializeDataSource" DataTextField="StatusName" DataCacheStorage="Session" > <Columns> <ISWebCombo:WebComboColumn Name="StatusName" BaseFieldName="StatusName" Width="80" /> </Columns> <LayoutSettings AlwaysShowColumnHeaders="false" ComboMode="SingleColumn" EntryMode="AutoComplete" AlwaysShowHelpButton="false" ResultBoxWindowType="Normal" HeaderStyle-CssClass="ComboHeader"> </LayoutSettings> <FlyPostBackSettings PostControlState="true" PostHiddenFields="true" PostInputControls="true" PostViewState="true" /> </ISWebCombo:WebCombo>
All times are GMT -5. The time now is 4:02 PM.
Previous Next