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

Custom control and inplace editors

4 Answers 78 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Dmitry
Top achievements
Rank 1
Dmitry asked on 09 Sep 2011, 12:38 PM
Hello,
I created a custom AJAX control and try to update values in InPlace edit mode. But each time I call masterView.updateItem() function, there is no updated data in the list of new values. I use ItemCommand method and parse values like this:
if (e.CommandName == Grid.UpdateCommandName)
            {
                GridEditableItem editItem = (GridEditableItem)e.Item;
                Hashtable newValues = new Hashtable();
                editItem.ExtractValues(newValues);
            }
What should I do in my control to make new values seen by grid?
Thank you.

4 Answers, 1 is accepted

Sort by
0
Dmitry
Top achievements
Rank 1
answered on 12 Sep 2011, 12:55 PM
Hello,
Same happens when I put any control to EditItemTemplate. Are there any rules which I must follow when I put custom controls to template column to make their new values visible in ItemCommand?
0
Tsvetina
Telerik team
answered on 15 Sep 2011, 07:30 AM
Hello Dmitry,

You can directly try accessing the custom control inside the UpdateCommand event handler and take its value manually. This can be done by using the FindControl() method on your editItem object.

Kind regards,
Tsvetina
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal
0
Dmitry
Top achievements
Rank 1
answered on 15 Sep 2011, 09:55 AM
The problem is I build grid programmatically and NEVER know how many and which columns it's going to contain. So I never know which control to find. And I cannot make ItemCommand handler consist of many try/catch blocks in tries to find control I want. That would not be a good solution.
Your ExtractValues method reads some properties from common AJAX controls, and my controls are going to miss them. Everything I want to know is which properties I should apply for ExtractValues method to "see" them and read.

UPD. Just found those lines in decompiled souce code:
 Control containerControl = ((GridColumnEditorBase) editableItem.EditManager.GetColumnEditor((IGridEditableColumn) this)).ContainerControl;
      if (containerControl == null)
        return;
Looks like GetColumnEditor method cannot cast my control editor to GridColumnEditorBase and quits without collecting values from my control. Any ideas?
0
Dmitry
Top achievements
Rank 1
answered on 15 Sep 2011, 11:21 AM
Hello,
Sorry for troubling you, that was my mistake, I didn't implement IBindableTemplate.ExtractValues method.
Tags
Grid
Asked by
Dmitry
Top achievements
Rank 1
Answers by
Dmitry
Top achievements
Rank 1
Tsvetina
Telerik team
Share this question
or