ListViewBinding

Apr 5 2016 3:43 AM
how to solve index was out of range. must be non-negative and less than the size of
the collection?
 
protected void bindRecords()
{
Int32 ObjPrptyTypeCode = Convert.ToInt32(Session["Prpty_Type"]);
PrptyType = mf.bindListView("SELECT Code, PropertyType FROM PropertyTypeMaster where Code=" + ObjPrptyTypeCode);
TxtPrptyTypNm.Text = Convert.ToString(PrptyType.Rows[0]["PropertyType"]);
}

protected void LstVwMstrView_OnSelectedIndexChanging(object sender, ListViewSelectEventArgs e)
{
LstVwMstrView.SelectedIndex = e.NewSelectedIndex;
bindLstVwMstrView();
//Please Declare Any Lbl (LblPrptyCode) for finding the Form Fillup procedure
//And
//Declare All The TEXTBOX

Label LblPrptyCode = (Label)LstVwMstrView.Items[e.NewSelectedIndex].FindControl("LblPrptyCode");


Int32 Code = Convert.ToInt32(LblPrptyCode.Text);
Session["Prpty_Type"] = Code;

//Very much Imp CALL viewDivPnlEdit() For visibility Of EDITMODE(Edit-Delete-cancel)
bindRecords();
changeMode(true);
viewDivPnlEdit();
clearAlertMsg();


Answers (1)