The GridDropDownColumn is working perfectly other than displaying the
values from the database. The Dropdownlist is populated in edit mode
and it inserts to the database just fine, but when i just try to display
that info from the database in the column it doesn't show anything.
Grid:
ItemDataBound
The CollateralType is the only column that is not displaying any data in the grid.
Grid:
<telerik:RadGrid ID="rg_Collateral" runat="server" Width="450px" AllowSorting="true" GridLines="Both" AllowAutomaticDeletes="true" AllowAutomaticInserts="true" AllowAutomaticUpdates="true" PageSize="5" AllowPaging="true" AutoGenerateColumns="false" Skin="Simple" DataSourceID="collateral_Entity" OnItemDataBound="rg_Collateral_ItemDataBound" Font-Names="Calibri"> <MasterTableView Width="100%" CommandItemDisplay="Top"> <Columns> <telerik:GridBoundColumn DataField="USERID" HeaderText="User ID" UniqueName="userid" ReadOnly="true" Display="false" /> <telerik:GridBoundColumn DataField="CONUM" HeaderText="CoNum" UniqueName="conum" ReadOnly="true" Display="false" /> <telerik:GridBoundColumn DataField="DATEENTERED" HeaderText="Date Ent." UniqueName="dateEntered" ReadOnly="true" DataFormatString="{0:MM/dd/yyyy}" /> <telerik:GridDateTimeColumn DataField="RELEASED" HeaderText="Date Rel." UniqueName="dateReleased" DataFormatString="{0:MM/dd/yyyy}" /> <telerik:GridDropDownColumn DataField="COLLATERALTYPE" HeaderText="Type" UniqueName="type" DropDownControlType="DropDownList" /> <telerik:GridNumericColumn DataField="COLLATERALAMT" HeaderText="Collateralamt" UniqueName="collateralamt" /> <telerik:GridDateTimeColumn DataField="EXPDATE" HeaderText="Date Exp." UniqueName="dateExpired" DataFormatString="{0:MM/dd/yyyy}" /> <telerik:GridBoundColumn DataField="AUTORENEW" HeaderText="Auto Ren." UniqueName="autoRenew" Display="false" /> <telerik:GridBoundColumn DataField="BONDNUM" HeaderText="bond #" UniqueName="bondNumber" ReadOnly="true" /> <telerik:GridBoundColumn DataField="DESCRIPTION" HeaderText="Desc." UniqueName="description" /> </Columns> </MasterTableView> <PagerStyle Mode="NextPrevNumericAndAdvanced" /> </telerik:RadGrid>ItemDataBound
protected void rg_Collateral_ItemDataBound(object sender, GridItemEventArgs e) { hdBondnum.Value = txt_BondNumber.Text; hdConum.Value = txt_AccountNumber.Text; hduserid.Value = Membership.GetUser().ToString(); if ((e.Item is GridEditFormInsertItem) && (e.Item.OwnerTableView.IsItemInserted)) { GridEditFormInsertItem insertItem = (GridEditFormInsertItem)e.Item; TextBox txtbx = (TextBox)insertItem["userid"].Controls[0]; TextBox txtbx2 = (TextBox)insertItem["conum"].Controls[0]; TextBox txtbx3 = (TextBox)insertItem["dateEntered"].Controls[0]; TextBox txtbx4 = (TextBox)insertItem["bondNumber"].Controls[0]; GridEditableItem editItem = e.Item as GridEditableItem; GridEditManager editMgr = editItem.EditManager; GridDropDownListColumnEditor colEditor = editMgr.GetColumnEditor("type") as GridDropDownListColumnEditor; string s = colEditor.SelectedValue; colEditor.DataSource = UtilityBond.getCollateralType(); colEditor.DataBind(); txtbx.Text = hduserid.Value; txtbx2.Text = hdConum.Value; txtbx3.Text = String.Format("{0:M/d/yyyy}", DateTime.Today.Date); txtbx4.Text = hdBondnum.Value; } }The CollateralType is the only column that is not displaying any data in the grid.