Problems retrieving list data using DataTypeGrid using nodeType and InnerText
Hello, I'm hoping someone might have experienced the same problems I am encoutering and might be able to help with a solution.
The issue seems to arrise when I use the .nodeType and .InnerText methods from the razor examples provided here http://ucomponents.org/data-types/datatype-grid/razor-samples/ to retrieve the value of the selected list item from a dropdown datatype.
At first I used the examples with my own custom datatypes but after failing with this, I tried setting up the datatype Grid exactly how the documentation displays them.
In both scenarios, I receive the errors
'uComponents.DataTypes.DataTypeGrid.Model.GridCell' does not contain a definition for 'InnerText'
'uComponents.DataTypes.DataTypeGrid.Model.GridCell' does not contain a definition for 'nodeType'
While setting up the .cshml macro, I recieved the warning;
error CS0104: 'uQuery' is an ambiguous reference between 'umbraco.uQuery' and 'uComponents.Core.uQuery'
I tried both libraries but the errors are still present.
Thanks for responding! I am using version 5.5.4 of uComponents.
Below is the code that I am testing, it's the example from the uComponents docs and it matches what I am trying to achieve. Since I recieve the same errors for both my custom razor and the demo code, it's propbably easier to work with this version.
ok so I found a solution. I ended using some razor that is different to the examples posted in the uComponents documentation. The code below coverts the id of the dropdown list to the selected value.
var test = @row.locationsDropdown.Value; @umbraco.library.GetPreValueAsString(Convert.ToInt32(test)) <p>Update here @test</p>
Problems retrieving list data using DataTypeGrid using nodeType and InnerText
Hello, I'm hoping someone might have experienced the same problems I am encoutering and might be able to help with a solution.
The issue seems to arrise when I use the .nodeType and .InnerText methods from the razor examples provided here http://ucomponents.org/data-types/datatype-grid/razor-samples/ to retrieve the value of the selected list item from a dropdown datatype.
At first I used the examples with my own custom datatypes but after failing with this, I tried setting up the datatype Grid exactly how the documentation displays them.
In both scenarios, I receive the errors
'uComponents.DataTypes.DataTypeGrid.Model.GridCell' does not contain a definition for 'InnerText'
'uComponents.DataTypes.DataTypeGrid.Model.GridCell' does not contain a definition for 'nodeType'
While setting up the .cshml macro, I recieved the warning;
error CS0104: 'uQuery' is an ambiguous reference between 'umbraco.uQuery' and 'uComponents.Core.uQuery'
I tried both libraries but the errors are still present.
Using Umbraco Version: 4.11.10
Thanks
Hi Dafydd
What version of uComponents are you using? And do you mind sharing the full code sample?
/Jan
Hi Jan,
Thanks for responding!
I am using version 5.5.4 of uComponents.
Below is the code that I am testing, it's the example from the uComponents docs and it matches what I am trying to achieve. Since I recieve the same errors for both my custom razor and the demo code, it's propbably easier to work with this version.
The datatypes I am using match the datatypes found in this explanation http://ucomponents.org/data-types/datatype-grid/razor-samples/
I can also provide my original .cshtml code if it helps.
Many thanks :)
Sorry for the double post I was researching the forum and found a similar issue back in 2012 http://our.umbraco.org/projects/backoffice-extensions/ucomponents/questionssuggestions/34751-Multiple-Textstring-Error-'string'-does-not-contain-a-definition-for-'InnerText'
I have tried updating the DLL's using a fresh umbraco installation but still no luck :/
ok so I found a solution. I ended using some razor that is different to the examples posted in the uComponents documentation.
The code below coverts the id of the dropdown list to the selected value.
It seems so simple now...
is working on a reply...