my grid view
i just want to show this data in a modal popup
i trying to bind data field vales in a popup
popup is displaying but data fileds are not displaying help me pls
this is my pop up but values are not binding

protected void ddlshowtop_SelectedIndexChanged(object sender, EventArgs e)
{
lblBenName.Text = (grdvwMerchantBanks.SelectedRow.FindControl("BeneficiaryName") as TextBox).Text;
lblbnkName.Text = (grdvwMerchantBanks.SelectedRow.FindControl("BankName") as Label).Text;
lblBacNum.Text = (grdvwMerchantBanks.SelectedRow.FindControl("AccountNumber") as Label).Text;
lblIfsc.Text = (grdvwMerchantBanks.SelectedRow.FindControl("IFSC") as Label).Text;
lblNaPp.Text = (grdvwMerchantBanks.SelectedRow.FindControl("NameAsPerBank") as Label).Text;
Mpe.Show();
}
protected void lnkDetails_Click(object sender, EventArgs e)
{
}
protected void grdvwMerchantBanks_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName.Equals("Select"))
{
Mpe.Show();
int index = Convert.ToInt32(e.CommandArgument);
GridViewRow row = grdvwMerchantBanks.Rows[index];
ImageButton ImageButton1 = (ImageButton)row.FindControl("imagepop");
}
}
Jaya PrakashPosted Apr 29, 2023, 8:29 AM
not working bro
Rajkiran SwainPosted Apr 28, 2023, 1:24 PM
It seems that you are trying to show data from a grid view in a modal popup, but the data fields are not binding properly. Based on the code you provided, it seems that you are trying to access the data fields using the FindControl method, but the controls are not being found.
Here are a few things you can try to resolve this issue:
Check if the grid view is being properly bound with data. If the data is not being bound, then the controls will not be found.
Make sure that the data fields are actually present in the grid view. You can check this by looking at the column names in the grid view.
Check if the controls are being created with the correct IDs. You can do this by inspecting the HTML source code of the rendered page.
Try using the DataKeys property of the grid view to access the data fields. Here's an example: