PDA

View Full Version : [CLOSED] how to get modelfield from RowSelectionModel?



hdsoso
Feb 08, 2014, 11:23 AM
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>

Daniil
Feb 10, 2014, 7:08 AM
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.