Hi,
I have a webgrid which looks as follows
when user clicks on the row a dropdown appears and user can select any value from the drop down
lets assume user picked Package Insert. Now database is updating the right value adding a new value correctly and deletes are also working fine, but the is displaying as follows
I could not figure out how to display the selected text instead of ID.
Please advice
Set the ValueList.DisplayMember to your column named "Description"
I tried it but once the page posts back I still see the ID but not text.
protected void uxDispositionUltraWebGrid_InitializeLayout(object sender, LayoutEventArgs e) { e.Layout.Bands[0].CellClickAction = CellClickAction.Edit; e.Layout.Bands[0].AllowUpdate = AllowUpdate.Yes;
this.uxDispositionUltraWebGrid.Bands[0].Columns[0].Header.FixedHeaderIndicator = FixedHeaderIndicator.None; this.uxDispositionUltraWebGrid.Bands[0].Columns[0].Width = Unit.Pixel(300); this.uxDispositionUltraWebGrid.Bands[0].ColHeadersVisible = ShowMarginInfo.No; this.uxDispositionUltraWebGrid.Columns[1].Hidden = true; this.uxDispositionUltraWebGrid.Columns[2].Hidden = true; this.uxDispositionUltraWebGrid.Columns[3].Hidden = true; this.uxDispositionUltraWebGrid.Columns[4].Hidden = true; this.uxDispositionUltraWebGrid.Columns[5].Hidden = true; this.uxDispositionUltraWebGrid.Columns[6].Hidden = true;
e.Layout.Bands[0].Columns.FromKey("Description").Type = ColumnType.Custom; e.Layout.Bands[0].Columns.FromKey("Description").EditorControlID = this.uxDispositionWebCombo.UniqueID; e.Layout.Bands[0].Columns.FromKey("Description").ValueList.DisplayStyle = ValueListDisplayStyle.DisplayText; e.Layout.Bands[0].Columns.FromKey("Description").ValueList.DisplayMember = "Description";
this.uxDispositionUltraWebGrid.Height = Unit.Pixel(100); }
I am setting it in the worng place?
// Mine is .NET, but the properties are the same.
<igtbl:UltraGridColumn BaseColumnName="StatusCode" CellButtonDisplay="Always" IsBound="True"
Key="StatusCode" Type="DropDownList" Width="100px">
<ValueList DataSourceID="SqlDataSourceAcct12" DisplayMember="Description" Key="whateverID"
ValueMember="DescriptionID">
</ValueList>
...
</igtbl:UltraGridColumn>
// this uses the WebDateChooser
<igtbl:UltraGridColumn BaseColumnName="EmailDate" DataType="System.DateTime" Key="EmailDate" AllowUpdate="Yes" EditorControlID="WebDateChooser1" Type="Custom" IsBound="True">
You're missing the displayMember or the ValueMember. The ValueMember is the one tied to the database. The DisplayMember is the cbo dropdown visual value.
Also check you dropdown data is ValueMember, displayMember. I guess they could be reversed as well.
Nop. Unfortunately i ran out of options and even the suggestion which was posted did not help either and i am stuck with it
I am sorry i could not help.
-Naresh.
I'm having the same problem. Did you find a solution to this?
:) i am also using C#.NET but i am trying to bind data in code behind.
private void PopulateDisposition() { this.uxDispositionUltraWebGrid.Clear(); DataSet ds = ContactTypeDAL.GetDispositionData(this.CurrentConnectionString, Convert.ToInt32(this.uxItemDetailItemIDTextBox.Text.Trim()));
this.uxDispositionUltraWebGrid.DataSource = ds; this.uxDispositionUltraWebGrid.DataBind();
}