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

getting a selected value from a radgrid selection

1 Answer 89 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Calin
Top achievements
Rank 1
Calin asked on 13 Sep 2019, 05:38 PM

I have a rad grid full of keys assigned to an employee, which is populated from an employee selected in a combo box, and that information is pulled in from sql. I have the allow edit column turned on as there is one column that will need updating, the key status. All other columns are hidden when I hit edit. When the edit button is hit, a drop down box appears under the selected row, full of options for the status of the key. One should be selected, and then when update is hit, it should then change the key status in the grid. To do this, I need to pass a parameter, ID, to the update key store procedure I want to use for updating to the database. Each key has an ID, and upon editing a row, the parameter of course needs to be the value of the ID column in that selected row upon editing. How exactly do I implement this? Pictures attached to show what I am working with, things blurred out as necessary. I am working in VB.

 

 

 

1 Answer, 1 is accepted

Sort by
0
Attila Antal
Telerik team
answered on 18 Sep 2019, 02:52 PM

Hi Calin,

 

Before you begin, I would highly recommend using Advanced Data-binding (Using NeedDataSource Event) or Declarative DataSource technique to bind data.  In those case, you will need to ensure that .DataBind() method is not called anywhere as it my cause unexpected behavior.

As for the complete scenario, there are many ways, and since I am not aware of the current setup you are using, I will point our several directions you can look.

Updating a record can be done in different ways, again it depends on the data binding technique:

 

Collecting the values from the drop down can vary depending whether you use GridDropDownColumn or GridTemplateColumn, and also depends on the way is used to editing/updating records. 

 

Of course, when doing things manually, you will might want to know how to access objects, items, cells, and more: Accessing Cells and Rows

To do things in different events: Distinguish Edit or Insert Mode

 

To provide you with a more accurate answer, I would need to know more about how the grid is bound, the columns used, data bound to dropdown, how the CRUD operation is done, etc.. The best would be if you share the markup and code behind related to RadGrid. That would give me a good idea on what you have now and allow me to advise you accordingly.

I look forward to hearing from you.

 

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
Grid
Asked by
Calin
Top achievements
Rank 1
Answers by
Attila Antal
Telerik team
Share this question
or