I'm binding a dataset into a hierarchical web grid. The first band has 6 columns and the 2nd band has 8 columns.
I want to put a dropdown list into Bands[ 1 ].Columns[ 8 ]. I do not know how to do this based on the samples and I would like to set the dropdown list selection based on the data received from the database.
Any help would be appreciated.
HTH
I have this information but I'm sure I'm missing something. So I'm adding this information:
In my InitializeLayout, I have this:
UG1.DisplayLayout.Bands[ 0 ].Columns[ 0 ].Header.Caption = "SSN";
UG1.DisplayLayout.Bands[ 0 ].Columns[ 1 ].Header.Caption = "Full Name";
UG1.DisplayLayout.Bands[ 0 ].Columns[ 2 ].Header.Caption = "Address";
UG1.DisplayLayout.Bands[ 0 ].Columns[ 3 ].Header.Caption = "City";
UG1.DisplayLayout.Bands[ 0 ].Columns[ 4 ].Header.Caption = "State";
UG1.DisplayLayout.Bands[ 0 ].Columns[ 5 ].Header.Caption = "Zip";
UG1.DisplayLayout.Bands[ 0 ].Columns[ 6 ].Header.Caption = "SubTotal";
UG1.DisplayLayout.Bands[ 1 ].Columns[ 0 ].Header.Caption = "SSN";
UG1.DisplayLayout.Bands[ 1 ].Columns[ 1 ].Header.Caption = "Full Name";
UG1.DisplayLayout.Bands[ 1 ].Columns[ 2 ].Header.Caption = "Address";
UG1.DisplayLayout.Bands[ 1 ].Columns[ 3 ].Header.Caption = "City";
UG1.DisplayLayout.Bands[ 1 ].Columns[ 4 ].Header.Caption = "State";
UG1.DisplayLayout.Bands[ 1 ].Columns[ 5 ].Header.Caption = "Zip";
UG1.DisplayLayout.Bands[ 1 ].Columns[ 6 ].Header.Caption = "Amount";
UG1.DisplayLayout.Bands[ 1 ].Columns[ 7 ].Header.Caption = "Money Type";
UG1.DisplayLayout.Bands[ 1 ].Columns[ 8 ].Header.Caption = "Status";
UG1.DisplayLayout.Bands[ 1 ].Columns[ 8 ].Type = ColumnType.DropDownList;
UG1.DisplayLayout.Bands[ 1 ].Columns[ 8 ].AllowUpdate = AllowUpdate.Yes;
ValueList statusType = UG1.DisplayLayout.Bands[ 1 ].Columns[ 8 ].ValueList;
statusType.DataSource = Controller.GetPartyTransactionStatusInfo(); **** this gets the 5 list members to populate the dropdown ***
statusType.DataBind();
UG1.DisplayLayout.Bands[ 1 ].Columns[ 8 ].ValueList = statusType;
All I get is a blank UG1.DisplayLayout.Bands[ 1 ].Columns[ 8 ]
The "droplist" needs needs it's ValueMembers populated with data that matches the Cell.Value and Column.DataType. They need to match both in data type, and in actual value.
I don't have a snippet, but you need:
Here is where you lose me. I want to have a grid that shows the "words", a dropdown that contains the "words" but a Value member that contains an Int.
For example, let's say we have a select statement like:
Select LastName, EmployeeStatusLabel, EmployeeStatusID From Employee
Then we hook this up to my UltraGrid.
I want two columns: Employee Name || Employee Status
When someone selects the Employee Status cell, I want a drop down that shows some coded value pairs like Active/1, Inactive/2, etc. etc.
Now, the datatype of the displayed column is string, but the value I want to save is Int. Is this possible?
I'm assuming your EmployeeStatusId is the INT you set in your employee table which you want to set using the dropdown. The next thing you need is a query that returns a translation between your INT values and the text you want in the dropdown, like this:
SELECT [StatusId], [StatusName] + '/' + CAST([StatusId] AS NVARCHAR(999)) AS [DropDownText]FROM [StatusLookupTable]
The confiture your dropdown column like this:
Well, I stopped being thick, and worked it out. On to the next problem (which is getting the thing to actually update!!!)
How did u resolve it?