This is a migrated thread and some comments may be shown as answers.

Change the editable text box to a drop box when editing a RadGrid Column

1 Answer 117 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Calin
Top achievements
Rank 1
Calin asked on 15 Jul 2019, 06:06 PM

I have a rad grid displaying info, a list of keys assigned to employees. Once a key is added in the list, the ONLY thing in the future that should be editable is the status column, which there will only be 3 options: lost, Found and Reassigned, and Assigned. Since there are only 3 options I want there, I do not want a text box for them to edit whatever status they want, only these options. I would like the text box to be a drop down list, if possible. I cannot figure out how to change this through any settings though, is this something that needs done in the code behind? 

 

Attached is a picture for reference. 

1 Answer, 1 is accepted

Sort by
0
Attila Antal
Telerik team
answered on 18 Jul 2019, 02:22 PM
Hi Calin,

I understand that you would like the Insert Form to be different from the Edit Form, is that correct? If that is the case, you can use Custom Edit Forms with WebUserControls for each edit mode. When the Button is clicked it fires the event Insert or Edit, and in the ItemCommand event handler, you can swap the WebUserControl used by the Grid to insert/Edit the items.

Example:


protected void RadGrid1_ItemCommand(object sender, GridCommandEventArgs e)
{
    if(e.CommandName == RadGrid.InitInsertCommandName)
    {
        RadGrid1.MasterTableView.EditFormSettings.UserControlName = "InsertFormUserControl.ascx";
    }else if(e.CommandName == RadGrid.EditCommandName)
    {
        RadGrid1.MasterTableView.EditFormSettings.UserControlName = "EditFormUserControl.ascx";
    }
}

See alo:
Please let me know if you have any questions.

Kind regards,
Attila Antal
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
General Discussions
Asked by
Calin
Top achievements
Rank 1
Answers by
Attila Antal
Telerik team
Share this question
or