Concatenate selected value with existing column content in grid

3 posts, 0 answers
  1. Clive Hoggar
    Clive Hoggar avatar
    349 posts
    Member since:
    Nov 2008

    Posted 05 Nov 2011 Link to this post

    Hi I have a combox in the edit template of a column in a grid . I would like to intercept the selected value and add it to the existing column content , rather than replace it when Update button is clicked. Can you give me some pointers? Which grid event ? How to grab the existing value , and rebind it with the selected value? ( I'll add a comma separator) Thanks for help with this. I am going round in circles but not getting to the solution . Thanks Clive
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 06 Nov 2011 Link to this post

    Hello Clive,

    Check the following help documentation which explains more about this.
    Operations with MS DropDownList in EditItemTemplate of GridTemplateColumn.

    Thanks,
    Shinu.
  3. Dimitar Terziev
    Admin
    Dimitar Terziev avatar
    1268 posts

    Posted 09 Nov 2011 Link to this post

    Hi Clive,

    In order to achieve the desired functionality you should manually updated your data source with the value selected from the RadComboBox. First you should subscribe on the SelectedIndexChanged event of the RadComboBox. In the event handler function you should get reference to the GridDataItem which is currently being edited. This could be done by accessing the NamingContainer of the RadComboBox. Once you have a reference to the GridDataItem you will find the corresponding record in the database and append the newly selected value to the existing one, so when the update command is executed the Grid will be bound to this new value.

    Regards,
    Dimitar Terziev
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Back to Top