I have a Rad Grid with
<MasterTableView EditMode="PopUp"
<EditFormSettings EditFormType="Template" CaptionFormatString="Entity Properties..." PopUpSettings-Modal="true" >
Using an Object DataSource
<asp:ObjectDataSource ID="EntityObjectDataSource" runat="server"
DataObjectTypeName="Namespace.Entities.Enity"
DeleteMethod="Delete" InsertMethod="Insert" SelectMethod="GetAll"
TypeName="Namespace.BusinessServices.EntityServices.EntityController"
UpdateMethod="Update" OldValuesParameterFormatString="original_{0}">
</asp:ObjectDataSource>
I used netTiers to gen service/Entity/ and data access - I have an abstraction layer (controllers) wrapping the net tiers services.
Amongst the controls, I have two text boxes UpdateByTextBox and UpdateDateText Box,
I would like to set these values once the user clicks the 'Save' command button.
(I was able to figure out how to set my CreateByTextBox and CreateDateTextBox by using the following
protected void RadGrid1_ItemCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)
{
if
(e.CommandName == RadGrid.InitInsertCommandName)
{
//cancel the default operation
e.Canceled =
true;
//Prepare an IDictionary with the predefined values
System.Collections.Specialized.
ListDictionary newValues = new System.Collections.Specialized.ListDictionary() ;
//set default value(s)
newValues[
"CreateBy"] = m_CurrentUserIdentityName; // initialized in page constructor
newValues[
"CreateDate"] = DateTime.Now.ToString();
//Insert the item and rebind
e.Item.OwnerTableView.InsertItem(newValues);
}
Any suggestions/questions or help is greatly appreciated...
I have a simple page in which I have a RadComboBox and a RadDatePicker.
All works fine, until I add a second RadComboBox.
At this point neither the RadDatePicker nor the second RadComboBox function.
If I take out the second RadComboBox, all is well again.
Any Thoughts?
TraingWizard_Step_1.aspx....
<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/TrainingWizard.Master" CodeBehind="TrainingWizard_Step_1.aspx.vb" Inherits="TrainingWizard.TrainingWizard_Step_1" %><%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %><asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server"> <style type = "text/css"> .a, .a:active, .a:link, .a:visited{color:Blue; font-size:large; width:92%; text-align:left; text-decoration:none; font-variant:small-caps; margin:auto auto auto 48px;} .a:hover{color:Red; font-size:large; width:92%; text-align:left; text-decoration:none; font-variant:small-caps; margin:auto auto auto 48px;} </style></asp:Content><asp:Content ID="Content2" ContentPlaceHolderID="BodyContent" runat="server"> <div style = "width:98%;text-align:center;"> <br /><br /> <h2> Step 1 - Company Name </h2> <br /> <telerik:RadComboBox ID="rcbCompanies" Runat="server" Width="200px" Height="140px" EmptyMessage="Company Name" DataSourceID="SqlDataSource1" DataTextField="rcbName" DataValueField="CompanyID" allowcustomtext="false" Filter="Contains" EnableAutomaticLoadOnDemand="true" ItemsPerRequest="10" ShowMoreResultsBox="true" EnableVirtualScrolling="true"> </telerik:RadComboBox><br /> <asp:RequiredFieldValidator ID="Validator1" ControlToValidate="rcbCompanies" ForeColor="Red" Text="This is required Information!" runat="server" /> <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:SafetyPlusWebConnectionString %>" SelectCommand="SELECT CompanyID, Company_Code + ' | ' + Name as rcbName FROM [Companies] WHERE ([Active] = 1) ORDER BY [Company_Code]"> </asp:SqlDataSource> <br /><br /> <h2> Step 2 - Course Details </h2> <br /> <telerik:RadDatePicker ID="rdpTrainingDate" runat="server" ZIndex="30001" AutoPostBack="true" DateInput-EmptyMessage="Training Date"/><br /> <asp:RequiredFieldValidator ID="Validator2" ControlToValidate="rdpTrainingDate" ForeColor="Red" Text="This is required Information!" runat="server" /> <br /><br /> <telerik:RadComboBox ID="rcbTrainingType" Runat="server" Width="200px" Height="140px" AutoPostBack="true" EmptyMessage="Training Type" OnClientSelectedIndexChanged="Training_Type_Picked"> <Items> <telerik:RadComboBoxItem Text="Toolbox Talk" Value="1"></telerik:RadComboBoxItem> <telerik:RadComboBoxItem Text="Instructor Led" Value="2" ></telerik:RadComboBoxItem> <telerik:RadComboBoxItem Text="Computer Based Training" Value="3"></telerik:RadComboBoxItem> <telerik:RadComboBoxItem Text="Other" Value="4"></telerik:RadComboBoxItem> </Items> </telerik:RadComboBox> <asp:RequiredFieldValidator ID="Validator3" ControlToValidate="rcbTrainingType" ForeColor="Red" Text="This is required Information!" runat="server" /> <br /> <br /><br /> <asp:TextBox ID="tbInstructor" runat="server" Width="200" Text="Instructor Name" Visible="false"></asp:TextBox> <br /><br /> <asp:Button ID="btnNext" runat="server" Text="Next" /> </div> </asp:Content><telerik:RadComboBox ID="ddlState" runat="server" AllowCustomText="true" MaxHeight="100px" EnableAutomaticLoadOnDemand="true"></telerik:RadComboBox> public void fillState(long countryId) { g_frontendDataContext fdc = new g_frontendDataContext(); try { var states = from i in fdc.tbl_sfl_states where i.fk_country_id == countryId select new { stateId = i.pk_state_id, stateName = i.state_name }; ddlState.DataSource = states.ToList(); ddlState.DataBind(); ddlState.DataTextField = "stateName"; ddlState.DataValueField = "stateId"; fdc.Dispose(); }}