Hello,
I have a dropdown provider already set EnableClientRendering="True" in a WHDG. But when I have changed items of dropdown, cell's value is not change.
I have tried to used DropdownProvider_SelectionChanged client event to set value of dropdown item into cell. But I can't get value of dropdown item (get text is ok).
Here is my sample code:
<ig:WebHierarchicalDataGrid ID="WebHierarchicalDataGrid1" runat="server" DataMember="TBL1" DataKeyFields="ID" EnableAjax="False" EnableRelativeLayout="True" InitialDataBindDepth="-1" EnableDataViewState="True" OnRowUpdating="WebHierarchicalDataGrid1_RowUpdating" AutoGenerateColumns="False" AutoGenerateBands="False" Width="100%" Height="300px"> <ClientEvents AJAXResponse="WebHierarchicalDataGrid1_ContainerGrid_AJAXResponse" /> <EditorProviders> <ig:DropDownProvider ID="WebHierarchicalDataGrid1_DropDownProvider1"> <EditorControl ClientIDMode="Predictable" DropDownContainerMaxHeight="200px" EnableViewState="True" EnableAnimations="False" EnableDropDownAsChild="False" EnableClientRendering="True" EnableRenderingAnchors="True" EnableAutoCompleteFirstMatch="False"> <ClientEvents Initialize="Init" SelectionChanged="WebHierarchicalDataGrid1_DropDown_SelectionChanged" ValueChanged="WebHierarchicalDataGrid1_DropDown_ValueChanged" InputKeyUp="WebHierarchicalDataGrid1_DropDown_InputKeyUp" /> <AutoPostBackFlags ValueChanged="Off"></AutoPostBackFlags> </EditorControl> </ig:DropDownProvider> </EditorProviders> <Columns> <ig:BoundDataField DataFieldName="ID" Key="ID" Hidden="True"> </ig:BoundDataField> <ig:UnboundField Key="Active_YN" CssClass="ParentRow"> <Header Text="Active"> </Header> </ig:UnboundField> <ig:UnboundField Key="Sort_Seq_No" CssClass="ParentRow"> <Header Text="Sort No."> </Header> </ig:UnboundField> <ig:BoundDataField DataFieldName="Descr" Key="Descr" CssClass="ParentRow"> <Header Text="Field Name"> </Header> </ig:BoundDataField> <ig:UnboundField Key="Column_Type_Lkup" DataType="System.Int16" CssClass="ParentRow"> <Header Text="Data Type"> </Header> </ig:UnboundField> <ig:UnboundField Key="Instruction_Comment" CssClass="ParentRow"> <Header Text="Instructions"> </Header> </ig:UnboundField> <ig:UnboundField Key="XML_Attribute_Name" CssClass="ParentRow"> <Header Text="XML Attribute"> </Header> </ig:UnboundField> <ig:UnboundField Key="Document_Prep_Name" CssClass="ParentRow"> <Header Text="Doc Tag Name"> </Header> </ig:UnboundField> <ig:UnboundField Key="Business_Rule_Name" CssClass="ParentRow"> <Header Text="Business Rule Attribute"> </Header> </ig:UnboundField> </Columns> <Bands> <ig:Band AutoGenerateColumns="False" Key="ChildBand_0" ShowHeader="False" ShowFooter="False" DataKeyFields="ID"> <Columns> <ig:BoundDataField DataFieldName="ID" Key="ID" Hidden="True"> </ig:BoundDataField> <ig:BoundCheckBoxField DataFieldName="Active_YN" DataType="System.Boolean" Key="Active_YN"> <Header Text="Active"> </Header> </ig:BoundCheckBoxField> <ig:BoundDataField DataFieldName="Sort_Seq_No" Key="Sort_Seq_No"> <Header Text="Sort No."> </Header> </ig:BoundDataField> <ig:BoundDataField DataFieldName="Column_Name" Key="Column_Name"> <Header Text="Field Name"> </Header> </ig:BoundDataField> <ig:BoundDataField DataFieldName="Column_Note_Pad_Column_Type_Lkup_ID" Key="Column_Type_Lkup" DataType="System.Int16"> <Header Text="Data Type"> </Header> </ig:BoundDataField> <ig:BoundDataField DataFieldName="Instruction_Comment" Key="Instruction_Comment"> <Header Text="Instructions"> </Header> </ig:BoundDataField> <ig:BoundDataField DataFieldName="XML_Attribute_Name" Key="XML_Attribute_Name"> <Header Text="XML Attribute"> </Header> </ig:BoundDataField> <ig:BoundDataField DataFieldName="Document_Prep_Name" Key="Document_Prep_Name"> <Header Text="Doc Tag Name"> </Header> </ig:BoundDataField> <ig:BoundDataField DataFieldName="Business_Rule_Name" Key="Business_Rule_Name"> <Header Text="Business Rule Attribute"> </Header> </ig:BoundDataField> </Columns> <Behaviors> <ig:RowSelectors Enabled="True"> </ig:RowSelectors> <ig:EditingCore BatchUpdating="True" AutoCRUD="False"> <EditingClientEvents RowAdding="WebHierarchicalDataGrid1_Editing_RowAdding" /> <Behaviors> <ig:CellEditing> <ColumnSettings> <ig:EditingColumnSetting ColumnKey="Column_Type_Lkup" EditorID="WebHierarchicalDataGrid1_DropDownProvider1" /> </ColumnSettings> <CellEditingClientEvents EnteredEditMode="WebHierarchicalDataGrid1_CellEditing_EnteredEditMode" /> <EditModeActions EnableOnActive="True" MouseClick="Single" /> </ig:CellEditing> <ig:RowAdding Enabled="False"> <ColumnSettings> <ig:RowAddingColumnSetting ColumnKey="Column_Type_Lkup" EditorID="WebHierarchicalDataGrid1_DropDownProvider1" /> <ig:RowAddingColumnSetting ColumnKey="Active_YN" DefaultValueAsString="False" /> <ig:RowAddingColumnSetting ColumnKey="ID" /> </ColumnSettings> <AddNewRowClientEvents EnteredEditMode="WebHierarchicalDataGrid1_RowAdding_EnteredEditMode" /> <EditModeActions EnableOnActive="False" MouseClick="Single" /> </ig:RowAdding> </Behaviors> </ig:EditingCore> <ig:Sorting Enabled="True"> </ig:Sorting> <ig:ColumnResizing> </ig:ColumnResizing> </Behaviors> </ig:Band> </Bands> <Behaviors> <ig:EditingCore BatchUpdating="True" AutoCRUD="False"> <Behaviors> <ig:RowAdding Enabled="False"> <ColumnSettings> <ig:RowAddingColumnSetting ColumnKey="Descr" /> <ig:RowAddingColumnSetting ColumnKey="ID" /> </ColumnSettings> </ig:RowAdding> <ig:CellEditing Enabled="False"> </ig:CellEditing> </Behaviors> </ig:EditingCore> <ig:RowSelectors Enabled="True"> <RowSelectorClientEvents RowSelectorClicking="WebHierarchicalDataGrid1_RowSelector_RowSelectorClicking" /> </ig:RowSelectors> <ig:Selection Enabled="True"> <SelectionClientEvents RowSelectionChanging="WebHierarchicalDataGrid1_Selection_RowSelectionChanging" /> </ig:Selection> <ig:Activation Enabled="True"> </ig:Activation> <ig:ColumnResizing> <ColumnResizingClientEvents ColumnResized="WebHierarchicalDataGrid1_ColumnResizing_ColumnResized" /> </ig:ColumnResizing> </Behaviors> </ig:WebHierarchicalDataGrid>
I'm using NetAdvantage version 14.1.20141.2150 lastest released.
Please help me out the issue.
Thanks & Regards!
Hello Mr Slim,
Thank you for posting in our community.
I've created a sample using your code and when the dropdown item is changed the grid cell's value is changed as well. Please test the attached sample on your side and let me know if you're able to reproduce the issue with it. Also feel free to modify it if it doesn't exactly demonstrate your scenario.
If you need further assistance, let me know.
Sincerely,
Tsanna
Hi Tsanna, thank you for quick reply.
I used your attached sample and add this function to describe clearly my problem
function WebHierarchicalDataGrid1_DropDown_SelectionChanged(sender, eventArgs) { var item = eventArgs.getNewSelection()[0]; var cellText = item.get_text(); alert(cellText); var cellValue = item.get_value();//undefined => I want to get value of this selected item instead of undefined value. alert(cellValue); }
Please help me out of this.
Best regards, Slim
I'm not sure what behavior you're experiencing on your side, however on my side when I'm changing the respective cell value and pressing Enter to exit edit mode, the new cell value is applied properly. In order to demonstrate you what I'm seeing, I've captured a video for your reference. Please take a look at it and let me know if I'm doing something different than you in reproducing the issue.
Looking forward to your response.
Hi Tsanna!
In your video, you set TextField="Address" and ValueField="Address" of the DropDownProvider is the same, so you always receive selected item value.
But in my scenario, I set TextField="Address" and ValueField="ID", because I want receive ID value, not Address value.
Please change your configuration then test again.
Thank you and best regards, Slim.
Hello Slim,
Thank you for your patience.
I have checked this scenario when EnableClientRendering is disabled on the dropdown provider which seems to resolve the issue of the item's value not being returned. Please note that client rendering can be used only when the dropdown is bound purely on the client as shown at:
http://www.infragistics.com/samples/aspnet/drop-down/using-client-binding-to-bind-to-hierarchical-json
http://help.infragistics.com/doc/ASPNET/2014.1/CLR4.0/?page=Infragistics4.Web.v14.1~Infragistics.Web.UI.ListControls.WebDropDown~EnableClientRendering.html
Hope this helps. Please do not hesitate to contact me if you have any questions.
Please feel free to contact me if you are still experiencing any issues with this scenario.