private void BindRepeater() { rWeightLimits.DataSource = WeightLimits.OrderBy(item => item.Amount); rWeightLimits.DataBind(); rDistanceLimits.DataSource = DistanceLimits.OrderBy(item => item.Amount); rDistanceLimits.DataBind(); }
protected void rWeightLimits_Delete(object sender, RepeaterCommandEventArgs e) { var w = WeightLimits.OrderBy(x => x.Amount).ToList(); w.RemoveAt(e.CommandArgument.ToString().TryParseInt()); WeightLimits = w; BindRepeater(); }
protected void btnAdd_Click(object sender, EventArgs e) { WeightLimits.Add(new ShippingByRangeWeightAndDistance.WeightLimit() { Amount = txtAmount.Text.TryParseFloat(), Price = txtPrice.Text.TryParseFloat(), PerUnit = chbShippingPerUnit.Checked, }); BindRepeater(); txtAmount.Text = ""; txtPrice.Text = ""; chbShippingPerUnit.Checked = false; }