Linje 78: <add verb="*" path="Telerik.Web.UI.DialogHandler.aspx" type="Telerik.Web.UI.DialogHandler, Telerik.Web.UI, Culture=neutral, PublicKeyToken=121fae78165ba3d4"></add>
e.Item.OwnerTableView.ExtractValuesFromItem(newValues, editedItem);
Which works very well however i cant access none databound items using this, can i ?| <tr> |
| <td> |
| Kommentar</td> |
| <td> |
| <telerik:RadTextBox ID="RadTextBox6" Runat="server" |
| Width="125px" Text='<%#Bind("ingredient_comment") %>'> |
| </telerik:RadTextBox> |
| </td> |
| </tr> |
| <tr> |
| <td> |
| Farve</td> |
| <td> |
| <telerik:RadColorPicker ID="RadColorPicker1" Runat="server" |
| CurrentColorText="(Nuværende farve er {0})" NoColorText="Ingen farve" |
| PickColorText="Vælg farve" Preset="Standard" ShowIcon="True" SelectedColor='<%#Bind("ingredient_color") %>'> |
| </telerik:RadColorPicker> |
| </td> |
| </tr> |
| <telerik:RadGrid ID="Grid" runat="server" Skin="Office2007" HeaderStyle-Font-Size="X-Small" FooterStyle-Font-Size="X-Small" |
| AutoGenerateColumns="False" AllowPaging="false" AllowMultiRowSelection="True" OnNeedDataSource="Grid_NeedDataSource" |
| ShowGroupPanel="false" GridLines="None" ShowFooter="true" FooterStyle-BackColor="WhiteSmoke" |
| FooterStyle-Font-Bold="true" Width = "99%" EnableViewState="True" |
| FooterStyle-ForeColor="Black" OnItemDataBound="Grid_ItemDataBound" |
| OnItemCreated="Grid_ItemCreated" meta:resourceKey="GridResource1"> |
| <ClientSettings AllowColumnsReorder="false" ReorderColumnsOnClient="false"> |
| <Selecting AllowRowSelect="True" /> |
| <Resizing AllowColumnResize="false" /> |
| <Scrolling AllowScroll="false" UseStaticHeaders="true" /> |
| </ClientSettings> |
| <MasterTableView TableLayout="Fixed" > |
| <Columns> |
| <telerik:GridClientSelectColumn UniqueName="colSel" Visible="true"> |
| <HeaderStyle Width="30px" /> |
| <ItemStyle Width="30px" /> |
| </telerik:GridClientSelectColumn> |
| <telerik:GridBoundColumn Visible="True" DataField="ProjectName" UniqueName="ProjectName" meta:resourceKey="colProjectName"> |
| <HeaderStyle Font-Bold="true" Width="155px" /> |
| <ItemStyle Width="170px" /> |
| </telerik:GridBoundColumn> |
| <telerik:GridTemplateColumn Visible="True" UniqueName="DayOfWeek1"> |
| <HeaderStyle Width="70px" /> |
| <ItemStyle Width="70px" /> |
| <ItemTemplate> |
| <telerik:RadNumericTextBox ID="ntbDayOfWeek1" runat="server" Skin="Office2007" Width="50px" |
| Font-Names="Verdana" Font-Size="X-Small" OnTextChanged="DayOfWeek_TextChanged" AutoPostBack="true"> |
| </telerik:RadNumericTextBox> |
| </ItemTemplate> |
| </telerik:GridTemplateColumn> |
| </Columns> |
| </MasterTableView> |
| </telerik:RadGrid> |
Can you help me shed some light on the following issue?
Problem:
I have a grid with in-place edit and three records. One column is a griddropdowncolumn. When the grid loads, the values are not displayed for this column.
When I enter the edit mode, values are rendered in this column.
Case A:
If I press the edit button on the first record the dropdown is populated, the correct value is selected in the dropdown and the remaining two records now have a value displayed in this column. If I cancel the edit and return to the gridview the column no longer displays values in this column for any of the records.
Case B:
If I press the edit button of the middle record the dropdown is populated, the correct value is selected in the dropdown, the first record does not display a value for this column but the third record does display a value for this column. If I cancel the edit and return to the gridview the column no longer displays values in this column for any of the records
Detail about the grid and the GridDropDownColumn:
The grid and its dropdown column are bound to datatables contained within the same dataset.
The griddropdowncolumn is defined as follows:
<telerik:GridDropDownColumn
DataField="Country_code" (field name in the grid source)
GroupByExpression="Country_Code"
HeaderText="Country Code"
SortExpression="Country_Code"
UniqueName="Country_Code"
ListTextField="Name" (field name in dropdown source)
ListValueField="Country_code" /> (field name in dropdown source)
The grid is bound to a datatable in the dataset during the NeedDataSource event.
grdAccounts.DataSource = BusinessAccounts.Tables["Business_Accounts"];
When in EditMode the dropdowncolumn is bound to one of the datatables in the dataset during the ItemDataBound event.
GridEditableItem editedItem = e.Item as GridEditableItem;
GridEditManager editMan = editedItem.EditManager;
GridDropDownColumnEditor editor =
editMan.GetColumnEditor("country_code") as GridDropDownColumnEditor;
editor.DataSource = BusinessAccounts.Tables["Countries"];
editor.DataBind();
editor.SelectedValue = editedItem.GetDataKeyValue("Country_Code").ToString();
The ListValueField and the DataField are the same data type and length.
Thanks for your help.