I'm new to UltraWinGrid (Infragistics). We're using CSLA v 1.5. I'm able to display data, but unable to modify it or display the UltraCombo in one of the columns. Any insight?
{
private OrderPayersCollection m_orderPayers = null; private InsuranceClaimStatusReadOnlyCollection m_claimStatus = null; private Orders m_orders = null; private ValueList claimStatusValueList; public UC_OrderPayers(){
InitializeComponent();
claimStatusValueList =
new ValueList();}
#region
Properties public Orders Orders{
get { return m_orders; } set{
m_orders =
value; if (m_orders != null){
GetPolicyList(m_orders.PatientKey);
}
}
}
#endregion
private void GetPolicyList(Patient.Key patientKey){
m_orderPayers =
OrderPayersCollection.RetrieveAll(Orders.Key.EmptyKey, m_orders.PatientKey);m_claimStatus =
InsuranceClaimStatusReadOnlyCollection.RetrieveAll();grdPayers.DataSource = m_orderPayers;
foreach (InsuranceClaimStatus ics in m_claimStatus){
claimStatusValueList.ValueListItems.Add(ics);
}
}
private void grdPayers_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e){
if (!object.ReferenceEquals(this.grdPayers.DisplayLayout.Bands[0].Columns[0], null)){
e.Layout.Bands[0].Override.AllowUpdate =
DefaultableBoolean.True;e.Layout.Bands[0].Override.AllowDelete =
DefaultableBoolean.True;e.Layout.Bands[0].Override.AllowAddNew = Infragistics.Win.UltraWinGrid.
AllowAddNew.Yes;e.Layout.Bands[0].Columns[
"InsuranceClaimStatusID"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DropDown;e.Layout.Bands[0].Columns[
"InsuranceClaimStatusID"].ValueList = claimStatusValueList;e.Layout.Bands[0].Columns[0].Hidden =
true;e.Layout.Bands[0].Columns[1].Hidden =
true;e.Layout.Bands[0].Columns[2].Hidden =
true;e.Layout.Bands[0].Columns[4].Hidden =
true;e.Layout.Bands[0].Columns[5].Hidden =
true;e.Layout.Bands[0].Columns.Hidden =
true;e.Layout.Bands[0].Columns[7].Hidden =
true;e.Layout.Bands[0].Columns.Hidden =
true;e.Layout.Bands[0].Columns[10].Hidden =
true;e.Layout.Bands[0].Columns[11].Hidden =
true;e.Layout.Bands[0].Columns[12].Hidden =
true;e.Layout.Bands[0].Columns[13].Hidden =
true;e.Layout.Bands[0].Columns[14].Hidden =
true;e.Layout.Bands[0].Columns[15].Hidden =
true;e.Layout.Bands[0].Columns[16].Hidden =
true;e.Layout.Bands[0].Columns[18].Hidden =
true;e.Layout.Bands[0].Columns[19].Hidden =
true;e.Layout.Bands[0].Columns[20].Hidden =
true;}
}
}
At the risk of sounding like a total moron, I do not have the object "ValueLists" off of the DisplayLayout" I do find it off of the column and it is a singular noun vs. ValueLists, which is plural.
See my code is in InitializeLayout event:
e.Layout.Bands[0].Columns["InsuranceClaimStatusID"].ValueList = claimStatusValueList;
your code:
typeValues = PhoneNumbersGridView.DisplayLayout.ValueLists
but still, it does not show.
Are you using a different control by chance or a different version of Infragistics. We're using the latest.
Thanks...
Well, I also set the ValueList off of the column, but that's in addition to adding to the DisplayLayout.ValueLists collection.
I'm using NA 20071, although I think I first implemented this code in 20062.
The control is Infragistics.Win.UltraWinGrid.UltraGrid.
I just started working with CSLA and Infragistics two months ago, so I don't know if there is a better way to do this or not, but I have been using the EditorControl property.
If you are using a NameValueList bo, add an UltraComboEditor control to the form your grid is on. Otherwise use an UltraCombo control instead. (The UltraCombo is basically a dropdown UltraWinGrid.)
Set the visibility of any controls you added to false.
Open the UltraWinGrid Designer and click on Band and Column Settings->Band[0]...->Columns.
Select the column you want the combo on, look for the EditorControl property, and select the control you added above from the dropdown list.
That is all there is to it. As long as the control is bound correctly and you set the binding source's datasource at runtime, it should work fine. This way you don't need to mess with the wingrid through code at all.
Hope that helps!
Copyright (c) Marimer LLC