Please find below, code snippets from my RadGrid. The grid has a column which is editable using a drop down RadComboBox. The basic idea is to select a new technician (ASSIGNED_TO) from the drop down RadComboBox list and insert the new record in a different table.
On the server side, the insert command is working just fine. I can stop the debugger and verify the records in the database. But on the client side, <%#DataBinder.Eval(Container.DataItem,"ASSIGNED_TO")%> is updating all similar record in the table with the new technician name (ASSIGNED_TO), creating duplicates.
How can I prevent that from happening? Is there a property that can be enabled/disabled?
(1) SERVER SIDE INSERT STATEMENT
sqlConnection.Open();
string insertQuery = "INSERT INTO [AssistTech] (" +
"[PARENT_CHANGE], " +
"[NUMBERPRGN], " +
"[ASSIGNED_DEPT], " +
"[ASSIGNED_TO], " +
"[CATEGORY], " +
"[LOCATION], " +
"[PLANNED_START], " +
"[PLANNED_END], " +
"[SLA_START], " +
"[SLA_DEADLINE], " +
"[STATUS], " +
"[ROLE]) VALUES (" +
ticket + "," +
task + ",'" +
department + "','" +
technician + "','" +
category + "','" +
location + "','" +
startDate + "','" +
endDate + "','" +
slaStartDate + "','" +
slaDeadline + "','" +
status + "','" +
role + "')";
(2) CLIENT SIDE CODE
<telerik:GridTemplateColumn UniqueName="TemplateColumn" HeaderText="Assist" SortExpression="ASSIGNED_TO"
CurrentFilterFunction="Contains">
<ItemTemplate>
<%#DataBinder.Eval(Container.DataItem, "ASSIGNED_TO")%>
</ItemTemplate>
<EditItemTemplate>
<telerik:RadComboBox runat="server" ID="RadComboBox1" DataTextField="ASSIGNED_TO"
DataValueField="ASSIGNED_TO" EnableLoadOnDemand="True" EnableItemCaching="True"
OnItemsRequested="RadComboBox1_ItemsRequested" Height="140px" SelectedValue='<%#Bind("ASSIGNED_TO") %>'
DataSourceID="SqlDataSource5" AppendDataBoundItems="False" Sort="Ascending">
</telerik:RadComboBox>
</EditItemTemplate>
</telerik:GridTemplateColumn>
Thanks,
Baxis