Hi,
I am using webdatagid for batch updation, but I want to update the data through stored procedure in code behind not in sqlDataSource.in all demo only sqlDataSource is used. Can u help me on this.
Thanks,
Aspelec
Hello Aspelec,
Please review the attached sample that demonstrates such approach. A stored procedure is created that will be used to update customers, so in order to run the sample correctly you will need to have Northwind data base and to run the script ((UpdateCustomerQuery.sql)) which is attached in order to create UpdateCustomers Stored Procedure.
I hope this helps.
Hello,
I'm just following up to see if you need any further assistance with this issue. If so please let me know.
Hi Hristo,
Thanks for your reply.
I am geting the below error after implementing the code given.
" System.InvalidOperationException: The type specified in the TypeName property of ObjectDataSource 'ObjectDataSource2' could not be found."
Hi Aspelec,
Can you attach a sample where this does not work so we can examine it please?
please find the below code...
<ig:WebDataGrid ID="WebDataGrid1" autoCRUD="enabled" runat="server" Height="350px" Width="900px" AutoGenerateColumns="False" DataKeyFields="DrugID" DataSourceID="SqlDataSource1"> <Behaviors> <ig:Activation /> <ig:EditingCore BatchUpdating="true"> <Behaviors> <ig:RowAdding> <ColumnSettings> <ig:RowAddingColumnSetting ColumnKey="DrugID" DefaultValueAsString="" /> </ColumnSettings> <AddNewRowClientEvents ExitingEditMode="validateAddingRow" /> </ig:RowAdding> <ig:RowDeleting /> <ig:CellEditing> <ColumnSettings> <ig:EditingColumnSetting ColumnKey="DrugID" ReadOnly="true" /> </ColumnSettings> </ig:CellEditing> </Behaviors> </ig:EditingCore> <ig:ColumnFixing ColumnFixingClientEvents-FixedStateChanging="batchUpdateAlert" /> <ig:ColumnMoving ColumnMovingClientEvents-HeaderDragEnd="batchUpdateAlert" /> <ig:ColumnResizing ColumnResizingClientEvents-ColumnResizing="batchUpdateAlert" /> <ig:Filtering FilteringClientEvents-DataFiltering="batchUpdateAlert" /> <ig:Paging PagingClientEvents-PageIndexChanging="batchUpdateAlert" /> <ig:Selection CellClickAction="Row" RowSelectType="Multiple" ColumnSelectType="Multiple" /> <ig:RowSelectors RowNumbering="true" /> </Behaviors> <Columns> <ig:BoundDataField Key="STATUS" DataFieldName="STATUS" Header-Text="STATUS"> <Header Text="STATUS" /> </ig:BoundDataField> <ig:BoundDataField Key="DDC_CODE" DataFieldName="DDC_CODE" Header-Text="DDC_CODE"> <Header Text="DDC_CODE" /> </ig:BoundDataField> <ig:BoundDataField Key="TRADE_NAME" DataFieldName="TRADE_NAME" Header-Text="TRADE_NAME"> <Header Text="TRADE_NAME" /> </ig:BoundDataField> </Columns> </ig:WebDataGrid>
<asp:ObjectDataSource ID="ObjectDataSource2" runat="server" SelectMethod="GetCustomers" TypeName="ProjectDoxDataSetTableAdapters.GetMarkupsTableAdapter" EnablePaging="True" OnUpdated="ObjectDataSource2_Updated"> <UpdateParameters> <asp:Parameter Name="STATUS" Type="String" /> <asp:Parameter Name="DDC_CODE" Type="String" /> <asp:Parameter Name="TRADE_NAME" Type="String" /> <asp:Parameter Name="DrugID" Type="Int64" /> </UpdateParameters> </asp:ObjectDataSource>
code behind :
public void GridLoad() { DataTable dtDrug = new ClinicBLL.Settings.Settings_DrugBLL().GridLoad_FetchForUpdate();
if (dtDrug != null && dtDrug.Rows.Count > 0) {
WebDataGrid1.DataSource = dtDrug; WebDataGrid1.DataBind(); } }
Aspelec,
Thank you, but can you attach this as a website/ project or give me everything I need to run it, as now it's missing the data.
This is essential in order to reproduce the same scenario and behavior that you are experiencing.
Best Regards, Hristo AnastasovDeveloper Support EngineerInfragistics, Inc.