Getting the Id of the selected row in the Grid with the Button in my Mvc Project and routing

  1. #1

    Getting the Id of the selected row in the Grid with the Button in my Mvc Project and routing

    X.Panel()
                    .ID("South")
                    .Region(Region.South)
                    .Title("Hasta Listesi")
                    .Frame(true)
                    .Height(375)
                    .Collapsible(true)
                     .Layout(LayoutType.Form)
                    .ItemsFromPage(this, "~/Views/Istatistik/AltListe.cshtml")
    AltList.cshtml I want to get the Id of the selected row in the Grid panel in Partial View and process it. I'm new to Mvc Ext.net, can you please help.

    
      Html.X().GridPanel()
                    .ID("PersonelGrid")
                    .Width(1520)
                    .Height(300)
                    .SelectionModel(X.RowSelectionModel().Mode(SelectionMode.Single).ID("RowSelectionModel1").SelectedIndex(0))
                    .ForceFit(true).Store(Html.X().Store()
            .DataSource(Model)
            .ID("Store1")
            .Model(Html.X().Model()
            .Fields(
            new ModelField("Id"),
            new ModelField("Adi"),
            new ModelField("Soyadi"),
            new ModelField("Tel"),
            new ModelField("Mail"),
            new ModelField("Sehir"),
            new ModelField("Departman"),
            new ModelField("Aciklama"),
            new ModelField("Aktif", ModelFieldType.Boolean)
            )))
                    .ColumnModel(
            X.Column().Text("Id").DataIndex("Id").Hidden(true),
            X.Column().Text("Adi").DataIndex("Adi"),
            X.Column().Text("Soyadi").DataIndex("Soyadi"),
            X.Column().Text("Tel").DataIndex("Tel"),
            X.Column().Text("Mail").DataIndex("Mail"),
            X.Column().Text("Sehir").DataIndex("Sehir"),
            X.Column().Text("Departman").DataIndex("Departman"),
            X.Column().Text("Aciklama").DataIndex("Aciklama")
                     )
                    .BottomBar(Html.X().PagingToolbar().StoreID("Store1").HideRefresh(false)
                     .Items(X.Toolbar().Items(
                     X.Button()
                    .Text("Tüm Listeyi Yazd?r")
                    .IconCls("add32")
                    .Icon(Icon.Printer)
                    .Region(Region.East)
               )))
                    )
    ------------------------------------------Index.cshtml
    I want to get the id of the selected row with the button on the panel.

    
     X.Panel()
                                .Title("Hasta ??lemleri")
                                .Frame(true)
                                .Padding(0)
                                .Height(300)
                                .Width(100)
                                .Items(X.Toolbar()
                                   .Layout(LayoutType.Column)
                                .Items(
                                 X.Button().Scale(ButtonScale.Large)
                    .Text("Muayene Ba?lat")
                    .IconCls("add32")
                    .IconUrl("/Content/images/muayene_32.png")
                    .IconAlign(IconAlign.Top)
                     .Height(60)
                     .Width(100)
                    .DirectEvents
                            (de =>
                            {
                                de.Click.Action = "Submit";
                                de.Click.EventMask.ShowMask = true;
                                de.Click.ExtraParams.Add(new Parameter()
                                {
                                    Name = "selection",
                                    Value = "App.PersonelGrid.getSelectionSubmit().getSelectionModelField().getValue()",
                                    Mode = ParameterMode.Raw
                                
                                });
    
                            }
                            )
    I'm new to Mvc.Ext.net. Can you please help me on how to do it. I have reviewed the relevant examples. but I could not reach the result. "App.PersonelGrid.getSelectionSubmit().getSelectio nModelField().getValue()", I can get the index of the selected row with this method. But I could not get the id of the relevant row. thanks
    Last edited by alioksuzoglu; Apr 16, 2022 at 9:03 AM.

Similar Threads

  1. Routing based on Culture(language) selected
    By sunshineenterprises in forum 2.x Help
    Replies: 1
    Last Post: Jul 21, 2014, 1:27 PM
  2. Selected GridPanel row value on click of a button
    By rashidsiddique in forum 2.x Help
    Replies: 1
    Last Post: Jun 19, 2014, 8:56 AM
  3. [CLOSED] Grid panel selected row cout check-MVC
    By matrixwebtech in forum 2.x Legacy Premium Help
    Replies: 3
    Last Post: Jun 11, 2014, 2:00 PM
  4. Replies: 8
    Last Post: Sep 06, 2013, 7:09 PM
  5. MVC Grid Panel pass selected row cell value
    By OriCoder in forum 2.x Help
    Replies: 2
    Last Post: Jun 03, 2013, 3:09 AM

Tags for this Thread

Posting Permissions