just write itemcommand event of listview
if (e.Item.ItemType == ListViewItemType.DataItem)
{
Label lblId = (Label)e.Item.FindControl("lblId");
Label lblName = (Label)e.Item.FindControl("lblName");
Label lblCode = (Label)e.Item.FindControl("lblCode");
Label lblContactAddres1 = (Label)e.Item.FindControl("lblContactAddres1");
Label lblContactAddres2 = (Label)e.Item.FindControl("lblContactAddres2");
Label lblNationality = (Label)e.Item.FindControl("lblNationality");
Label lblMobile = (Label)e.Item.FindControl("lblMobile");
Label lblCity = (Label)e.Item.FindControl("lblCity");
Label lblFax = (Label)e.Item.FindControl("lblFax");
Label lblEmail = (Label)e.Item.FindControl("lblEmail");
Label lblRemarks = (Label)e.Item.FindControl("lblRemarks");
Label lblPhoto = (Label)e.Item.FindControl("lblPhoto");
Label lblAccountLedgerID = (Label)e.Item.FindControl("lblAccountLedgerID");
Label lblAreaID = (Label)e.Item.FindControl("lblAreaID");
Label lblProvinceID = (Label)e.Item.FindControl("lblProvinceID");
Label lblPriceCategoryID = (Label)e.Item.FindControl("lblPriceCategoryID");
Label lblPhone = (Label)e.Item.FindControl("lblPhone");
Session["CustomerPhoto"] = lblPhoto.Text;
Session["CustomerOrVendorID"] = lblId.Text;
switch (e.CommandName)
{
case "Edit":
{
ClearDataOfControls();
// For User Permission ( Security Module Use)
// OperationMode = "Edit";
_OperationMode = "E";
// For User Permission ( Security Module Use)
lblFunction.Text = "[ EDIT ]";
txtCustomerName.Text = lblName.Text;
txtAddress1.Text = lblContactAddres1.Text;
txtAddress2.Text = lblContactAddres2.Text;
txtCity.Text = lblCity.Text.Trim();
txtCustomerCode.Text = lblCode.Text.Trim();
txtEmail.Text = lblEmail.Text.Trim();
txtFax.Text = lblFax.Text.Trim();
txtMobile.Text = lblMobile.Text.Trim();
txtRemarks.Text = lblRemarks.Text.Trim();
txtPhone.Text = lblPhone.Text.Trim();
ddlAccountLedger.SelectedValue = lblAccountLedgerID.Text;
ddlArea.SelectedValue = lblAreaID.Text;
ddlListPrice.SelectedValue = lblPriceCategoryID.Text;
ddlProvince.SelectedValue = lblProvinceID.Text;
ddlNationality.SelectedValue = lblNationality.Text;
mpeCustomer.Show();
break;
}
}
}
Priti2010, if this helps please login to Mark As Answer. | Alert Moderator