The second combo loses it's value and therefore the third can not fill with ts data. I must have something very very worng here but can't see the wood for the trees and time is running out for this project.
PLEASE HELP THIS IS URGENT, THANKS.
<%
@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApplication2._Default" %>
@ Register assembly="Infragistics35.WebUI.Misc.v9.1, Version=9.1.20091.1015, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" namespace="Infragistics.WebUI.Misc" tagprefix="igmisc" %>
@ Register assembly="Infragistics35.WebUI.WebCombo.v9.1, Version=9.1.20091.1015, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" namespace="Infragistics.WebUI.WebCombo" tagprefix="igcmbo" %>
@ Register assembly="Infragistics35.WebUI.UltraWebGrid.v9.1, Version=9.1.20091.1015, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" namespace="Infragistics.WebUI.UltraWebGrid" tagprefix="igtbl" %>
<!
DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<
html xmlns="http://www.w3.org/1999/xhtml" >
head runat="server">
<title></title>
<script type="text/javascript" id="Infragistics">
/// Service Type combo box changes are detected here
function
WcServiceType_BeforeCloseUp(webComboId) {
var combo = igcmbo_getComboById(webComboId);
WcServiceType_EditKeyDown(webComboId, combo.getDisplayValue(), 13);
}
WcServiceType_EditKeyDown(webComboId,newValue,keyCode){
if (keyCode == 13 || keyCode == 9) {
if (combo.getDataValue() != null) {
document.getElementById(
'hdServiceTypeRowChanged').value = "1";
var warp = ig$("warp");
if (!warp)
return;
var selectedindex = combo.setDisplayValue(newValue, true, false);
warp.refresh();
var ReferralCentre = igcmbo_getComboById(webComboId);
ReferralCentre.focus();
else
'hdServiceTypeRowChanged').value = "0";
/// Referral Centre row changes are detected here
WcReferralCentre_BeforeCloseUp(webComboId) {
WcReferralCentre_EditKeyDown(webComboId, combo.getDisplayValue(), 13);
WcReferralCentre_EditKeyDown(webComboId, newValue, keyCode) {
'hdReferralCentreRowChanged').value = "1";
if (!warp)return;
//var selectedindex = combo.setDisplayValue(newValue, true, false);
combo.setDisplayValue(combo.getDisplayValue());
'hdReferralCentreRowChanged').value = "0";
</
script>
head>
body>
<form id="form1" runat="server">
<div>
</div>
<igmisc:WebAsyncRefreshPanel ID="warp" runat="server" Height="231px" Width="398px" oncontentrefresh="Page_Load" TriggerPostBackIDs="WcServiceType,WcReferralCentre">
Service Type :
<asp:HiddenField ID="hdServiceTypeRowChanged" runat="server" Value="0" />
<igcmbo:WebCombo ID="WcServiceType" runat="server" BackColor="White" BorderColor="Silver" BorderStyle="Solid" BorderWidth="1px" Editable="True" ForeColor="Black" OnInitializeDataSource="WcServiceType_InitializeDataSource" SelBackColor="DarkBlue" SelForeColor="White" Version="4.00" EnableXmlHTTP="True" TabIndex="1">
<Columns>
<igtbl:UltraGridColumn>
<header caption="Column0">
</header>
</igtbl:UltraGridColumn>
</Columns>
<expandeffects shadowcolor="LightGray"/>
<dropdownlayout bordercollapse="Separate" rowheightdefault="20px" version="4.00" allowsorting="OnClient" colheadersvisible="No" gridlines="None" headerclickaction="NotSet" xmlloadondemandtype="Accumulative">
<framestyle backcolor="Silver" borderstyle="Ridge" borderwidth="2px" cursor="Default" font-names="Verdana" font-size="10pt" height="130px" width="325px">
</framestyle>
<HeaderStyle BackColor="LightGray" BorderStyle="Solid">
<borderdetails colorleft="White" colortop="White" widthleft="1px" widthtop="1px" />
</HeaderStyle>
<RowStyle BackColor="White" BorderColor="Gray" BorderStyle="Solid" BorderWidth="1px">
<borderdetails widthleft="0px" widthtop="0px" />
</RowStyle>
<SelectedRowStyle BackColor="DarkBlue" ForeColor="White" />
</dropdownlayout>
<ClientSideEvents BeforeCloseUp="WcServiceType_BeforeCloseUp" EditKeyDown="WcServiceType_EditKeyDown" />
</igcmbo:WebCombo>
Referral Centre :
<asp:HiddenField ID="hdReferralCentreRowChanged" runat="server" Value="0" />
<br/>
<igcmbo:WebCombo ID="WcReferralCentre" runat="server" BackColor="White" BorderColor="Silver" BorderStyle="Solid" BorderWidth="1px" ForeColor="Black" SelBackColor="DarkBlue" SelForeColor="White" Version="4.00" Editable="True" TabIndex="2" OnInitializeDataSource="WcReferralCentre_InitializeDataSource">
<expandeffects shadowcolor="LightGray" />
<borderdetails widthleft="0px" widthtop="0px"/>
<ClientSideEvents BeforeCloseUp="WcReferralCentre_BeforeCloseUp" EditKeyDown="WcReferralCentre_EditKeyDown" />
<br />
Referring Consultants :
<igcmbo:WebCombo ID="WcReferringConsultant" runat="server" BackColor="White" BorderColor="Silver" BorderStyle="Solid" BorderWidth="1px" ForeColor="Black" SelBackColor="DarkBlue" SelForeColor="White" Version="4.00" TabIndex="3">
<dropdownlayout bordercollapse="Separate" rowheightdefault="20px" version="4.00">
</igmisc:WebAsyncRefreshPanel>
</form>
html>
And here is my Default.aspx.cs :
using
System;
System.Linq;
System.Web.UI;
System.Web.UI.WebControls;
hahcrm.Entities;
//using Infragistics.WebUI.UltraWebToolbar;
Infragistics.WebUI.WebCombo;
namespace
WebApplication2
{
public partial class _Default : System.Web.UI.Page
private Guid gPatId;
private Guid gPcrId;
public Guid gServiceTypeId;
private hahcrmDataContext context = new hahcrmDataContext();
protected void Page_Load(object sender, EventArgs e)
if (hdServiceTypeRowChanged.Value == "1")
hdServiceTypeRowChanged.Value =
"0";
WcServiceType_SelectedRowChanged(WcServiceType,
null);
if (hdReferralCentreRowChanged.Value == "1")
hdReferralCentreRowChanged.Value =
WcReferralCentre_SelectedRowChanged(WcReferralCentre,
if (IsPostBack)
protected void WcServiceType_InitializeDataSource(object sender, WebComboEventArgs e)
//if (IsPostBack)
// return;
try
var allServiceTypes = from a in context.ServiceTypes
where a.ShortName != "*Not Selected*"
orderby a.ShortName
select
new
a.ServiceTypeID,
a.ShortName
};
WcServiceType.DataValueField =
"ServiceTypeID";
WcServiceType.DataTextField =
"ShortName";
WcServiceType.DataSource = allServiceTypes;
WcServiceType.DataBind();
WcServiceType.Columns[0].Hidden =
true;
catch(Exception)
string sMessage =
"window.alert('There are no Service Types available, please contact IT Services if this error persists.');";
ClientScript.RegisterClientScriptBlock(Page.GetType(),
"ServiceTypeError", sMessage, true);
Environment.Exit(0);
/// <summary>
/// This is the first selection combo "Service Type", this controls how the rest of the form reacts.
/// </summary>
/// <param name="listToFill"></param>
protected void WcServiceType_SelectedRowChanged(object sender, SelectedRowChangedEventArgs e)
// catch the empty box error
if ((WcServiceType.DataValue == null) || (WcServiceType.DataValue.ToString() == "False"))
//SetDefaultValues();
WcServiceType.Focus();
gServiceTypeId=
new Guid(WcServiceType.DataValue.ToString());
// service type changed, empty all the other fields for consistency
// fill the referral centre with any relevant values
WcReferralCentre.Enabled =
PopulateReferralCentre(gServiceTypeId);
//new Guid(WcServiceType.DataValue.ToString()));
// check there is an entry to the Referral Centre drop down
if (WcReferralCentre.Rows.Count <= 0)
WcReferralCentre.DisplayValue =
"No Referral Centres available, please select another Service Type";
false;
WcReferralCentre.Focus();
"window.alert('Service Type selected row error.');";
"ServiceTypeSelectedRowError", sMessage, true);
protected void WcReferralCentre_InitializeDataSource(object sender, WebComboEventArgs e)
if (gServiceTypeId == Guid.Empty)
try{
var allReferralCentres = from org in context.Organisations
where org.OrganisationType == 200008 || org.OrganisationType == 200009 || org.OrganisationType == 200010 || org.OrganisationType == 200016 || org.OrganisationType == 200015 || org.OrganisationType == 200014 || org.OrganisationType == 200013 || org.OrganisationType == 200012
join fd in context.FunderDirectory on org.AccountID equals fd.FunderID
where fd.ServiceTypeID == gServiceTypeId
orderby org.OrganisationName
select new
org.AccountID,
org.OrganisationName,
org.AddressLine1,
org.AddressLine2,
org.AddressLine3,
org.Postcode
WcReferralCentre.DataValueField =
"AccountID";
WcReferralCentre.DataTextField =
"OrganisationName".Trim();
"AddressLine1".Trim();
"AddressLine2".Trim();
"AddressLine3".Trim();
"Postcode".Trim();
WcReferralCentre.DataSource = allReferralCentres.ToList();
WcReferralCentre.DataBind();
WcReferralCentre.Columns[0].Hidden =
WcReferralCentre.DropDownLayout.DropdownHeight = 120;
if (WcReferralCentre.Rows.Count <= 5)
WcReferralCentre.DropDownLayout.DropdownHeight = (24 * WcReferralCentre.Rows.Count) + 24;
// display only 5 rows
WcReferralCentre.DropDownLayout.ColWidthDefault = 80;
"window.alert('There are no Referral Centres available.');";
"ReferralCentreError", sMessage, true);
/// Populates the referal centre based on the selection made in service type
/// The Organisation Type is a picklist that is to be narrowed down for selection
/// as a Referral Centre, these codes are held in the CRM Organisation.OrganisationType attribute
/// <param name="serviceTypeId"></param>
private void PopulateReferralCentre(Guid serviceTypeId)
//where org.OrganisationType == 200008 || org.OrganisationType == 200009 || org.OrganisationType == 200010 || org.OrganisationType == 200016 || org.OrganisationType == 200015 || org.OrganisationType == 200014 || org.OrganisationType == 200013 || org.OrganisationType == 200012
/// Populates the referring consultant based on the selection made in Referral Centre
/// <param name="WcReferralCentreId"></param>
private void PopulateReferringConsultant(Guid WcReferralCentreId)
var allReferringConsultants = from pe in context.ProfessionalsatEstablishments
join rc in context.People
on pe.ProfessionalID equals rc.PersonID
where pe.EstablishmentID == WcReferralCentreId
orderby pe.ProfessionalEstablishment
pe.ProfessionalatEstablishmentID,
pe.ProfessionalEstablishment
// Bind the retrieved data to the Referring consultant drop down grid
WcReferringConsultant.DataValueField =
"ProfessionalatEstablishmentId";
WcReferringConsultant.DataTextField =
"ProfessionalEstablishment";
WcReferringConsultant.DataSource = allReferringConsultants.ToList();
WcReferringConsultant.DataBind();
WcReferringConsultant.Columns[0].Hidden =
WcReferringConsultant.DropDownLayout.DropdownHeight = 120;
if (WcReferringConsultant.Rows.Count <= 5)
WcReferringConsultant.DropDownLayout.DropdownHeight = 24 * WcReferringConsultant.Rows.Count;
WcReferringConsultant.Focus();
catch (Exception)
var ex = new Exception();
"window.alert('There are no Referring Consultants at this Establishment, please select another establishment.');";
"ReferringConsultantError", sMessage, true);
// When the Referral Centre changes the fields for the Funder and Referring Consultant will usually be different
// so the screen fields need to reflect the change.
protected void WcReferralCentre_SelectedRowChanged(object sender, SelectedRowChangedEventArgs e)
if ((WcReferralCentre.DataValue == null) || (WcReferralCentre.DataValue.ToString() == "False"))
PopulateReferringConsultant(
new Guid(WcReferralCentre.DataValue.ToString()));
if (WcReferringConsultant.Rows.Count <= 0)
WcReferringConsultant.DisplayValue =
"There are no Referring Consultants at this Referral Centre";
WcReferringConsultant.Enabled =
}}}
I have a somewhat similar problem that got fixed accidentally. I had the "Editable" property of the webcombo originally set to True. I did not wish to allow to type a value only select, so I deleted this attribute. That's when the webcombo stopped refreshing.
The moment I restored the webcombo attribute, Editable="true", all was well in Infragistics land.
I would like to thank all concerned for your speedy replies and obvious lack of interest in the issues I am having.