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

RadGrid GRUD with WebService.

3 Answers 120 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Madhu
Top achievements
Rank 2
Madhu asked on 12 Mar 2009, 04:01 PM
Dear Friends,

I am new to RadControls and have minimum understanding of the same. I have been trying to learn the tricks for the last few days (5) and know a few bits.

But it seems a lot of effort will be required to have a working knowledge and I am ready to do the same.

i am trying to do something for which I could not find an appropriate solution on the net and with my basic understanding I am frustrated.

The problem is listed below with all the table structures.

CREATE TABLE [dbo].[tblRegion] (
 [AutoID] [int] NOT NULL ,
 [RegionID] [int] NOT NULL ,
 [RegionName] [nvarchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
) ON [PRIMARY]

CREATE TABLE [dbo].[tblCountry] (
 [AutoID] [int] NOT NULL ,
 [CountryID] [int] NOT NULL ,
 [CountryName] [nvarchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
 [RegionID] [int] NULL ,
 [RegionName] [nvarchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
 [TimeZone] [nchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
) ON [PRIMARY]


CREATE TABLE [dbo].[tblCity] (
 [AutoID] [int] NOT NULL ,
 [CityID] [int] NULL ,
 [CityName] [nvarchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
 [CountryID] [int] NULL ,
 [CountryName] [nvarchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
) ON [PRIMARY]

CREATE TABLE [dbo].[tblLocation] (
 [AutoID] [int] NOT NULL ,
 [LocationID] [int] NOT NULL ,
 [LocationName] [int] NOT NULL ,
 [CityID] [int] NOT NULL ,
 [CityName] [nvarchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
) ON [PRIMARY]

The heirarcy is like this Region is on the top, Country belongs to a Region, City belongs to a Country and Location belongs to the City.

We will focus only on the Country table.

My problem is as given below:

I want to use only webservices or page methods for the solution.

I want a RadGrid to display maximum 10 countries with custom paging.
i want the sorting feature only in the Region Name and Country Name not in all the columns of the table.
I want a search feature only on the Country Name column and not all columns of the table.

I want the Insert and Edit mode using templates.
For the region it should be a RadComboBox which should be able the pass the Value and Text of the RadComboBox.
Same for the Country.

All of the above feature should be achievable using only Web Services or Ajax calls.

I tried a lot to achieve the same but failed to reach anywhere.

If any of the forum member would be kind enough to give me a solution it will be a great booster to my confidence.

Thank you
Warm Regards
Madhu Menon

3 Answers, 1 is accepted

Sort by
0
Darshan
Top achievements
Rank 1
answered on 13 Mar 2009, 03:34 PM
Madhu, I was trying to do something similar and noted pretty quickly that a simple implementation of your outline does not seem possible. The help file states what the built in web service eventhandlers / properties are not supported in a hierarchical (master / detail) scenario.

So you would need to create the event handler in your page codebehind, and from there you could call a web service, but that doesn't really buy you much other that the opportunity to write / consume some reusable code that may be reused for something else.

0
Madhu
Top achievements
Rank 2
answered on 13 Mar 2009, 05:59 PM
Dear Darshan
Thanks a lot for your response.

With all the feature in the RadControls I still feel there has to be a solution. If its not possible then I feel its really painful. I really like the style and features and would like to use in all my project implementation, provided there is more support no the web service / Ajax part.  I will put in a few more days to gain better understanding, may be I will find what I am looking for.

Till then I would like to receive feedback from all the forum members on the issue.

Thank you
Madhu Menon


0
Sebastian
Telerik team
answered on 16 Mar 2009, 09:05 AM
Hi Madhu,

I think that the following online demos of the product can get you started in your implementation:

http://demos.telerik.com/aspnet-ajax/grid/examples/client/declarativedatabinding/defaultcs.aspx
http://demos.telerik.com/aspnet-ajax/grid/examples/client/databinding/defaultcs.aspx

http://demos.telerik.com/aspnet-ajax/grid/examples/client/livedata/defaultcs.aspx
http://demos.telerik.com/aspnet-ajax/controls/examples/integration/aspajaxgridapplication/defaultcs.aspx?product=grid

You may also review the relevant help articles linked under the description sections of the demos. Master/detail presentation can be attained either with client/server binding of two separate grids:

http://demos.telerik.com/aspnet-ajax/grid/examples/programming/selectedvalue/defaultcs.aspx
http://demos.telerik.com/aspnet-ajax/grid/examples/clientmasterdetails/defaultcs.aspx

or with the approach from this blog post on our site.

To enable sorting and filtering for particular columns in the grid only, set its AllowSorting/AllowFilteringByColumn properties to true and individually disable these options for some of the columns by setting their AllowSorting/AllowFiltering properties to false.

Additionally, you can use WebUserControl or FormTemplate custom edit forms for your grid if you use server-side binding with WebService:

http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/usercontroleditform/defaultcs.aspx
http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/templateformupdate/defaultcs.aspx

In case you choose client-side binding, you can edit/insert records through an external form as shown here:

http://demos.telerik.com/aspnet-ajax/grid/examples/client/insertupdatedelete/defaultcs.aspx

For more details on particular aspects of the implementation you can refer to the online examples/documentation of the product.

Kind regards,
Sebastian
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Grid
Asked by
Madhu
Top achievements
Rank 2
Answers by
Darshan
Top achievements
Rank 1
Madhu
Top achievements
Rank 2
Sebastian
Telerik team
Share this question
or