.

how to add Row in gridview with button devexpress mvc

button devexpress mvc,add Row in gridview with button devexpress mvc

to add Row in gridview with button devexpress mvc :

1- Index.cshtml


Button add Row in gridview devexpress  mvc


<div class="panel panel-primary col-lg-12">
    <div class="panel-heading">
        <h3 class="panel-title">Grid Test</h3>
    </div>
    <div class="pull-right">
        @Html.DevExpress().Button(settings =>
   {
       settings.Name = "btnNew";
       settings.Text = "New";

       settings.UseSubmitBehavior = true;
       settings.ClientSideEvents.Click = "function(s, e) { OnNewClick() }";

   }).GetHtml()

2- javascript code 


 javascript Button  add Row in gridview devexpress  mvc



@model DXWeb.Models.Home

 <script type="text/javascript">
     function OnNewClick(sender, e)
     {
       
         GridTest.AddNewRow();

     }
</script>

3- Controller:


Controller Button  add Row in gridview devexpress  mvc



 public ActionResult GridTest()
        {
            var model = db.test;
            return PartialView("_GridViewPartialTest", model.ToList());

        }


Result:


button devexpress mvc,add Row in gridview with button devexpress mvc


Labels:

Post a Comment

Emoticon
:) :)) ;(( :-) =)) ;( ;-( :d :-d @-) :p :o :>) (o) [-( :-? (p) :-s (m) 8-) :-t :-b b-( :-# =p~ $-) (b) (f) x-) (k) (h) (c) cheer
Click to see the code!
To insert emoticon you must added at least one space before the code.

The World of Technology

Contact Form

Name

Email *

Message *

Powered by Blogger.
Javascript DisablePlease Enable Javascript To See All Widget