<
asp:SqlDataSource ID="SqlDataSource1" ConnectionString="<%$ AppSettings:ConnectionInfo %>"
runat="server" SelectCommand="prcGetMTSCorrespondentContact" DeleteCommand="prcAddMTSCorrespondentContact"
DeleteCommandType="StoredProcedure" InsertCommandType="StoredProcedure" SelectCommandType="StoredProcedure"
UpdateCommandType="StoredProcedure" OnSelecting="SqlDataSource1_Selecting" OnDeleting="SqlDataSource1_Deleting"
OnUpdating="SqlDataSource1_Updating" UpdateCommand="prcAddMTSCorrespondentContact"
InsertCommand="prcAddMTSCorrespondentContact" OnInserting="SqlDataSource1_Inserting">
<DeleteParameters>
<asp:Parameter Name="ContactID" Type="Int32" />
<asp:Parameter Name="Firm" Type="Int32" />
<asp:Parameter Name="CorrespondentCode" Type="Int32" />
<asp:Parameter Name="Delete" Type="Int32" DefaultValue="1" />
</DeleteParameters>
<SelectParameters>
<asp:Parameter Name="Firm" Type="String" />
<asp:Parameter Name="CorrespondentCode" Type="String" />
</SelectParameters>
<UpdateParameters>
<asp:Parameter Direction="ReturnValue" Name="RETURN_VALUE" Type="Int32" />
<asp:Parameter Name="ContactID" Type="Int32" />
<asp:Parameter Name="Firm" Type="String" />
<asp:Parameter Name="CorrespondentCode" Type="String" />
<asp:ControlParameter Name="DepartmentName" ControlID="txtDepartmentName" PropertyName="Text"
Type="String" />
<asp:ControlParameter Name="DepartmentNote" ControlID="txtDepartmentNote" PropertyName="Text"
Type="String" />
<asp:ControlParameter Name="ContactPerson" ControlID="txtContactPerson" PropertyName="Text"
Type="String" />
<asp:ControlParameter Name="Telephone" ControlID="txtTelephone" PropertyName="Text"
Type="String" />
<asp:ControlParameter Name="Telephone2" ControlID="txtTelephone2" PropertyName="Text"
Type="String" />
<asp:ControlParameter Name="Fax" ControlID="txtFax" PropertyName="Text"
Type="String" />
<asp:ControlParameter Name="Email" ControlID="txtEmail" PropertyName="Text" Type="String" />
<asp:ControlParameter Name="Email2" ControlID="txtEmail2" PropertyName="Text" Type="String" />
<asp:ControlParameter Name="Sequence" ControlID="txtSequence" PropertyName="Text"
Type="String" />
<asp:Parameter Name="Delete" Type="Int32" DefaultValue="0" />
</UpdateParameters>
<InsertParameters>
<asp:Parameter Direction="ReturnValue" Name="RETURN_VALUE" Type="Int32" />
<asp:Parameter Name="ContactID" Type="Int32" DefaultValue="0" />
<asp:Parameter Name="Firm" Type="String" />
<asp:Parameter Name="CorrespondentCode" Type="String" />
<asp:ControlParameter Name="DepartmentName" ControlID="txtDepartmentName" PropertyName="Text"
Type="String" />
<asp:ControlParameter Name="DepartmentNote" ControlID="txtDepartmentNote" PropertyName="Text"
Type="String" />
<asp:ControlParameter Name="ContactPerson" ControlID="txtContactPerson" PropertyName="Text"
Type="String" />
<asp:ControlParameter Name="Telephone" ControlID="txtTelephone" PropertyName="Text"
Type="String" />
<asp:ControlParameter Name="Telephone2" ControlID="txtTelephone2" PropertyName="Text"
Type="String" />
<asp:ControlParameter Name="Fax" ControlID="txtFax" PropertyName="Text"
Type="String" />
<asp:ControlParameter Name="Email" ControlID="txtEmail" PropertyName="Text" Type="String" />
<asp:ControlParameter Name="Email2" ControlID="txtEmail2" PropertyName="Text" Type="String" />
<asp:ControlParameter Name="Sequence" ControlID="txtSequence" PropertyName="Text"
Type="String" />
<asp:Parameter Name="Delete" Type="Int32" DefaultValue="0" />
</InsertParameters>
</asp:SqlDataSource>
and the grid DataSource is set to the SQLDataSource.
Update is working fine.But insert is not working.
It says
Could not find control 'txtDepartmentName' in ControlParameter 'DepartmentName'.
Below is my DepartmentName column definition
<
telerik:GridTemplateColumn HeaderText="Department Name" UniqueName="DepartmentName">
<ItemTemplate>
<asp:Label ID="lblDepartmentName" runat="server" Text='<%# Bind("DepartmentName") %>'></asp:Label>
</ItemTemplate>
<EditItemTemplate>
<span style="color:Red;text-align:left;font-size:medium">*</span>
<asp:TextBox ID="txtDepartmentName" runat="server" Text='<%# Bind("DepartmentName") %>' Width="200" MaxLength="100"></asp:TextBox>
<asp:RequiredFieldValidator ID="rfvTxtDepartmentName" ControlToValidate="txtDepartmentName"
ErrorMessage="Please enter Department Name!" runat="server" Display="None">
</asp:RequiredFieldValidator>
</EditItemTemplate>
</telerik:GridTemplateColumn>
and this is my codebehind file
protected
void grdContacts_ItemCommand(object source, GridCommandEventArgs e)
{
if (e.CommandName == "Update")
{
GridEditFormItem item = (GridEditFormItem)grdContacts.MasterTableView.GetItems(GridItemType.EditFormItem)[e.Item.ItemIndex];
foreach (Parameter param in SqlDataSource1.UpdateParameters)
{
ControlParameter cParam = param as ControlParameter;
if (cParam != null)
{
(cParam).ControlID = item.FindControl(cParam.ControlID).UniqueID;
}
}
}
else if (e.CommandName == "PerformInsert")
{
GridEditFormInsertItem item = (GridEditFormInsertItem)e.Item;
foreach (Parameter param in SqlDataSource1.UpdateParameters)
{
ControlParameter cParam = param as ControlParameter;
if (cParam != null)
{
(cParam).ControlID = item.FindControl(cParam.ControlID).UniqueID;
}
}
}
}
Hello
i am having a normal aspx which contain splitter control.inside that am using<radspl
:RadPane
ID
="rpTaregetWindow"
runat
="server" ContentUrl="DefaultTarget.aspx">
Scrolling="Both">
</radspl:RadPane>.my page is populating inside this radpane inside(DefaultTarget.aspx page).
my page which contain a rad grid .on clicking on edit am popuping a new rad window for edit update function.after performing the task .i can close the window by GetRadWindow().Close(); on click of save/cancel.
my requirement is to reload the parent page(normal aspx page not rad window) with reload of grid with previous update that we have made in popup (child.this was not happening for my case.
if any one can help me, please reply as soon as possible
Thanks Regards
Mathews Baby