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

Upload inside grid

0 Answers 34 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Chuong
Top achievements
Rank 1
Chuong asked on 14 Aug 2014, 05:40 AM
Hi,

I have a grid which is bound to a list of viewmodels. When creating a record I want to upload an image as well. Following is my VM.

public class ClientModel : IClientModel
    {
        [ScaffoldColumn(false)]
        public int ClientID { get; set; }
 
        [Required]
        [DisplayName("Client Name")]
        public string Name { get; set; }
 
        [UIHint("_ClientHeaderImage")]
        public string HeaderImage { get; set; }
                 
        public bool IsActive { get; set; }
 
        private string _status;
                 
        public string Status
        {
            get
            {
                _status = IsActive ? "Enabled" : "Disabled";
                return _status;
            }
            set { _status = value; }
        }
 
    }

For the HeaderImage  property I need an upload control. So I have defined an editor template for it.

@(Html.Kendo().Upload()
    .Name("HeaderImage")
)

When I go in to Create record the upload control displays fine. The problem is

1. How can I grab the uploaded files from the Action Method?
2. How to restrict the files to .png and jpg for Kendo().Upload()


Thanks!!

No answers yet. Maybe you can help?

Tags
Grid
Asked by
Chuong
Top achievements
Rank 1
Share this question
or