Form elements

7 posts, 0 answers
  1. Jacob
    Jacob avatar
    3 posts
    Member since:
    Oct 2011

    Posted 15 Feb 2012 Link to this post

    Hello,

    I use a grid inside my website. Now i want to add a upload field to this grid to upload images. And also add radio buttons.

    Is this possible? I can't find a list of supported element types.

    Regards,
    Jacob
  2. Alexander Valchev
    Admin
    Alexander Valchev avatar
    2877 posts

    Posted 20 Feb 2012 Link to this post

    Hi Jacob,

    You can use Kendo Templates to add an inputs in the grid. In the attachments you can find a demo showing this approach in action.

    Greetings,
    Alexander Valchev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Kendo UI is VS 2017 Ready
  4. Joel
    Joel avatar
    78 posts
    Member since:
    Oct 2012

    Posted 20 Feb 2012 Link to this post

    Alexander,

    Interesting use of templates there. What would be the easiest way to have a radio button item selected based on a value specified in the localData datasource? Using some form of row databound event?

    Thanks,
    Joel 
  5. Alexander Valchev
    Admin
    Alexander Valchev avatar
    2877 posts

    Posted 21 Feb 2012 Link to this post

    Hi Jacob,

    One possible solution is to use the dataBound event to read the data and implement the logic. It would be best to set the id or the name attribute of the inputs with Kendo template. Thus way it will be easier to select the radio buttons via jQuery. Please check the following example:
    var radioBtns = '<form><input id="#=Id#" class="radioBtnMale" type="radio" name="sex" value="male" /> Male<br /><input class="radioBtnFemale" type="radio" name="sex" value="female" /> Female</form>';

    I have updated the project to illustrate the approach.

    Regards,
    Alexander Valchev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  6. Joel
    Joel avatar
    78 posts
    Member since:
    Oct 2012

    Posted 22 Feb 2012 Link to this post

    Thanks Alexander ... that helps a lot!
  7. Mark
    Mark avatar
    1 posts
    Member since:
    Nov 2012

    Posted 16 Nov 2012 Link to this post

    Excellent example,
    I have difficulty adding event to Upload control,
    Do you think you could provide example how to actually upload the file.
    I am trying to modify it to have async call:

        $("#grid").kendoGrid({

            dataSource: dataSource,

            dataBound: function (e) {

                $("input[type='file']").kendoUpload({

                    async: {

                        saveUrl: "save",

                        removeUrl: "remove",

                        autoUpload: true

                    }

                    ,

                    events: {

                        upload: "onUploaded",

                        error: "onFailed"

                    }

                });

                ;



  8. jose
    jose avatar
    8 posts
    Member since:
    Apr 2012

    Posted 19 Dec 2012 Link to this post

    Really good post. From not knowing how to do it to actually implementing it in 30 minutes! Excellent!
Back to Top
Kendo UI is VS 2017 Ready