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

How to do content-based automatic sizing and datasource of grid as generic list

1 Answer 37 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Santhosh Kumar
Top achievements
Rank 1
Santhosh Kumar asked on 13 Aug 2008, 03:59 PM
Hello,

I have two questions.

  1. Can any one please tell me how do I do the content-based automatic sizing in radgridview?
  2. How can I set the datasource of grid as generic list or list?
            I tried to set a list as datasource which is returned from webservice and it doesnt show me any results. If I change the datasource to dataset then It shows me the results.

Example:

rad_grid_Interaction_View.DataSource = SelectMyFollowups(request);

Code for SelectMyFollowups:

Public Function SelectMyFollowups(ByVal request As SelectMyFollowupsRequest) As InteractionViewSimpleResponse
Try
Return peer.SelectMyFollowups(request)
Catch ex As Exception
log.Error(ex)
Throw ex
End Try
End Function
the return set InteractionViewSimpleResponse is a list called InteractionViewSimpleResponse. If I do this I dont get any results shown in grid.

If I change the return set of the method to dataset as shown below, then I am able to see results.

Public Function SelectMyFollowups(ByVal request As SelectMyFollowupsRequest) As dataset
Try
Return peer.SelectMyFollowups(request)
Catch ex As Exception
log.Error(ex)
Throw ex
End Try
End Function

Your help is very much appreciated.

1 Answer, 1 is accepted

Sort by
0
Jack
Telerik team
answered on 14 Aug 2008, 09:23 AM
Hi Santhosh Kumar,

Thank you for contacting us.

Regarding your questions:

  1. You could turn the automatic row sizing by setting the AutoSizeRows property to true. At the moment this functionality is quite limited. Nevertheless, this is a priority task for us and we will extend it in our upcoming releases.
  2. RadGridView supports all IList data sources that are supported by MS DataGridView. This also includes generic lists. There is no need to do anything more that to set the DataSource property. Please, could you send me a sample application that requests this web service and give more details about your data source. This will help me investigate the issue and find a solution for you.
Thank you in advance for your cooperation.

Sincerely yours,
Jack
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
GridView
Asked by
Santhosh Kumar
Top achievements
Rank 1
Answers by
Jack
Telerik team
Share this question
or