| <telerik:RadSplitter ID="RadSplitter1" Runat="server" CssClass="radSplitter" |
| ResizeWithParentPane="False" VisibleDuringInit="false" Width="100%" |
| PanesBorderSize="0" BorderSize="0" Orientation="Horizontal"> |
| <telerik:RadPane id="FilterPane" runat="server" BorderWidth="0" Scrolling="None" CssClass="reportFilter"> |
| <div class="reportFilterWrapper"> |
| <div style="float:right;"> |
| <asp:CheckBox ID="checkBoxColapse" runat="server" Text="<%$ Resources:resources,Report_ColapseAutomatic %>"></asp:CheckBox> |
| </div> |
| <div> |
| <asp:Panel ID="panelReportStart" runat="server"> |
| <span class="smaller"><asp:Literal ID="Literal2" runat="server" Text="<%$ Resources:resources,Label_ReportType %>" /><br /></span> |
| <asp:ListBox ID="listBoxReportType" runat="server" Rows="20" Width="500" |
| AutoPostBack="true" onload="listBoxReportType_Load"> |
| </asp:ListBox> |
| </asp:Panel> |
| <asp:Panel ID="panelReports" runat="server"></asp:Panel> |
| </div> |
| </div> |
| </telerik:RadPane> |
| <telerik:RadSplitBar id="RadSplitbar1" runat="server" CollapseMode="Forward" |
| CollapseExpandPaneText="<%$ Resources:resources,Label_ShowHide %>"></telerik:RadSplitBar> |
| <telerik:RadPane id="ReportPanes" runat="server" Scrolling="None" BorderWidth="0"> |
| <telerik:ReportViewer ID="ReportViewer1" runat="server" Visible="false" |
| Width="100%" Height="800px" ProgressText="<%$ Resources:resources,Report_LoadingText %>"> |
| </telerik:ReportViewer> |
| </telerik:RadPane> |
| </telerik:RadSplitter> |
Hi,
I am using telerik radgrid with EditMode="InPlace".Grid is bound to list of transaction objects as shown below in server side code section. I have a GridDropDownColumn which shows local currency for transactions. When I click on "edit" button which is generated as GridEditCommandColumn, I get the row in edit mode and list of currencies in the dropdown (GridDropDownColumn). But when grid is in edit mode, I need to set the previous/old value in the dropdownlist and I am unable to do that. What I need to know is how to find out old values when grid is in edit mode so that I can set selectedvlaue in dropdownlist. Is there any Server Side API which can help me out?
Following is the declaration of radgrid on aspx page.
//Design time code
<telerik:RadGrid ID="rgGLAdjustments" runat="server" AllowExportToExcel="true"
Width="100%" OnDeleteCommand="rgGLAdjustments_DeleteCommand" OnNeedDataSource="rgGLAdjustments_NeedDataSource"
OnItemDataBound="rgGLAdjustments_ItemDataBound" OnEditCommand="rgGLAdjustments_EditCommand">
<MasterTableView DataKeyNames="TransactionID" EditMode="InPlace">
<Columns>
<%--Some GridBoundColumns are here--%>
<telerik:GridDropDownColumn UniqueName="LocalCurrency" HeaderText="Local Currency"
DropDownControlType="DropDownList" DataField="LocalCurrency" ListDataMember="GetDataTable"
ListValueField="LocalCurrency" ListTextField="LocalCurrency">
</telerik:GridDropDownColumn>
<telerik:GridEditCommandColumn UpdateText="Update" UniqueName="EditCommandColumn"
CancelText="Cancel" EditText="Edit">
</Columns>
</MasterTableView>
</telerik:RadGrid>
"GetDataTable" is the property on my aspx.cs which returns a datatable and I bind that datatable to dropdowlist in "rgGLAdjustments_ItemDataBound" event handler as shown below
//Server side code
protected void rgGLAdjustments_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
{
if (e.Item is GridEditableItem && (e.Item as GridEditableItem).IsInEditMode)
{
GridEditableItem editedItem = e.Item as GridEditableItem;
GridEditManager editMan = editedItem.EditManager;
GridDropDownListColumnEditor editor = editMan.GetColumnEditor("LocalCurrency") as GridDropDownListColumnEditor;
//Tried following but it is always null
//editedItem.SavedOldValues
editor.DataSource = this.GetDataTable;
editor.DataValueField = "LocalCurrency";
editor.DataTextField = "LocalCurrencyValue";
editor.DataBind();
}
}
protected void rgGLAdjustments_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
{
this.rgGLAdjustments.DataSource = this.TransactionObjectsCollection;
}
Grid is bound to List of transaction objects in "OnNeedDataSource" handler as shown above.
I tried "editedItem.SavedOldValues" in the above server side code but it is always null. I also tried it in "OnEditCommand" handler but same result. Please advice.
Thanks
| function RadDatePicker_SetMaxDateToCurrentDate() { |
| var datePicker = $find("<%= txtTest.ClientID %>"); |
| datePicker.set_maxDate(new Date()); |
| }; |
One of many RadDatePicker controls on my page:
| <telerik:RadDatePicker ID="txtTest" runat="server" MinDate="1900-01-01" > |
| <DateInput ID="DateInput2" DateFormat="MMMM yyyy" runat="server" ReadOnly="true"> |
| </DateInput> |
| <Calendar ID="CalendarInput2" runat="server"> |
| <SpecialDays> |
| <telerik:RadCalendarDay repeatable="Today" Date="" ItemStyle-CssClass="rcToday" /> |
| </SpecialDays> |
| <ClientEvents OnLoad="RadDatePicker_SetMaxDateToCurrentDate" /> |
| </Calendar> |
| </telerik:RadDatePicker> |