This is a migrated thread and some comments may be shown as answers.

Add Button Automatically Disabled

9 Answers 132 Views
DataForm
This is a migrated thread and some comments may be shown as answers.
Matt Leeds
Top achievements
Rank 1
Matt Leeds asked on 09 May 2011, 03:35 PM
I have a custom template on a SilverLight Rad Data Form.  It utilizes the attribute "ItemsSource" in the markup for the control, and is properly populating.  However, the 'Add' button is disabled, and this is undesired.  The edit and delete buttons remain enabled.

Thinking that it could have something to do with the custom template, I have turned it off, and enabled autoGenerateFields.  This does not help.

9 Answers, 1 is accepted

Sort by
0
Pavel Pavlov
Telerik team
answered on 09 May 2011, 03:52 PM
Hello Matt Leeds,

Usually the add button is disabled , when the source collection does not allow adding items.
Please share some info - what type of collection do you use as ItemsSource for RadDataForm. I am sure we can think of some solution here .

Regards,
Pavel Pavlov
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
0
Matt Leeds
Top achievements
Rank 1
answered on 09 May 2011, 04:22 PM
It uses an object of type "ObservableCollection".  That is:

ObservableCollection<MyApplication.CoreService.AssetCommentsContainer>

Where "AssetCommentsContainer" is a custom object.
0
Vlad
Telerik team
answered on 09 May 2011, 04:24 PM
Hello,

 Do you have parameterless constructor for this type (AssetCommentsContainer)?

Best wishes,
Vlad
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
0
Matt Leeds
Top achievements
Rank 1
answered on 09 May 2011, 04:26 PM
No, it has one constructor, which takes the type "System.Data.DataRow".
0
Accepted
Vlad
Telerik team
answered on 09 May 2011, 04:28 PM
Hi,

 In this case automatic add will not work. You need to provide parameterless constructor.

Greetings,
Vlad
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
0
Matt Leeds
Top achievements
Rank 1
answered on 09 May 2011, 04:34 PM
I have now added a parameterless constructor, but this did not enable the add button.  I also tried getting rid of the parameterized constructor, so that there was only the parameterless one, also with no luck.
0
Pavel Pavlov
Telerik team
answered on 09 May 2011, 04:52 PM
Hi Matt ,

It seems there is some confusion here. I have noticed that this post is under the Silverlight section  (RadDataForm for Silverlight) . Yet you mention System.Data.DataRow which I believe is not present in Silverlight.

To avoid further confusion , I may suggest you the following - can you send me your project ( or a smaller version of it which exposes the issue ) . An alternative  would be to specify which platform ( WPF or Silverlight) are you using and paste me the implementation of your objects and the the way they are fed to RadDataForm(c# /XAML)   so I can reproduce the problem here.

Regards,
Pavel Pavlov
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
0
Matt Leeds
Top achievements
Rank 1
answered on 09 May 2011, 05:51 PM
We have a library which instantiates the custom objects which are fed to the the Silverlight part of the application.  These libraries do have access to the System.Data namespace.

We do have a different page where the the RadDataForm Add button is working.  It has a very similar custom object fed to the control in a very similar way which does have the parameterized constructor accepting the DataRow and does not have a parameterless constructor at all.  I am having difficulty determining what critical thing is different between these two Silverlight RadDataForms and / or the objects that are supporting them.  If you can tell me the precise requirements for objects that are intended to support the full functionality of the RadDataForm, I can make certain that our objects comply.  If there are other factors which influence when the add button is enabled, this would be useful to know as well.  In addition, is there a way to simply turn the add button on programmatically?

Perhaps there is some more technical documentation than that which I have found so far?

I do not know for certain, but I don't think I can send our project to you.
0
Matt Leeds
Top achievements
Rank 1
answered on 09 May 2011, 06:46 PM
I apologize:  The parameterless constructor is working after all.  Too much to explain why I missed applying this in the correct spot, but it does work.  I will mark that answer as the correct one.

Thank you.
Tags
DataForm
Asked by
Matt Leeds
Top achievements
Rank 1
Answers by
Pavel Pavlov
Telerik team
Matt Leeds
Top achievements
Rank 1
Vlad
Telerik team
Share this question
or