getting a selected value from a radgrid selection

2 posts, 0 answers
  1. Calin
    Calin avatar
    12 posts
    Member since:
    Feb 2019

    Posted 13 Sep Link to this post

    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.

     

     

     
  2. Attila Antal
    Admin
    Attila Antal avatar
    426 posts

    Posted 18 Sep Link to this post

    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.
Back to Top