Hello to everyone.
I would like to ask if someone has already implemented the DataForm using data coming from DomainDataSource using the GetTableName queries that is generated by VS.
I have managed to use it using a the DDS and display teh data, however, when i display the related data such as the country lists which is ralated from the Supplier table through a foriegn key. I am not able to display the existing/default value. But, i can click the country combo and the then the options of the country name cann be seen and displayed.
Would like to ask if someone can point me on what i am doing wrong, or what i am missing?
Thanks in advance. Here is how i am declarin the RadComboBox:
9 Answers, 1 is accepted
I have prepared a CRUD example with RadDataForm and RIA services, utilizing our new RadDomainDataSource. Please, refer to it and inform us if this approach meets your requirements.
the Telerik team
Much thanks for you code. I will try and test it within the day. Just one question, is there any way to populate the combobox using the queries that were automatically generated in the DomainServices. I noticed that you created a EmployeeID lists in the code behind to populated the combobox. What i want to do is populate the combobox using the queries in the DomainServices like GetEmployeeID.
Is that possible? I am currently trying to implement what i want to do, however, I am still unable to do so :(
Hope someone can help me and provide light on how to go about what i want to implement.
Thanks in advance :)
If you plan to use DataTemplate instead of AutoGeneration, you need place this RDDS to (Page, UserControl,...) resource block and map to ComboBox as StaticResource.
RDDS 1 - Company
CompanyStateId (foreign key to States)
RDDS 2 - States
When you want add Company you want to combobox with States, so:
ComboBox.ItemsSource = rdds2.DataView
ComboBox.DisplayMemberPath = StateName (what will be displayed in combobox)
ComboBox.SelectedValuePath = StateId (what is key in "combobox")
ComboBox.DataMemberBinding = Binding CompanyStateId, Mode=TwoWay (main data field to this ComboBox)
This is our recommended approach, when dealing with foreign key fields in RadDataForm. Of course, if this solution doesn't meet your requirements, you are free to experiment.
the Telerik team
I finally was able to have it working with some experimenting, just like what you've said. Now, I am just doing some tweeking with the DataFormCheckBoxFields. My table structure has a field name Accredited and data is saved as Y for Yes and N for No. When I tried to have it binded with the DataFormCheckBox, it does not check the box even if the data contains Y. Does the DataFormCheckBoxField only relate to Boolean? It seems to me i'll be needing a converter for this one. Once i have solved the DataFormCheckBoxFields issue, I will then now try the Add, Edit and Delete Functionality of the DataForm.
Hope you guys can help me with my CheckBox dilemma and thanks in advance once again for the help.
Since DataFormCheckBox field operates with boolean data, you should use a converter to solve this case. Please, refer to the attached project.
the Telerik team
We'll try and check the zip file you sent and then apply it with current project and we'll keep you posted.
Thanks once again. :)
I have successfully implemented DataFormCheckBox field, much thanks once again the help in the forum. Now, I have a problem when adding a new record. Basically, my scenario is am displaying a GridView and I am using a child window for the Adding and Editing of records. I am encountering NullReferenceException was Unhandled by user code when trying to add a new records and the problem is occuring in the Converter code. Its occuring at the return value.ToString() == "T" ? true : false;
Please see complete code of converter below:
The funny thing is tha the error doesnt occur when I am trying to edit an exisiting records. I think i just need to add a default value in the check box field before I call the Add process. Can someone teach me on how to assign a default value for an object in a dataform?
Hope someone can enligthen me with my problem. Again, thank in advance for the help.
Thanks again for the help given by Leos and Ivan.
Till next time :)