locked
Run time Data Form! RRS feed

  • Question

  • hello ,

    i have a table which contains details of the form contents , here are the details

    InputType ( value = Text / Radio / CheckBox , .... )

    IsRequired ( True/False)

    OrderedAnswers ( contain options available for Radio / checkbox  )

    ....

    what i want is ,

    make a page at run time which contains respective controls and the page submits the values of each control to the service .should the page contain a dataform or what ? the required field must be checked before the contents get submitted to the web service.

    what is the way forward ?

    thanks

    Jamal.


    Tuesday, August 24, 2010 6:06 PM

All replies

  • hi,

    anyone ?

    Thursday, August 26, 2010 4:15 PM
  • Hi,

    You can create a DataForm at runtime and then add it to visual tree. You will need to add different kind of datafields based on your table's content. About the validation, please check:

    http://msdn.microsoft.com/en-us/library/cc278072%28VS.95%29.aspx#data_validation 

    Friday, August 27, 2010 2:28 AM
  • hello,

    thanks for the response .

    i know how to insert/update/delete  & validate (using DataAnnotations) items in dataform from xaml but not in codebehind.

    regarding the validation , i will annotate the model class, and dataform(which is created at run time) will do the validation.

    at this point i have created the dataform , but cant define datatemplate dynamically so that i could add stackpanel to it and in the stackpanel i shall add the controls(based on the value). can you provide some code which shall create datatemplate dynamically and items to it ?

    thanks

    Jamal.

    P.S

    also , please provide the code which shows, how will i add the dataform to the main grid. :)

    Friday, August 27, 2010 8:44 AM
  • anyone?

    Tuesday, August 31, 2010 3:32 PM