Current filter:
                                You should refresh the page.
                                  • Hi Team
                                    In attached screenshot we have grid that have part number field, on text change of it i have to populate few fields like Class and Category which are GridViewDataComboBoxColumn.
                                     Problem is, when we try to set value using selectedindex, it does not set any value for Class field. It remains blank.
                                    Below is my code snippets.

                                    1. GridView
                                    [ASPx]
                                    GridView <dx:ASPxGridView ID="GridSourceComponentCard" runat="server" KeyFieldName="iAssetPartId" ClientInstanceName="GridSourceComponentCard" Width="900px" DataSourceID="odsComponentCards" Visible="true" OnRowInserting="GridSourceComponentCard_RowInserting" OnRowInserted="GridSourceComponentCard_RowInserted" OnRowUpdating="GridSourceComponentCard_RowUpdating" OnRowDeleting="GridSourceComponentCard_RowDeleting" OnRowDeleted="GridSourceComponentCard_RowDeleted" OnInitNewRow="GridSourceComponentCard_InitNewRow" OnCellEditorInitialize="GridSourceComponentCard_CellEditorInitialize"> <Columns> <dx:GridViewDataTextColumn Caption="PART #" HeaderStyle-Wrap="False" FieldName="vPartNumber" VisibleIndex="1" CellStyle-Wrap="True"> <PropertiesTextEdit MaxLength="100" Width="180px"> <ValidationSettings Display="Dynamic"> <RequiredField IsRequired="true" ErrorText="Please enter the Part Number" /> </ValidationSettings> </PropertiesTextEdit> <EditItemTemplate> <dx:ASPxTextBox ID="txtPartNumber" runat="server" ClientInstanceName="txtPartNumber"> <ClientSideEvents ValueChanged="PartTextChanged"></ClientSideEvents> </dx:ASPxTextBox> </EditItemTemplate> </dx:GridViewDataTextColumn> <dx:GridViewDataTextColumn Caption="SERIAL #" HeaderStyle-Wrap="False" FieldName="vSerialNumber" VisibleIndex="2" CellStyle-Wrap="True"> <PropertiesTextEdit MaxLength="100" Width="180px"> <ValidationSettings Display="Dynamic"> <RequiredField IsRequired="true" ErrorText="Please enter the Serial Number" /> </ValidationSettings> </PropertiesTextEdit> </dx:GridViewDataTextColumn> <dx:GridViewDataComboBoxColumn Caption="CLASS" FieldName="Class" VisibleIndex="3"> <PropertiesComboBox DataSourceID="odsClass" ValueField="iMainID" IncrementalFilteringMode="StartsWith" TextField="vDescription" ValueType="System.String" DropDownStyle="DropDown" Width="180px" ClientInstanceName="vClass"> <ClientSideEvents SelectedIndexChanged="function(s, e) { OnClassChanged(s); }"></ClientSideEvents> <ValidationSettings> <RequiredField IsRequired="true" ErrorText="Please select Class" /> </ValidationSettings> </PropertiesComboBox> </dx:GridViewDataComboBoxColumn> <dx:GridViewDataComboBoxColumn Caption="INTERFACE" FieldName="iMotherBoardConnectorType" VisibleIndex="4"> <PropertiesComboBox DataSourceID="odsINTERFACE" ValueField="iMainID" IncrementalFilteringMode="StartsWith" TextField="vDescription" ValueType="System.String" DropDownStyle="DropDown" Width="180px"> <ValidationSettings> <RequiredField IsRequired="true" ErrorText="Please select INTERFACE" /> </ValidationSettings> </PropertiesComboBox> </dx:GridViewDataComboBoxColumn> <dx:GridViewDataComboBoxColumn Caption="CATEGORY" FieldName="Category" VisibleIndex="5"> <PropertiesComboBox DataSourceID="odsCategory" ValueField="iMainID" IncrementalFilteringMode="StartsWith" TextField="vDescription" ValueType="System.String" DropDownStyle="DropDown" Width="180px"> <ValidationSettings> <RequiredField IsRequired="true" ErrorText="Please select Category" /> </ValidationSettings> </PropertiesComboBox> </dx:GridViewDataComboBoxColumn> <dx:GridViewDataComboBoxColumn Caption="I/O PORTS" FieldName="iOutputConnectorType" VisibleIndex="6"> <PropertiesComboBox DataSourceID="odsIOPORTS" ValueField="iMainID" IncrementalFilteringMode="StartsWith" TextField="vDescription" ValueType="System.String" DropDownStyle="DropDownList" Width="180px"> <ValidationSettings> <RequiredField IsRequired="true" ErrorText="Please select I/O PORTS" /> </ValidationSettings> </PropertiesComboBox> </dx:GridViewDataComboBoxColumn> <dx:GridViewDataComboBoxColumn Caption="MANUFACTURER" FieldName="iMfg" VisibleIndex="7"> <PropertiesComboBox DataSourceID="odsMfg" ValueField="iMainID" IncrementalFilteringMode="StartsWith" TextField="vDescription" ValueType="System.String" DropDownStyle="DropDown" Width="180px"> <ValidationSettings> <RequiredField IsRequired="true" ErrorText="Please select MANUFACTURER" /> </ValidationSettings> </PropertiesComboBox> </dx:GridViewDataComboBoxColumn> <dx:GridViewDataComboBoxColumn Caption="I/O PORTS QTY" FieldName="iQuantity" VisibleIndex="8"> <PropertiesComboBox DataSourceID="odsIOPORTQTY" ValueField="iMainID" IncrementalFilteringMode="StartsWith" TextField="vDescription" ValueType="System.String" DropDownStyle="DropDown" Width="180px"> <ValidationSettings> <RequiredField IsRequired="true" ErrorText="Please select I/O PORTS QTY" /> </ValidationSettings> </PropertiesComboBox> </dx:GridViewDataComboBoxColumn> <dx:GridViewDataTextColumn Caption="MODEL" HeaderStyle-Wrap="False" FieldName="vMfgModelNumber" VisibleIndex="9" CellStyle-Wrap="True"> <PropertiesTextEdit MaxLength="100" Width="180px"> <ValidationSettings Display="Dynamic"> <RequiredField IsRequired="true" ErrorText="Please enter the MODEL" /> </ValidationSettings> </PropertiesTextEdit> </dx:GridViewDataTextColumn> <dx:GridViewDataTextColumn Caption="WEIGHT" HeaderStyle-Wrap="False" FieldName="weight" VisibleIndex="10" CellStyle-Wrap="True"> <PropertiesTextEdit MaxLength="100" Width="180px"> <ValidationSettings Display="Dynamic"> <RegularExpression ValidationExpression="^\d+(.\d{1,2})?$" ErrorText="Please enter decimal numbers only" /> </ValidationSettings> </PropertiesTextEdit> </dx:GridViewDataTextColumn> <dx:GridViewCommandColumn VisibleIndex="11" Caption="Actions" ButtonType="Image" Width="100px"> <EditButton Visible="true"> <Image ToolTip="Edit" Url="~/Images/icons/new/pencil.ico" Width="20px" /> </EditButton> <DeleteButton Visible="true"> <Image ToolTip="Delete" Url="~/Images/icons/delete.jpg" Width="20px" /> </DeleteButton> <CancelButton Visible="True"> <Image ToolTip="Close Edit Form without saving changes" Url="~/Images/icons/new/block.ico" Width="20px" /> </CancelButton> <UpdateButton Visible="True"> <Image ToolTip="Save changes and close Edit Form" Url="…/Images/icons/save.png" Width="20px" /> </UpdateButton> </dx:GridViewCommandColumn> </Columns> <SettingsPager PageSize="10" /> <Settings ShowStatusBar="Visible" GridLines="Both" UseFixedTableLayout="true" /> <SettingsBehavior ConfirmDelete="true" /> <SettingsText ConfirmDelete="Are you sure you wish to delete this row?" /> </dx:ASPxGridView>
                                    2. Javascript Function
                                    [JavaScript]
                                    function PartTextChanged(s,e) { //GridSourceComponentCard.GetEditor("vPartNumber").PerformCallback(txtPart.GetValue().toString()); //GridSourceComponentCard.PerformCallback(GridSourceComponentCard.GetEditValue("vPartNumber")); //loadingPanel.Show(); var vPartNumber = s.GetValue(); Generic_AJAXcallToWCFService("POST",false, "ComponentCards.aspx/GetPartDetails", "{vPartNumber:" + vPartNumber + "}", function (outData) { if (outData != null) { $.each(outData, function (val, option) { var xmlDoc = $.parseXML(outData.d); var xml = $(xmlDoc); var customers = xml.find("Table"); $(customers).each(function () { alert($(this).find("iClassID").text()); /*var clientNameEditor = GridSourceComponentCard.GetEditor("vClass"); clientNameEditor.SetValue($(this).find("iClassID").text());*/ //clientNameEditor.SetSelectedIndex(clientNameEditor.GetItem("12")); GridSourceComponentCard.GetEditor("vClass").SetSelectedIndex = 2;//Hardcoded for testing purpose alert($(this).find("vClassDescription").text()); }); }); } //loadingPanel.Hide(); }); }
                                    3. Web Method for AJAX call
                                    [C#]
                                    [WebMethod] public static string GetPartDetails(string vPartNumber) { DataSet ds = new DataSet(); BLDetailAssetComponents objDetails = new BLDetailAssetComponents(); ds = objDetails.Detail_AssetComponents_GetDropDownValues("PartNo", null, vPartNumber); //return Convert.ToString(ds.Tables[0].Rows[0]["vClassDescription"]); //return Convert.ToString(ds.Tables[0].Rows[0]["iClassID"]); return ds.GetXml(); }

                                1 Solution

                                Creation Date Importance Sort by

                                Hi,
                                 
                                The ASPxClientComboBox.SetSelectedIndex member is a method, while in your code it's used as a property.
                                In addition to that, the ASPxClientGridView.GetEditor method expects that you pass a column field name or index. In your code, you are passing another value ("vClass") to this method.
                                Adjust these factors to solve the problem. If it persists, I recommend that you use the approach from the How to enable script debugging article and check if your client-side code is executed as expected.