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

Can a radgrid bound to webservice use autogenerated edit form?

3 Answers 70 Views
Grid
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 1
John asked on 23 Jul 2014, 08:31 AM
I created a radgrid bound to a webservice (by using ClientSettings/DataBinding). and found that I could not get the grid to go into edit mode at all. I wanted to have a grid with an edit button column, and simply click the button to popup an autogenerated edit form for that grid row, but it doesn't even attempt to open the popup or go into edit mode.

I tried a simple project where I set up a radgrid bound using another method (needdatasource) and set up the editing how I wanted it, and it all worked. But when I add markup for databinding the edit mode completely stops working.

Am I trying to achieve something impossible?

3 Answers, 1 is accepted

Sort by
0
Konstantin Dikov
Telerik team
answered on 28 Jul 2014, 07:07 AM
Hello John,

Currently, only Batch edit mode supports editing with client-side binding. You could have a look at the following online demo, where you could see and test an editable RadGrid with client-side binding through RadClientDataSource control and Batch editing:
Please let me know if you have any further questions.


Regards,
Konstantin Dikov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
John
Top achievements
Rank 1
answered on 28 Jul 2014, 09:37 AM
Thanks, I do have one further question. What I want to achieve is to have client side binding to my webservice, and use as much of the built-in functionality of the grid, so as to make my life easier. But I have not managed to achieve all of it:
If I use simple GridBoundColumns all is well, but I'd like to have a column that is the client-side equivalent of a GridDropDownColumn. I've got a field that is a foreign key to another table. It is a "category" field, so the data is numeric, and each number also has a description in the related table. I want to show the description in the grid column (which I can achieve), and sort on this by name (which I can also achieve) but the bit I can't do is that I want the column to change to a dropdown list in edit mode.
It seems that GridTemplateColumn is no good to me here because it is ignored in client-side batch edit mode. And although a gridboundcolumn has a clientitemtemplate, it has no clientedititemtemplate, so I can't get it working.
Is there any way to do what I want to do? Is there a page on your website that states all the things that you can and can't do when binding using clientsettings/databinding?



0
Konstantin Dikov
Telerik team
answered on 31 Jul 2014, 09:02 AM
Hello John,

Currently there is no such example for binding RadDropDownList/RadComboBox controls with client-side binding and batch editing.

However, please note that you will need second RadClientDataSource control for the RadDropDownList control, so it could be populated with data. Furthermore, you will need to use GridTemplateColumn, specify the ClientItemTemplate and EditItemTemplate:
<telerik:GridTemplateColumn  DataField="CategoryID">
    <ClientItemTemplate>
        #= ProductName #
    </ClientItemTemplate>                      
    <EditItemTemplate>
        <telerik:RadDropDownList ID="RadDropDownList1" runat="server" DataTextField="ProductName"
            DataValueField="ProductID" ClientDataSourceID="RadClientDataSource2" DropDownHeight="200px">
        </telerik:RadDropDownList>
    </EditItemTemplate>
</telerik:GridTemplateColumn>

Please try the above approach and see if it could work for your exact requirements.


Regards,
Konstantin Dikov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Grid
Asked by
John
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
John
Top achievements
Rank 1
Share this question
or