I am very new to Telerik. So I apologize if this is a silly question... but, I have been looking at the forum and I am unable to find the right solution for my problem. I need to display a list of documents in a grid that is coming from DataSource1(DS1). Once the user selects a row in edit mode (He may choose to change an original field or not...), I need to insert or update the row in another DataSource2(DS2). I was able to successfully display the list from DS1 and bring the edit mode. In the code behind, I wrote an updateCommand method where I would take the editable values and send them to my store procedure in DS2. The issue I am facing is. I am not able to retrieve the field I modify on my form. It is retirving the original one displayed from DS1. How do I retrieve the value I modified on the screen and send it to my code behind? Bellow a snnipets of my code.
<
telerik:RadGrid ID="RadGrid1" GridLines="None" runat="server" AllowAutomaticDeletes="True" AllowAutomaticInserts="True" PageSize="10"
AllowAutomaticUpdates="True" AllowPaging="True" AutoGenerateColumns="False" DataSourceID="SqlDataSource1" OnUpdateCommand="RadGrid1_UpdateCommand"
OnDataBound="RadGrid1_DataBound">
....
<
asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:GCOM %>"
ProviderName="System.Data.OracleClient" SelectCommand="Select * from GA_DOC D, GA_DOC_Evidence E, GA_Evidence Ev
where D.DOC_ID = E.DOC_ID (+)
and E.EVIDENCE_ID = Ev.EVIDENCE_ID (+)
and LIVE_DATE is not null
and ARCHIVE_DATE is null
and DOC_TYPE_ID = 3"
OldValuesParameterFormatString="original_{0}" ConflictDetection="CompareAllValues">
....
protected
void RadGrid1_UpdateCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)
{
GridEditableItem item = (GridEditableItem)e.Item;
String documentId = item.GetDataKeyValue("DOC_ID").ToString();
String title = item.GetDataKeyValue("TITLE").ToString();
String price = item.GetDataKeyValue("SALE_PRICE").ToString();
SqlConnection conn = null;
SqlDataReader rdr = null;
conn =
new SqlConnection(ConfigurationManager.ConnectionStrings["FTPFactoryConnStr"].ConnectionString);
try
{
//Open the connection and save data on Application's SQL DB.
conn.Open();
SqlCommand cmd = new SqlCommand(ConfigurationManager.AppSettings["ADDCONTROLFILE"].ToString(), conn);
cmd.CommandType =
CommandType.StoredProcedure;
cmd.Parameters.Add(
new SqlParameter("@FTPAction", "N"));
cmd.Parameters.Add(
new SqlParameter("@ExpirationDate", new DateTime(DateTime.Now.Ticks + 2).ToString("yyyyMMdd")));
cmd.Parameters.Add(
new SqlParameter("@ResearchId", Convert.ToInt32(documentId)));
cmd.Parameters.Add(
new SqlParameter("@Ticker", "abc"));
cmd.Parameters.Add(
new SqlParameter("@PPVDocumentPrice", price));
Thank you!
Mariella.