Hello,
I'm experiencing some issues with the WHDG. I have seen similar post on this issue but none seems to address the problem I'm having. I am using version 2019.1 CLR45. I know this error normally occurs when a parameter is misspelled or missing but that's not the case here. I'm also having difficulties getting the key values from the parent row to assign to the child row for inserting and updating. Code snippets below:
Thank you in advance for any help on this issue.
Markup:
<body> <form id="form1" runat="server"> <ig:WebScriptManager ID="WebScriptManager1" runat="server" EnablePageMethods="True" ValidateRequestMode="Enabled"></ig:WebScriptManager> <igmisc:WebPageStyler ID="WebPageStyler1" runat="server" EnableAppStyling="True" StyleSetName="Default" /> <asp:HiddenField ID="hdnUserName" runat="server" /> <asp:HiddenField ID="hdnFacilityID" runat="server" /> <asp:HiddenField ID="hdnFacilityName" runat="server" /> <asp:SqlDataSource ID="dsFacilityParent" runat="server" ConnectionString="<%$ ConnectionStrings:CHPComplianceDB %>" SelectCommand="usp_get_Facility_License_Parent" SelectCommandType="StoredProcedure"></asp:SqlDataSource> <asp:SqlDataSource ID="dsFaciltyChild" runat="server" ConnectionString="<%$ ConnectionStrings:CHPComplianceDB %>" InsertCommand="usp_ins_tbl_Facility_License" InsertCommandType="StoredProcedure" SelectCommand="usp_get_Facility_License_Child" SelectCommandType="StoredProcedure" UpdateCommand="usp_upd_tbl_Facility_License" UpdateCommandType="StoredProcedure"> <InsertParameters> <asp:Parameter Name="Facility_ID" Type="Int32" /> <asp:Parameter Name="Facility_Name" Type="String" /> <asp:Parameter Name="Facility_License_Type" Type="String" /> <asp:Parameter Name="Entity_Code" Type="String" /> <asp:Parameter Name="Facility_License_Nbr" Type="String" /> <asp:Parameter Name="License_Issue_Date" Type="String"/> <asp:Parameter Name="License_Expire_Date" Type="String" /> <asp:Parameter Name="Owner" Type="String" /> <asp:Parameter Name="Co_Owner" Type="String" /> <asp:Parameter Name="Comment" Type="String" /> <asp:Parameter Name="Inserted_by" Type="String" /> <asp:Parameter Name="Inesert_Time" Type="DateTime" /> <asp:Parameter Name="Updated_by" Type="String" /> <asp:Parameter Name="Update_Time" Type="DateTime" /> </InsertParameters> <UpdateParameters> <asp:Parameter Name="Facility_License_ID" Type="Int32" /> <asp:Parameter Name="Facility_ID" Type="Int32" /> <asp:Parameter Name="Facility_Name" Type="String" /> <asp:Parameter Name="Facility_License_Type" Type="String" /> <asp:Parameter Name="Entity_Code" Type="String" /> <asp:Parameter Name="Facility_License_Nbr" Type="String" /> <asp:Parameter Name="License_Issue_Date" Type="String"/> <asp:Parameter Name="License_Expire_Date" Type="String" /> <asp:Parameter Name="Owner" Type="String" /> <asp:Parameter Name="Co_Owner" Type="String" /> <asp:Parameter Name="Comment" Type="String" /> <asp:Parameter Name="Updated_by" Type="String" /> <asp:Parameter Name="Update_Time" Type="DateTime" /> </UpdateParameters> </asp:SqlDataSource> <asp:SqlDataSource ID="dsListLicenseType" runat="server" ConnectionString="<%$ ConnectionStrings:CHPComplianceDB %>" SelectCommand="SELECT Facility_License_Type_ID ,Facility_License_Type_Name FROM dbo.tbl_Faciliy_License_Type ORDER BY Facility_License_Type_ID"></asp:SqlDataSource> <asp:SqlDataSource ID="dsListEntityCode" runat="server" ConnectionString="<%$ ConnectionStrings:CHPComplianceDB %>" SelectCommand="SELECT Licensing_Entity_ID, Entity_Code FROM dbo.tbl_Licensing_Entity ORDER BY Licensing_Entity_ID"></asp:SqlDataSource> <asp:SqlDataSource ID="dsOwverEmployee" runat="server" ConnectionString="<%$ ConnectionStrings:CHPComplianceDB %>" SelectCommand="SELECT DISTINCT Employee_ID = ADS_Person_ID, Employee_Name = Display_Name FROM dbo.tbl_ADS_Person WHERE Is_Active = 1 AND Department_Name <> '' ORDER BY Display_Name"></asp:SqlDataSource> <ig:WebHierarchicalDataSource ID="WebHierarchicalDataSource1" runat="server"> <DataViews> <ig:DataView ID="dsFacilityParent_DefaultView" DataMember="DefaultView" DataSourceID="dsFacilityParent" /> <ig:DataView ID="dsFaciltyChild_DefaultView" DataMember="DefaultView" DataSourceID="dsFaciltyChild" /> </DataViews> <DataRelations> <ig:DataRelation ChildColumns="Facility_ID,Facility_Name" ChildDataViewID="dsFaciltyChild_DefaultView" ParentColumns="Facility_ID,Facility_Name" ParentDataViewID="dsFacilityParent_DefaultView" /> </DataRelations> </ig:WebHierarchicalDataSource> <div class="w3-panel w3-light-grey"> <div class="w3-container w3-teal w3-center w3-margin-bottom w3-margin-top w3-card-4"> <h4><b><i class="fa fa-building"></i> Facility Licensing</b></h4> </div> <div class="w3-container w3-white w3-card-4 w3-round-large w3-margin"> <div class="w3-row-padding w3-center w3-margin"> <div class="w3-col" style="width: 20%"> <button id="btnFacility" class="w3-btn w3-teal"><i class="fa fa-building-o"></i> Manage Facilties</button> </div> <div class="w3-col" style="width: 20%"> <button id="btnLicType" class="w3-btn w3-teal"><i class="fa fa-id-card"></i> Manage License Types</button> </div> <div class="w3-rest" style="width: 20%"> <button id="bntEntity" class="w3-btn w3-teal"><i class="fa fa-id-card-o"></i> Manage Entities</button> </div> </div> </div> <div class="w3-container w3-white w3-card-4 w3-round-large w3-margin"> <center class="w3-margin"> <ig:WebHierarchicalDataGrid ID="WebHierarchicalDataGrid1" runat="server" Width="96%" AutoGenerateBands="False" AutoGenerateColumns="False" DataKeyFields="Facility_ID,Facility_Name" DataMember="dsFacilityParent_DefaultView" DataSourceID="WebHierarchicalDataSource1" Key="dsFacilityParent_DefaultView" CssClass="GridHeader GridMinHeight" ItemCssClass="GridHeader" HeaderCaptionCssClass="w3-teal"> <Bands> <ig:Band AutoGenerateColumns="False" DataMember="dsFaciltyChild_DefaultView" Key="dsFaciltyChild_DefaultView" DataKeyFields="Facility_License_ID"> <Columns> <ig:BoundDataField DataFieldName="Facility_License_ID" Hidden="True" Key="Facility_License_ID"> <Header Text="Facility_License_ID"> </Header> </ig:BoundDataField> <ig:BoundDataField DataFieldName="Facility_ID" Hidden="True" Key="Facility_ID"> <Header Text="Facility_ID"> </Header> </ig:BoundDataField> <ig:BoundDataField DataFieldName="Facility_Name" Key="Facility_Name" Hidden="True"> <Header Text="Facility_Name"> </Header> </ig:BoundDataField> <ig:BoundDataField DataFieldName="Facility_License_Type" Key="Facility_License_Type"> <Header Text="License Type"> </Header> </ig:BoundDataField> <ig:BoundDataField DataFieldName="Entity_Code" Key="Entity_Code"> <Header Text="Licensing Entity"> </Header> </ig:BoundDataField> <ig:BoundDataField DataFieldName="Facility_License_Nbr" Key="Facility_License_Nbr"> <Header Text="License Nbr"> </Header> </ig:BoundDataField> <ig:BoundDataField DataFieldName="License_Issue_Date" Key="License_Issue_Date" DataFormatString="{0:d}"> <Header Text="Issue Date"> </Header> </ig:BoundDataField> <ig:BoundDataField DataFieldName="License_Expire_Date" Key="License_Expire_Date" DataFormatString="{0:d}"> <Header Text="Expire Date"> </Header> </ig:BoundDataField> <ig:BoundDataField DataFieldName="Owner" Key="Owner"> <Header Text="Owner"> </Header> </ig:BoundDataField> <ig:BoundDataField DataFieldName="Co_Owner" Key="Co_Owner"> <Header Text="Co Owner"> </Header> </ig:BoundDataField> <ig:BoundDataField DataFieldName="Comment" Key="Comment"> <Header Text="Comments"> </Header> </ig:BoundDataField> <ig:BoundDataField DataFieldName="Inserted_by" Key="Inserted_by"> <Header Text="Created By"> </Header> </ig:BoundDataField> <ig:BoundDataField DataFieldName="Inesert_Time" Key="Inesert_Time" DataFormatString="{0:d} {0:t}"> <Header Text="Create Time"> </Header> </ig:BoundDataField> <ig:BoundDataField DataFieldName="Updated_by" Hidden="True" Key="Updated_by"> <Header Text="Updated_by"> </Header> </ig:BoundDataField> <ig:BoundDataField DataFieldName="Update_Time" Hidden="True" Key="Update_Time"> <Header Text="Update_Time"> </Header> </ig:BoundDataField> </Columns> <Behaviors> <ig:EditingCore EnableInheritance="True"> <Behaviors> <ig:CellEditing> <ColumnSettings> <ig:EditingColumnSetting ColumnKey="Facility_License_Type" EditorID="WebHierarchicalDataGrid1_DropDownProvider1" /> <ig:EditingColumnSetting ColumnKey="Entity_Code" EditorID="WebHierarchicalDataGrid1_DropDownProvider2" /> <ig:EditingColumnSetting ColumnKey="License_Issue_Date" EditorID="WebHierarchicalDataGrid1_DatePickerProvider1" /> <ig:EditingColumnSetting ColumnKey="License_Expire_Date" EditorID="WebHierarchicalDataGrid1_DatePickerProvider2" /> <ig:EditingColumnSetting ColumnKey="Owner" EditorID="WebHierarchicalDataGrid1_DropDownProvider3" /> <ig:EditingColumnSetting ColumnKey="Co_Owner" EditorID="WebHierarchicalDataGrid1_DropDownProvider4" /> <ig:EditingColumnSetting ColumnKey="Comment" EditorID="WebHierarchicalDataGrid1_TextEditorProvider1" /> <ig:EditingColumnSetting ColumnKey="Inserted_by" ReadOnly="True" /> <ig:EditingColumnSetting ColumnKey="Inesert_Time" ReadOnly="True" /> <ig:EditingColumnSetting ColumnKey="Updated_by" ReadOnly="True" /> <ig:EditingColumnSetting ColumnKey="Update_Time" ReadOnly="True" /> </ColumnSettings> </ig:CellEditing> <ig:RowEditing> <ColumnSettings> <ig:EditingColumnSetting ColumnKey="Facility_License_Type" EditorID="WebHierarchicalDataGrid1_DropDownProvider1" /> <ig:EditingColumnSetting ColumnKey="Entity_Code" EditorID="WebHierarchicalDataGrid1_DropDownProvider2" /> <ig:EditingColumnSetting ColumnKey="License_Issue_Date" EditorID="WebHierarchicalDataGrid1_DatePickerProvider1" /> <ig:EditingColumnSetting ColumnKey="License_Expire_Date" EditorID="WebHierarchicalDataGrid1_DatePickerProvider2" /> <ig:EditingColumnSetting ColumnKey="Owner" EditorID="WebHierarchicalDataGrid1_DropDownProvider3" /> <ig:EditingColumnSetting ColumnKey="Co_Owner" EditorID="WebHierarchicalDataGrid1_DropDownProvider4" /> <ig:EditingColumnSetting ColumnKey="Comment" EditorID="WebHierarchicalDataGrid1_TextEditorProvider1" /> <ig:EditingColumnSetting ColumnKey="Inserted_by" ReadOnly="True" /> <ig:EditingColumnSetting ColumnKey="Inesert_Time" ReadOnly="True" /> </ColumnSettings> </ig:RowEditing> <ig:RowAdding> <ColumnSettings> <ig:RowAddingColumnSetting ColumnKey="Facility_License_Type" EditorID="WebHierarchicalDataGrid1_DropDownProvider1" /> <ig:RowAddingColumnSetting ColumnKey="Entity_Code" EditorID="WebHierarchicalDataGrid1_DropDownProvider2" /> <ig:RowAddingColumnSetting ColumnKey="License_Issue_Date" EditorID="WebHierarchicalDataGrid1_DatePickerProvider1" /> <ig:RowAddingColumnSetting ColumnKey="License_Expire_Date" EditorID="WebHierarchicalDataGrid1_DatePickerProvider2" /> <ig:RowAddingColumnSetting ColumnKey="Owner" EditorID="WebHierarchicalDataGrid1_DropDownProvider3" /> <ig:RowAddingColumnSetting ColumnKey="Co_Owner" EditorID="WebHierarchicalDataGrid1_DropDownProvider4" /> <ig:RowAddingColumnSetting ColumnKey="Inserted_by" ReadOnly="True" /> <ig:RowAddingColumnSetting ColumnKey="Inesert_Time" ReadOnly="True" /> </ColumnSettings> </ig:RowAdding> </Behaviors> </ig:EditingCore> <ig:RowSelectors> </ig:RowSelectors> </Behaviors> </ig:Band> </Bands> <EditorProviders> <ig:DropDownProvider ID="WebHierarchicalDataGrid1_DropDownProvider1"> <EditorControl ClientIDMode="Predictable" DataSourceID="dsListLicenseType" DropDownContainerMaxHeight="200px" EnableAnimations="False" EnableDropDownAsChild="False" TextField="Facility_License_Type_Name" ValueField="Facility_License_Type_Name" runat="server"> <DropDownItemBinding TextField="Facility_License_Type_Name" ValueField="Facility_License_Type_Name" /> </EditorControl> </ig:DropDownProvider> <ig:DropDownProvider ID="WebHierarchicalDataGrid1_DropDownProvider2"> <EditorControl ClientIDMode="Predictable" DataSourceID="dsListEntityCode" DropDownContainerMaxHeight="200px" EnableAnimations="False" EnableDropDownAsChild="False" TextField="Entity_Code" ValueField="Entity_Code" runat="server"> <DropDownItemBinding TextField="Entity_Code" ValueField="Entity_Code" /> </EditorControl> </ig:DropDownProvider> <ig:DropDownProvider ID="WebHierarchicalDataGrid1_DropDownProvider3"> <EditorControl ClientIDMode="Predictable" DataSourceID="dsOwverEmployee" DropDownContainerMaxHeight="200px" EnableAnimations="False" EnableDropDownAsChild="False" TextField="Employee_Name" ValueField="Employee_Name" runat="server"> <DropDownItemBinding TextField="Employee_Name" ValueField="Employee_Name" /> </EditorControl> </ig:DropDownProvider> <ig:DatePickerProvider ID="WebHierarchicalDataGrid1_DatePickerProvider1"> <EditorControl ClientIDMode="Predictable" runat="server"> </EditorControl> </ig:DatePickerProvider> <ig:TextEditorProvider ID="WebHierarchicalDataGrid1_TextEditorProvider1"> <EditorControl ClientIDMode="Predictable" TextMode="MultiLine" runat="server"> </EditorControl> </ig:TextEditorProvider> <ig:DatePickerProvider ID="WebHierarchicalDataGrid1_DatePickerProvider2"> <EditorControl ClientIDMode="Predictable" runat="server"> </EditorControl> </ig:DatePickerProvider> <ig:DropDownProvider ID="WebHierarchicalDataGrid1_DropDownProvider4"> <EditorControl ClientIDMode="Predictable" DataSourceID="dsOwverEmployee" DropDownContainerMaxHeight="200px" EnableAnimations="False" EnableDropDownAsChild="False" TextField="Employee_Name" ValueField="Employee_Name" runat="server"> <DropDownItemBinding TextField="Employee_Name" ValueField="Employee_Name" /> </EditorControl> </ig:DropDownProvider> </EditorProviders> <Columns> <ig:BoundDataField DataFieldName="Facility_ID" Hidden="True" Key="Facility_ID"> <Header Text="Facility_ID"> </Header> </ig:BoundDataField> <ig:BoundDataField DataFieldName="Facility_Name" Key="Facility_Name"> <Header Text="Facility"> </Header> </ig:BoundDataField> </Columns> </ig:WebHierarchicalDataGrid> </center> </div> </div> </form> </body>
Code Behind:
Imports System.Data Imports System.Data.SqlClient Imports System.Web.HttpContext Imports Infragistics.Web.UI.GridControls Imports System.Net.Mail Imports Infragistics.Web.UI.WebScriptManager Imports System.Web.Services Imports Infragistics.Web.UI Partial Class _Default Inherits System.Web.UI.Page 'Private struserID As String = Right(Current.User.Identity.Name, Current.User.Identity.Name.Length - 4) Private strFID As String = "" Private strFname As String = "" Private ParentIndex As Integer Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Dim strUserName As String = "Forrest A. Gump" ''GetUserName(struserID) hdnUserName.Value = strUserName End Sub Private Sub dsFaciltyChild_Inserting(sender As Object, e As SqlDataSourceCommandEventArgs) Handles dsFaciltyChild.Inserting If IsDate(e.Command.Parameters.Item("@License_Issue_Date").Value) Then e.Command.Parameters.Item("@License_Issue_Date").Value = FormatDateTime(e.Command.Parameters.Item("@License_Issue_Date").Value, DateFormat.ShortDate) End If If IsDate(e.Command.Parameters.Item("@License_Expire_Date").Value) Then e.Command.Parameters.Item("@License_Expire_Date").Value = FormatDateTime(e.Command.Parameters.Item("@License_Expire_Date").Value, DateFormat.ShortDate) End If e.Command.Parameters.Item("@Facility_ID").Value = CInt(hdnFacilityID.Value) e.Command.Parameters.Item("@Facility_Name").Value = hdnFacilityName.Value e.Command.Parameters.Item("@Inserted_by").Value = hdnUserName.Value e.Command.Parameters.Item("@Inesert_Time").Value = FormatDateTime(Now, DateFormat.GeneralDate) e.Command.Parameters.Item("@Updated_by").Value = hdnUserName.Value e.Command.Parameters.Item("@Update_Time").Value = FormatDateTime(Now, DateFormat.GeneralDate) End Sub Private Sub dsFaciltyChild_Updating(sender As Object, e As SqlDataSourceCommandEventArgs) Handles dsFaciltyChild.Updating If IsDate(e.Command.Parameters.Item("@License_Issue_Date").Value) Then e.Command.Parameters.Item("@License_Issue_Date").Value = FormatDateTime(e.Command.Parameters.Item("@License_Issue_Date").Value, DateFormat.ShortDate) End If If IsDate(e.Command.Parameters.Item("@License_Expire_Date").Value) Then e.Command.Parameters.Item("@License_Expire_Date").Value = FormatDateTime(e.Command.Parameters.Item("@License_Expire_Date").Value, DateFormat.ShortDate) End If e.Command.Parameters.Item("@Facility_ID").Value = CInt(hdnFacilityID.Value) e.Command.Parameters.Item("@Facility_Name").Value = hdnFacilityName.Value e.Command.Parameters.Item("@Updated_by").Value = hdnUserName.Value e.Command.Parameters.Item("@Update_Time").Value = FormatDateTime(Now, DateFormat.GeneralDate) End Sub Private Sub WebHierarchicalDataGrid1_RowIslandDataBound(sender As Object, e As RowIslandEventArgs) Handles WebHierarchicalDataGrid1.RowIslandDataBound Dim strRwsIsLand As String = e.RowIsland.ID If e.RowIsland.DataMember = "dsFaciltyChild_DefaultView" Then If Not IsNothing(e.RowIsland.ParentRow) Then If Not IsNothing(e.RowIsland.ParentRow.Items(0).Value) Then hdnFacilityID.Value = e.RowIsland.ParentRow.Items(0).Value.ToString ParentIndex = e.RowIsland.ParentRow.Index strFID = hdnFacilityID.Value hdnFacilityName.Value = e.RowIsland.ParentRow.Items(1).Value.ToString strFname = hdnFacilityName.Value End If End If ElseIf e.RowIsland.DataMember = "dsFacilityParent_DefaultView" Then If Not e.RowIsland.Rows Is Nothing Then If Not e.RowIsland.Rows(ParentIndex).Items Is Nothing Then hdnFacilityID.Value = e.RowIsland.Rows(ParentIndex).Items(0).Value hdnFacilityName.Value = e.RowIsland.Rows(ParentIndex).Items(1).Value End If End If End If End Sub Private Sub WebHierarchicalDataGrid1_RowExpanded(sender As Object, e As ContainerRowEventArgs) Handles WebHierarchicalDataGrid1.RowExpanded If e.Row.DataItem.[Type] = "dsFacilityParent_DefaultView" Then ParentIndex = e.Row.Index End If End Sub Public Shared Function GetUserName(ByVal StremployeeID As String) As String If StremployeeID.Length > 0 Then Dim strCnn As String = ConfigurationManager.ConnectionStrings.Item("CHPComplianceDB").ToString Dim strSQL As String = "SELECT Top 1 Display_Name FROM dbo.tbl_ADS_Person WHERE ADS_Person_ID = '" & StremployeeID & "'" Dim strUserName As String = "" Dim m_DBCn As New SqlConnection(strCnn) m_DBCn.Open() Dim drDep As SqlDataReader = GetDataReader(strSQL, 30, m_DBCn) If drDep.HasRows Then strUserName = drDep("Display_Name").ToString drDep.Close() m_DBCn.Close() Return strUserName Else Return "" End If Else Return "" End If End Function Public Shared Function GetDataReader(ByVal SQL As String, ByVal Timeout As Integer, ByVal Cn As SqlConnection, Optional ByVal blnSkipRead As Boolean = False) As SqlDataReader Dim cmdQuery As New SqlCommand Dim dr As SqlDataReader cmdQuery.Connection = Cn cmdQuery.CommandTimeout = Timeout cmdQuery.CommandText = SQL cmdQuery.CommandType = CommandType.Text dr = cmdQuery.ExecuteReader If Not blnSkipRead Then dr.Read() Return dr End Function End Class
Thank you for posting in our community.
I have created and attached a small running sample based on the provided code snippets and I could not reproduce the issue. On my side, the WebHierarchicalDataGrid works as expected.
Please test the sample on your side and let me know how it behaves. If the sample is not working as per your expectation, please modify it so that it replicates the behavior and send it back to me for further investigation.
Looking forward to hearing from you.
8712.Sample.zip
Hello Martin and Happy New Year.
Thank you for your response. I am including the project and DB files where I am have having the issues.
My apologies Martin., I keep getting an error when uploading the zip file. The file is under 10Mb. it seems to complete the upload but the website give me an error when I click Reply..
Happy New Year, Fred!
If the zipped sample is too large and does not meet our forums' file size requirement, you can send it to our support email - support@infragistics.com. Please use the following ID as the subject - CAS-210705-J2C0R6.
You can also upload the sample on cloud storage like Google Drive, Dropbox, or any other, and share the link with me.
I am looking forward to hearing from you.
CAS-210705-J2C0R6
Hello Martin,
My apologies for just being able to get back to you. Below is the link to sample project zip file.
https://drive.google.com/file/d/1RLDolUjlS0dGuLTOPfCJVaNdpHXhdfAz/view?usp=sharing
I was able to figure out the Async error. Seems that the parameters defined in the Update and Insert statements of the child SQLDataSource were being ignored and a parameter was being assigned for every field in the child band of the grid.
I addressed this by removing the extra parameters in the code behind at the SQLDataSource Inserting and Updating events. I find that pretty odd as I never encountered that behavior before. I also noticed that the cell/row edit (Ok, Cancel) dialog doesn't show when changing cell values.
I no longer get async error after making the adjustments mentioned. Now the grid just hangs for several minutes then throws a 'Server does not respond" error when submitting changes or adding row information.
Again,
Thank you for your time, your help is very appreciated.
Hi Fred,
After further investigation, in order for the SQL data source error to be resolved, the columns produced by the select query must match in name and quantity with the input parameters of the UpdateCommand. I have used the IDE's design mode to reconfigure the child data source and generate these commands.
For getting the parent row you can use the EnteringEditMode client event for row adding and updating:
<ig:RowEditing> <RowEditingClientEvents EnteringEditMode="onEnteringEditModeInRowUpdating" /> <ColumnSettings> .... </ColumnSettings> </ig:RowEditing> <ig:RowAdding> <ColumnSettings> .... </ColumnSettings> <AddNewRowClientEvents EnteredEditMode="onEnteringEditModeInRowAdding" /> </ig:RowAdding>
function onEnteringEditModeInRowAdding(s, e) { var parentRow = e.getCell().get_grid().get_parentRow(); } function onEnteringEditModeInRowUpdating(s, e) { var parentRow = e.getCells()[0].getCell().get_row().get_grid().get_parentRow(); }
When testing the provided sample I could not reproduce the issues you are experiencing. The row editing dialog displays as expected and there is no thrown error during row adding and updating. I have created and attached a screencast for your reference. Please review it and let me know if you need any further assistance with this matter.
7522.Screencast.zip
Thank you again Martin,
would it be possible you to include the markup of the DataSource changes you've made. Also, I noticed in you're screenshot video that you added an update button to the page to update grid data . I didn't think that was needed with Auto CRUD on and batch updating set to false. I have other WHDG where the update/async postback occurs after clicking the Done button in the grid's edit dialog.
Here is the markup for the SQL data source:
<asp:SqlDataSource ID="dsFaciltyChild" runat="server" ConnectionString="<%$ ConnectionStrings:CHPComplianceDB %>" InsertCommand="INSERT INTO [tbl_Facility_License] ([Facility_ID], [Facility_Name], [Facility_License_Type], [Entity_Code], [Facility_License_Nbr], [License_Issue_Date], [License_Expire_Date], [Owner], [Co_Owner], [Comment], [Inserted_by], [Inesert_Time], [Updated_by], [Update_Time]) VALUES (@Facility_ID, @Facility_Name, @Facility_License_Type, @Entity_Code, @Facility_License_Nbr, @License_Issue_Date, @License_Expire_Date, @Owner, @Co_Owner, @Comment, @Inserted_by, @Inesert_Time, @Updated_by, @Update_Time)" SelectCommand="SELECT * FROM [tbl_Facility_License]" UpdateCommand="UPDATE [tbl_Facility_License] SET [Facility_ID] = @Facility_ID, [Facility_Name] = @Facility_Name, [Facility_License_Type] = @Facility_License_Type, [Entity_Code] = @Entity_Code, [Facility_License_Nbr] = @Facility_License_Nbr, [License_Issue_Date] = @License_Issue_Date, [License_Expire_Date] = @License_Expire_Date, [Owner] = @Owner, [Co_Owner] = @Co_Owner, [Comment] = @Comment, [Inserted_by] = @Inserted_by, [Inesert_Time] = @Inesert_Time, [Updated_by] = @Updated_by, [Update_Time] = @Update_Time WHERE [Facility_License_ID] = @Facility_License_ID" DeleteCommand="DELETE FROM [tbl_Facility_License] WHERE [Facility_License_ID] = @Facility_License_ID"> <DeleteParameters> <asp:Parameter Name="Facility_License_ID" Type="Int32" /> </DeleteParameters> <InsertParameters> <asp:Parameter Name="Facility_ID" Type="Int32" /> <asp:Parameter Name="Facility_Name" Type="String" /> <asp:Parameter Name="Facility_License_Type" Type="String" /> <asp:Parameter Name="Entity_Code" Type="String" /> <asp:Parameter Name="Facility_License_Nbr" Type="String" /> <asp:Parameter Name="License_Issue_Date" DbType="Date" /> <asp:Parameter Name="License_Expire_Date" DbType="Date" /> <asp:Parameter Name="Owner" Type="String" /> <asp:Parameter Name="Co_Owner" Type="String" /> <asp:Parameter Name="Comment" Type="String" /> <asp:Parameter Name="Inserted_by" Type="String" /> <asp:Parameter Name="Inesert_Time" Type="DateTime" /> <asp:Parameter Name="Updated_by" Type="String" /> <asp:Parameter Name="Update_Time" Type="DateTime" /> </InsertParameters> <UpdateParameters> <asp:Parameter Name="Facility_ID" Type="Int32" /> <asp:Parameter Name="Facility_Name" Type="String" /> <asp:Parameter Name="Facility_License_Type" Type="String" /> <asp:Parameter Name="Entity_Code" Type="String" /> <asp:Parameter Name="Facility_License_Nbr" Type="String" /> <asp:Parameter Name="License_Issue_Date" DbType="Date" /> <asp:Parameter Name="License_Expire_Date" DbType="Date" /> <asp:Parameter Name="Owner" Type="String" /> <asp:Parameter Name="Co_Owner" Type="String" /> <asp:Parameter Name="Comment" Type="String" /> <asp:Parameter Name="Inserted_by" Type="String" /> <asp:Parameter Name="Inesert_Time" Type="DateTime" /> <asp:Parameter Name="Updated_by" Type="String" /> <asp:Parameter Name="Update_Time" Type="DateTime" /> <asp:Parameter Name="Facility_License_ID" Type="Int32" /> </UpdateParameters> </asp:SqlDataSource>
I had added batch updating for testing purposes. My apologies for not mentioning that.
The postback for updating the database is triggered when the focus is changed to another row. In order the commit the change when the Done button is clicked, the ExitedEditMode event has to be handled:
<ig:RowEditing> <RowEditingClientEvents EnteringEditMode="onEnteringEditModeInRowUpdating" ExitedEditMode="commitToDB" /> <ColumnSettings> ..... </ColumnSettings> </ig:RowEditing>
function commitToDB(s, e) { s.get_behaviors().get_editingCore().commit(); }
Please let me know if you need more information.