We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Grid with DropDown not udpating (inline edit)

Thread ID:





95807 Aug 2,2010 04:36 PM UTC Sep 3,2012 01:02 PM UTC ASP.NET Web Forms (Classic) 3
Tags: GridGroupingControl
Brandon Harris
Asked On August 2, 2010 04:36 PM UTC

I've got the grid displaying rows from my SQL table fine, and any edits (inline, just typing xyz, etc..) update fine on the page and the SQL back-end. However, I have a number of fields that need to pull values from the back-end for editing purposes, I can't allow straight text input from a user. So I've created a template with a drowndown box in the row/cell.. See image for code on how I've done this.

The inline editing works fine selecting the values and updating the values from SQL as text, but it won't update when I change the value from the dropdown box. I've also removed any "where" clause from the Update statement to see if it was a parameter issue, and the change was not updated on the page or in SQL after choosing a different value.

So long story short, inline editing works for all fields that are not a dropdown. I can change the cell/field to a dropdown, but using that dropdown to choose a new value doesn't update on the page or on the back-end (via sql).

Any ideas? Let me know if this sounds really confusing and I can try and explain it better.




Manickam Chidambaram [Syncfusion]
Replied On August 6, 2010 01:17 PM UTC

Hi Brandon,

Thanks for your interest in Syncfusion Products.

I am afraid that I am unable to reproduce the issue reported by you. So could you please provide us more details to reproduce this issue so that we could sort out this issue and provide you the solution?

For your convenience we created a simple sample which uses DropDownList in InlineEdit Mode. The sample can be downloaded from following link.


Also we suggest you to refer our online samples from the following link to know more about InlineEdit Mode of Syncfusion Grid grouping Control.


Please try using the above sample and let me know if it helps.


Replied On August 7, 2012 02:57 AM UTC

  I am using the code you posted in the sample. I have a grid showing products. The products have a field "categorycode" that points to table Categories. The grid has a column for "categoryCode", but I want to display the "Name" field of Categories table in that column. Is it possible to accomplish that using a dropdown column?
 I used the same code you posted here:

DropDownList dropdown = new DropDownList();

dropdown.DataSourceID =


dropdown.DataTextField =


dropdown.DataValueField =


//Here we adding the DropDownListBox programatically using ITemplate Interface
TemplateClass mytemp = new TemplateClass(dropdown);
e.TableCellIdentity.Column.EditItemTemplate = mytemp;
In editing mode, I see the dropdown combo in the line but:
1- In categorycode column: the lines show the Code instead of the Name
2- when start editing, the combo selected value is not set to the current value of the row (this is, the Products.categoryCode is not looked up in the dropdrowncombo)
3- I select a value in the dropdown, but the column categoryCode doesn't get the value selected by me in the dropdown, it doesnt change.


Eswari S [Syncfusion]
Replied On September 3, 2012 01:02 PM UTC

Hi Fernando,
Thanks for your patience.
We have prepared the sample for your reference and the same can be downloaded from the following link:
Step #1 :  Set the text and value as different for dropdown.
    protected void DropDownList1_Load(object sender, EventArgs e)
        //cast the sender object to dropdownlist object
        DropDownList DDL = (DropDownList)sender;
        //to get distinct companyname values
        AccessDataSource1.SelectCommand = "SELECT Distinct [CompanyName] , [Country] FROM [Customers]";
        DDL.DataSource = AccessDataSource1;
        DDL.DataTextField = "Country";   // text as country
        DDL.DataValueField = "CompanyName";  // value as CompamnyName
        //if the current record is not new record
        if (GridGroupingControl1.CurrentTable.CurrentRecord.Kind != DisplayElementKind.AddNewRecord)
            //set the grid current record's companyname to dropdownlist's selectedvalue      
            DDL.SelectedValue = GridGroupingControl1.CurrentTable.CurrentRecord.GetValue("CompanyName").ToString();
Step #2 : Save the text value to the grid column as like below:

protected void GridGroupingControl1_BarButtonItemClicked(object source, Syncfusion.Web.UI.WebControls.Grid.Grouping.ButtonBarItemClickEventArgs e)
        if (e.ButtonBarItem.ButtonBarItemType == ButtonBarItemType.Save )
            Record curRecord = this.GridGroupingControl1.FormEditCell.CurrentRecord;           
            DropDownList ddl = this.GridGroupingControl1.FormEditCell.FindControl("DropDownList1") as DropDownList;          
            curRecord.SetValue("CompanyName", ddl.SelectedItem.Text);   // set text to column instead value
           .  . . . . .
Please try this and let us know if you need any further assistance.


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon