public void bindgrid() { objda.action = "selectcurrency"; ds = objda.ManageMaster(); int start = dgnews.PageSize * dgnews.CurrentPageIndex; int end = start + dgnews.PageSize; start = start + 1; if (end >= ds.Tables[0].Rows.Count) { end = ds.Tables[0].Rows.Count; } lblstart.Text = start.ToString(); lblend.Text = end.ToString(); lbltotalrecord.Text = ds.Tables[0].Rows.Count.ToString(); if (ds.Tables[0].Rows.Count > 0) { dgnews.DataSource = ds; dgnews.DataBind(); divnodatafound.Visible = false; dgnews.Visible = true; } else { divnodatafound.Visible = true; dgnews.Visible = false; } }
protected void bindcurrency() { objda.action = "selectcurrency"; ds = objda.ManageMaster(); if (ds.Tables[0].Rows.Count > 0) { ddlcurrency.DataTextField = "symbol"; ddlcurrency.DataValueField = "nid"; ddlcurrency.DataSource = ds; ddlcurrency.DataBind(); } ListItem li = new ListItem(); li.Text = "--Select Currency--"; li.Value = ""; ddlcurrency.Items.Insert(0, li); }
//Bind dropdown of country protected void bindcountry() { objda.action = "selectstate"; ds = objda.ManageMaster(); if (ds.Tables[0].Rows.Count > 0) { ddlcountry.DataTextField = "countryname"; ddlcountry.DataValueField = "nid"; ddlcountry.DataSource = ds; ddlcountry.DataBind(); } ListItem li = new ListItem(); li.Text = "--Select--"; li.Value = ""; ddlcountry.Items.Insert(0, li); bindstate(); }