Telerik Silverlight GridView ItemSource 错误

发布于 2025-01-03 03:51:37 字数 324 浏览 1 评论 0原文

所以我得到了我正在开发的这个应用程序,它有一个 Telerik Silverlight gridview。我从 Web 服务获取动态 XMl,创建一个动态对象(这是 SL 3 FYI,因此没有 system.Dynamic 或 Expandos),然后构建对象列表并将其作为 System.Collections.IEnumerable 返回。从那里我将 gridView ItemsSource 设置为我刚刚获得的上述列表。我遇到的问题是,在此列表中,它正确地包含所有列、单元格和标题,以及所有正确的信息,但在 gridview 上,任何包含 / 字符的列,单元格数据都不会显示。任何人都知道为什么会发生这种情况以及我该如何解决它?

So Ive got this application that Im working on that has a Telerik Silverlight gridview. I get dynamic XMl from a web service, create a dynamic object(this is SL 3 FYI, so no system.Dynamic or Expandos) and then build a list of the objects and return it as a System.Collections.IEnumerable. From there I set the gridView ItemsSource to the aforementioned list I just got. The problem Im having is that in this list, it has all of the columns, cells, and headers correctly, with all of the correct information, but on the gridview, any columns that contain a / character, the cell data does not get displayed. Anyone know why this might be happening and how I can get around it?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

近箐 2025-01-10 03:51:37

抱歉,我无法重现您的问题。

根据我对您问题的理解,正确的数据正在通过 Web 服务进入您的 Silverlight 应用程序,但 RadGridView 正在破坏包含 / 字符的任何数据。如果是这种情况,那么类似以下内容应该会重现该问题:

XAML(在 MainWindow.xaml 中)

    <telerik:RadGridView x:Name="grid" />

C#(MainWindow.xaml.cs 中的构造函数):

    public MainPage()
    {
        InitializeComponent();
        grid.ItemsSource = new List<KeyValuePair<string, string>>()
        {
            new KeyValuePair<string, string>("3/252/21", "1845/5649"),
            new KeyValuePair<string, string>("19//7/36/9", "14/1/469/9"),
            new KeyValuePair<string, string>("0/49/8/49", "0/1/00/2306")
        };
    }

但是,这对我来说行为正确(SL4、Telerik DLL 版本 2011.3。 1116.1040)。

如果没有看到您的代码,我们只能真正猜测您问题的可能答案。如果 Telerik RadGridView 确实正在破坏您的数据,您至少可以向我们展示代码的相关部分吗?或者更好的是,将 放在一起SSCCE 表明了这个问题?

Sorry, I couldn't reproduce your problem.

From what I understand of your question, the correct data is making its way into your Silverlight application via the web service, but the RadGridView is mangling any of your data that contains a / character. If this is the case, then something like the following ought to reproduce the problem:

XAML (in MainWindow.xaml)

    <telerik:RadGridView x:Name="grid" />

C# (constructor in MainWindow.xaml.cs):

    public MainPage()
    {
        InitializeComponent();
        grid.ItemsSource = new List<KeyValuePair<string, string>>()
        {
            new KeyValuePair<string, string>("3/252/21", "1845/5649"),
            new KeyValuePair<string, string>("19//7/36/9", "14/1/469/9"),
            new KeyValuePair<string, string>("0/49/8/49", "0/1/00/2306")
        };
    }

However, this behaves correctly for me (SL4, Telerik DLLs version 2011.3.1116.1040).

Without seeing your code we can only really guess at possible answers to your question. If the Telerik RadGridView really is mangling your data, could you at least show us the relevant parts of your code, or better yet, put together an SSCCE that demonstrates the issue?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文