[CLOSED] how to get modelfield from RowSelectionModel?

  1. #1

    [CLOSED] how to get modelfield from RowSelectionModel?

    i want to delete the selected rows from RowSelectionModel
     protected void DeleteProduct(object sender, DirectEventArgs e)
            {
                var sr = RowSelectionModel1.SelectedRows;
                foreach (var r in sr)
                {
                    var rid = r.RecordID;//here is not the modelfield,how to get the "id" modelfield?
                    QizProduct qizProduct = _productSerice.Get(int.Parse(rid));
                    _productSerice.Delete(qizProduct);
                }
                s_products.Reload();
            }
     <ext:Store runat="server" ID="s_products" PageSize="20" OnReadData="LoadProducts">
                                <Model>
                                    <ext:Model runat="server">
                                        <Fields>
                                            <ext:ModelField Name="id"></ext:ModelField>
                                            <ext:ModelField Name="productNo"></ext:ModelField>
                                            <ext:ModelField Name="name"></ext:ModelField>
                                            <ext:ModelField Name="price_source"></ext:ModelField>
                                            <ext:ModelField Name="discount"></ext:ModelField>
                                            <ext:ModelField Name="price"></ext:ModelField>
                                            <ext:ModelField Name="ptype"></ext:ModelField>
                                            <ext:ModelField Name="QizProductType" Type="Object"></ext:ModelField>
                                        </Fields>
                                    </ext:Model>
                                </Model>
                                <Proxy>
                                    <ext:PageProxy></ext:PageProxy>
                                </Proxy>
                            </ext:Store>
    Last edited by Daniil; Feb 14, 2014 at 1:47 PM. Reason: [CLOSED]
  2. #2
    Hi @hdsoso,

    var rid = r.RecordID;//here is not the modelfield,how to get the "id" modelfield?
    But what is there? Actually, there should be an id of selected record.
    Last edited by Daniil; Feb 14, 2014 at 1:48 PM.

Similar Threads

  1. How to get ModelField Value in ComboBox
    By coder in forum 2.x Help
    Replies: 1
    Last Post: Nov 24, 2013, 2:51 AM
  2. [CLOSED] datetime format in ModelField?
    By hdsoso in forum 2.x Legacy Premium Help
    Replies: 3
    Last Post: Oct 18, 2013, 12:20 PM
  3. [CLOSED] Mapping on ModelField
    By ptrourke in forum 2.x Legacy Premium Help
    Replies: 5
    Last Post: Apr 18, 2013, 12:45 AM
  4. [CLOSED] ModelField DateFormat problem
    By mirwais in forum 2.x Legacy Premium Help
    Replies: 5
    Last Post: Mar 01, 2013, 12:40 PM
  5. ext:ModelField Mapping attribute not working
    By jbarbeau in forum 2.x Help
    Replies: 5
    Last Post: Jan 14, 2013, 10:01 AM

Posting Permissions