hello,
i have a grid using this GridDropDownColumn:
which gets its data from a simple DataTable retrieved via a business method call in this ObjectDataSource:
...the problem -- when I handle the grid's UpdateCommand in C#, I'm not able to refer to this column-value by name. Instead, when I use the below code, the DictionaryEntry for this column is empty (see attached image).
...is there a way for me to fix this? i tried giving the GridDropDownColumn a DataField value, but it complained since that value doesn't exist in the grid's source datatable.
not sure if it makes a difference, but we're on an older version: 2009.2.826.35.
thanks!
i have a grid using this GridDropDownColumn:
<Telerik:GridDropDownColumn HeaderText="Acceptance" UniqueName="AcceptanceStatus" DataSourceID="odsAcceptanceStatusTypes" ListValueField="ID" ListTextField="Name" ItemStyle-Wrap="false" DropDownControlType="DropDownList" />which gets its data from a simple DataTable retrieved via a business method call in this ObjectDataSource:
<asp:ObjectDataSource ID="odsAcceptanceStatusTypes" TypeName="MyUtilities.WellTest" SelectMethod="GetAcceptanceStatusTypes" runat="server" />...the problem -- when I handle the grid's UpdateCommand in C#, I'm not able to refer to this column-value by name. Instead, when I use the below code, the DictionaryEntry for this column is empty (see attached image).
protected void gridItems_UpdateCommand(object source, GridCommandEventArgs e){ GridEditableItem editableItem = e.Item as GridEditableItem; //get our primary ID from the grid's datasource int resultNo = (int)(editableItem.OwnerTableView.DataKeyValues[editableItem.ItemIndex]["Result_No"]); //get the new values from this edited row Hashtable newValues = new Hashtable(); e.Item.OwnerTableView.ExtractValuesFromItem(newValues, editableItem); int acceptanceStatusTypeID = -1; foreach (DictionaryEntry entry in newValues) { switch ((string)entry.Key) { // (other items removed from code) //get the value for this case "": acceptanceStatusTypeID = Int32.Parse((string)entry.Value); break; } }}...is there a way for me to fix this? i tried giving the GridDropDownColumn a DataField value, but it complained since that value doesn't exist in the grid's source datatable.
not sure if it makes a difference, but we're on an older version: 2009.2.826.35.
thanks!