Hi There,
I am binding DataTable.DefaultView to RadGridView and I have column in the datatable named "a.b", which appears blank in RadGridView. Also grouping by it will generate an exception saying "property a doesn't exist in DataRowView". Is there a way to tweak the binding so column "a.b" would work?
Thanks,
Ke
I am binding DataTable.DefaultView to RadGridView and I have column in the datatable named "a.b", which appears blank in RadGridView. Also grouping by it will generate an exception saying "property a doesn't exist in DataRowView". Is there a way to tweak the binding so column "a.b" would work?
Thanks,
Ke
8 Answers, 1 is accepted
0
Hello Ke,
Binding to properties like "a.b" should work find and the values should be resolved from the binding. If it is different at your side, may I ask you to test the same with the MS DataGrid?
As to grouping on such a property - this is not supported as a property name starting with a dot is not a valid name in .Net Framework.
Regards,
Didie
Telerik
Binding to properties like "a.b" should work find and the values should be resolved from the binding. If it is different at your side, may I ask you to test the same with the MS DataGrid?
As to grouping on such a property - this is not supported as a property name starting with a dot is not a valid name in .Net Framework.
Regards,
Didie
Telerik
Check out the new Telerik Platform - the only modular platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native apps. Register for the free online keynote and webinar to learn more about the Platform on Wednesday, February 12, 2014 at 11:00 a.m. ET (8:00 a.m. PT).
0
Ke
Top achievements
Rank 1
answered on 17 Feb 2014, 07:48 PM
Hi There,
We are not bound the column to a property "a.b", but there is a column named "a.b" in the datatable. It works fine binding to the datatable directly(both grouping and data display works), but when we bind RadGridView with dataTable.DefaultView, it stops working complaining about "property a doesn't exist in DataRowView".
We are not bound the column to a property "a.b", but there is a column named "a.b" in the datatable. It works fine binding to the datatable directly(both grouping and data display works), but when we bind RadGridView with dataTable.DefaultView, it stops working complaining about "property a doesn't exist in DataRowView".
0
Hello,
I can still not observe the issue at my end. Please find attached a test solution I created in my attempt to reproduce the problem.
Would you please modify it to illustrate your setup?
Regards,
Didie
Telerik
I can still not observe the issue at my end. Please find attached a test solution I created in my attempt to reproduce the problem.
Would you please modify it to illustrate your setup?
Regards,
Didie
Telerik
0
Ke
Top achievements
Rank 1
answered on 18 Feb 2014, 03:40 PM
Hi Didie,
Attached is the screenshot of running your example. We are using version 2013.3.1016.40. Is it fixed in later versions?
Thanks,
Ke
Attached is the screenshot of running your example. We are using version 2013.3.1016.40. Is it fixed in later versions?
Thanks,
Ke
0
Ke
Top achievements
Rank 1
answered on 19 Feb 2014, 05:53 PM
Hi Didie,
So for grouping we did some digging and found the code below in your dlls, so if you could just add DataRowView like you did with DataRow, then grouping/aggregates by columns with dots in their names(a.b) will work. Can you help check if this can be fixed in your next release? Thanks!
namespace Telerik.Windows.Data.Expressions
{
internal static class ExpressionBuilderFactory
{
public static MemberAccessExpressionBuilderBase MemberAccess(Type elementType, Type memberType, string memberName)
{
memberType = memberType ?? typeof(object);
if (elementType.IsCompatibleWith(typeof(DataRow)))
{
return new DataRowFieldAccessExpressionBuilder(memberType, memberName);
}
if (elementType.IsCompatibleWith(typeof(ICustomTypeDescriptor)))
{
return new CustomTypeDescriptorPropertyAccessExpressionBuilder(elementType, memberType, memberName);
}
if (elementType.IsCompatibleWith(typeof(XmlNode
)))
{
return new XmlNodeChildElementAccessExpressionBuilder(memberName);
}
if (elementType.IsDynamic())
{
return new DynamicPropertyAccessExpressionBuilder(elementType, memberName, memberType);
}
return new PropertyAccessExpressionBuilder(elementType, memberName, memberType);
}
public static MemberAccessExpressionBuilderBase MemberAccess(IQueryable source, Type memberType, string memberName)
{
MemberAccessExpressionBuilderBase objectsProvider = ExpressionBuilderFactory.MemberAccess(source.ElementType, memberType, memberName);
objectsProvider.Options.LiftMemberAccessToNull = source.Provider.IsLinqToObjectsProvider();
return objectsProvider;
}
}
}
So for grouping we did some digging and found the code below in your dlls, so if you could just add DataRowView like you did with DataRow, then grouping/aggregates by columns with dots in their names(a.b) will work. Can you help check if this can be fixed in your next release? Thanks!
namespace Telerik.Windows.Data.Expressions
{
internal static class ExpressionBuilderFactory
{
public static MemberAccessExpressionBuilderBase MemberAccess(Type elementType, Type memberType, string memberName)
{
memberType = memberType ?? typeof(object);
if (elementType.IsCompatibleWith(typeof(DataRow)))
{
return new DataRowFieldAccessExpressionBuilder(memberType, memberName);
}
if (elementType.IsCompatibleWith(typeof(ICustomTypeDescriptor)))
{
return new CustomTypeDescriptorPropertyAccessExpressionBuilder(elementType, memberType, memberName);
}
if (elementType.IsCompatibleWith(typeof(XmlNode
)))
{
return new XmlNodeChildElementAccessExpressionBuilder(memberName);
}
if (elementType.IsDynamic())
{
return new DynamicPropertyAccessExpressionBuilder(elementType, memberName, memberType);
}
return new PropertyAccessExpressionBuilder(elementType, memberName, memberType);
}
public static MemberAccessExpressionBuilderBase MemberAccess(IQueryable source, Type memberType, string memberName)
{
MemberAccessExpressionBuilderBase objectsProvider = ExpressionBuilderFactory.MemberAccess(source.ElementType, memberType, memberName);
objectsProvider.Options.LiftMemberAccessToNull = source.Provider.IsLinqToObjectsProvider();
return objectsProvider;
}
}
}
0
Hi Ke,
You are right. Such a Binding is not supported with the latest version.
I apologize for misleading you. I am afraid currently I cannot suggest you a workaround.
I have forwarded your feedback to the development team.
Regards,
Didie
Telerik
You are right. Such a Binding is not supported with the latest version.
I apologize for misleading you. I am afraid currently I cannot suggest you a workaround.
I have forwarded your feedback to the development team.
Regards,
Didie
Telerik
0
Thomas
Top achievements
Rank 1
answered on 10 Dec 2015, 03:22 PM
Are there any solution for this?
0
Hello Thomas,
The issue hasn't been fixed at this point, but we'll try to resolve it for one of our upcoming releases. I created a public item where you can track the team's progress, you can subscribe to it here.
Regards,
Petya
Telerik
The issue hasn't been fixed at this point, but we'll try to resolve it for one of our upcoming releases. I created a public item where you can track the team's progress, you can subscribe to it here.
Regards,
Petya
Telerik
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 Feedback Portal
and vote to affect the priority of the items