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

Weird GridDropDownColumn ListDataMember problem

4 Answers 139 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Victor Arce
Top achievements
Rank 1
Victor Arce asked on 30 Mar 2010, 01:28 AM

Guys, this might be a bug...

I searched everywhere for this topic, but it seems like im the only one. For what I understand, you can Bind a GridDropDownColumn with an objectDataSource that includes a DataSet, and then use the ListDataMember to point to the right DataTable in the DataSet... right???

Well, I get an error that says that I should leave the property empty so DefaultView can be used. After debugging for a while, I noticed that it selects the first table and its named DefaultView.

This is my code:

 
<!--DataSources-->    
<asp:ObjectDataSource ID="ObjectDataSource2" runat="server"      
 EnablePaging="false" SelectMethod="SelectCatalog"      
 TypeName="XXX.Web.Common.clCatalogs"      
 onselecting="ObjectDataSource2_Selecting">      
</asp:ObjectDataSource>      
      
<!--Column Definition-->    
<telerik:GridDropDownColumn HeaderText="Substrate" DataField="SubstrateId" DataSourceID="ObjectDataSource2" ListDataMember="catSubstrate"      
DataType="System.Int32" ListTextField="Code" ListValueField="Id" UniqueName="colSubstrate">      
</telerik:GridDropDownColumn>      
      
    
//Business Object Class     
[DataObject(true)]      
public class clCatalogs      
{     
public clCatalogs(){}      
[DataObjectMethod(DataObjectMethodType.Select, true)]      
public static DataSet SelectCatalogs()      
{     
 return (DataSet)HttpContext.Current.Cache["dsCatalogs"];      
}     
}    

 

Anybody see's anything weird? One thing tough, is that if I use DataTable as a return type it works, but im interested in DataSet.

Thanx for the help
Victor

 

4 Answers, 1 is accepted

Sort by
0
Victor Arce
Top achievements
Rank 1
answered on 30 Mar 2010, 05:04 PM
Gentleman,

I found my problem, but still I can't acomplish what I was looking for.  My mistake with ListDataMember, it that points to the Table Name in the DataSet binding the RadGrid, not the GridDropDownColumn.

Well, I need this on separate datasources. This is what I want:

1) RadGrid binds to a Business Object  (that is a collection of classes with lots of properties) ... and it works perfect.
2) At the same time, the RadGrid has GridDropDownColumns that bind a DIFFERENT Datasource, in this case, a DataSet that contain like 50 different catalogs, so I want to be able to choose which catalog with ListDataMember.

Is this possible to do?  I don't think you can mix a business object collection of classes with a dataset...

Thanx for your time guys, this is frustrating
0
Pavlina
Telerik team
answered on 02 Apr 2010, 08:02 AM
Hello Victor,

To achieve your goal you could set the DataSourceID of the GridDropDownColumn to the ID of the DataSource which will bind the DropDown to the required DataSource.

For more information on the GridDropDownColumn specifics, you may refer to the following help articles:
Column types
Customize/Configure GridDropDownColumn

Regards,
Pavlina
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Victor Arce
Top achievements
Rank 1
answered on 07 Apr 2010, 12:32 AM
Thanks for your response Pavlina. I think you got the wrong idea of what Im trying to do.

Im basically trying to point each DropDownColumn to a different DataTable of the DataSet (ObjectDataSouce).. any ideas?

0
Pavlina
Telerik team
answered on 12 Apr 2010, 01:48 PM
Hello Victor,

Try setting the DataSourceID to the required ObjectDataSource ID and the ListDataMember property to the name of the particular DataTable.

If the issue still persists, please open a formal support ticket and send us a simple working application with reproduced this erroneous behavior. Thus I could help you further in resolving it.

Kind regards,
Pavlina
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Grid
Asked by
Victor Arce
Top achievements
Rank 1
Answers by
Victor Arce
Top achievements
Rank 1
Pavlina
Telerik team
Share this question
or