This is a migrated thread and some comments may be shown as answers.
Resources with Guid as ID Issue
2 Answers 27 Views
This is a migrated thread and some comments may be shown as answers.
Brian
Top achievements
Rank 2
Brian asked on 21 Feb 2014, 05:49 PM
As anybody run into a problem using a resource with a Guid as an ID. Tired following and it just doesn't work. No updates or inserts are saved.

.Resources(resource =>
            {
                resource.Add(m => m.ID)
                    .Title("Teacher")

                    .DataTextField("Text")
                    .DataValueField("Value")
                    .DataColorField("Color")
                    .BindTo(new[] { 
        new { Text = "Alex", Value = "6F727774-330A-8504-EF07-04B9FBA7FFBF", Color = "#f8a398" } ,
        new { Text = "Bob", Value = "0C47060A-6C5F-4E84-77B1-129F0AD3EFCE", Color = "#51a0ed" } ,
        new { Text = "Charlie", Value = "08254AAF-373D-EC35-167C-28EE79B01F53", Color = "#56ca85" } 
    });
            })

2 Answers, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 25 Feb 2014, 09:25 AM
Hi Brian,

I suspect that the cause for the issue is that by default Guids are serialized with lower case. However, the strings used in the resource data are upper case, thus they will not match with those serialized in the Scheduler data. The easiest way to fix this will be to set resource value to be also a Guid .

new { Text = "Alex", Value = new Guid("6F727774-330A-8504-EF07-04B9FBA7FFBF"), Color = "#f8a398" } ,
new { Text = "Bob", Value = new Guid("0C47060A-6C5F-4E84-77B1-129F0AD3EFCE"), Color = "#51a0ed" } ,
new { Text = "Charlie", Value = new Guid("08254AAF-373D-EC35-167C-28EE79B01F53"), Color = "#56ca85"}


Regards,
Rosen
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Brian
Top achievements
Rank 2
answered on 25 Feb 2014, 02:50 PM
Hi Rosen,

That did it. SiIly I missed that one.

Appreciate it.

Brian
Asked by
Brian
Top achievements
Rank 2
Answers by
Rosen
Telerik team
Brian
Top achievements
Rank 2
Share this question
or