Hi ... I face a Medias table contains the Url column, I wanna change the UIHint attribute depend on the album types: Audio, Video or Image. Is there a way to change the attribute value at runtime. I solve the issue using switch visiblity of the controls
in the same FieldTemplate, but i'm lookng for better solution if it's possible ..
I solve the issue using switch visiblity of the controls in the same FieldTemplate, but i'm lookng for better solution if it's possible ..
Hi,
First many thanks for sharing us a nice solution!
Then if you wanna dynamically change the Attribute……Hum, As far as I see, Because dynamic data has been totally fixed and there's a complicated function to analyze and reflect the whole Attributes, I'm afraid it's hard to do to cope with that.
I find a way to add attributes in the entities at runtime then register them in Global.asax, but I tried a lot to do the same thing in the code behind with no luck!! coz in the Application_Start dynamic data scaffold the entities and reflect the whole attributes
..
I 'll struggle to come up with a better solution ..
Hisham.NET
Participant
1794 Points
460 Posts
Change the UIHint for a column at runtime
Dec 24, 2012 12:47 AM|LINK
Hi ... I face a Medias table contains the Url column, I wanna change the UIHint attribute depend on the album types: Audio, Video or Image. Is there a way to change the attribute value at runtime. I solve the issue using switch visiblity of the controls in the same FieldTemplate, but i'm lookng for better solution if it's possible ..
Decker Dong ...
All-Star
118619 Points
18779 Posts
Re: Change the UIHint for a column at runtime
Dec 25, 2012 12:08 AM|LINK
Hi,
First many thanks for sharing us a nice solution!
Then if you wanna dynamically change the Attribute……Hum, As far as I see, Because dynamic data has been totally fixed and there's a complicated function to analyze and reflect the whole Attributes, I'm afraid it's hard to do to cope with that.
Hisham.NET
Participant
1794 Points
460 Posts
Re: Change the UIHint for a column at runtime
Dec 25, 2012 10:49 AM|LINK
Thank Decker ..
I find a way to add attributes in the entities at runtime then register them in Global.asax, but I tried a lot to do the same thing in the code behind with no luck!! coz in the Application_Start dynamic data scaffold the entities and reflect the whole attributes ..
I 'll struggle to come up with a better solution ..
Hisham.NET
Participant
1794 Points
460 Posts
Re: Change the UIHint for a column at runtime
Dec 25, 2012 01:21 PM|LINK
Finally I did it ..
I Declare the DynamicFiled inside List page and set the UIHint property using inline condition, problem solved!!
Decker Dong ...
All-Star
118619 Points
18779 Posts
Re: Change the UIHint for a column at runtime
Dec 26, 2012 12:19 AM|LINK
Congratulation to share your problem solution!
I'll close your issue, if anything urgent, please feel free to feedback.
sjnaughton
All-Star
27320 Points
5459 Posts
MVP
Re: Change the UIHint for a column at runtime
Dec 27, 2012 09:42 AM|LINK
Hi Hisham, good solution I was going to say you would be best usign a custom page.
Always seeking an elegant solution.
Hisham.NET
Participant
1794 Points
460 Posts
Re: Change the UIHint for a column at runtime
Dec 28, 2012 09:17 PM|LINK
Hi sjnaughton ...
Also I solve it by creating a simple condition in the EntityTemplate ..