We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
Hi,
I added the CommandArgument='<%# ((GridViewRow) Container).RowIndex %>'. But it is still not firing Grid_RowCommand.
How can we display the error in the catch block,it's not entering into try block.
ViewState is enabled.
I changed the link button from template column to buttonfield in the .aspx page.Now the row command is firing.How to access the button filed in the row command.
I tried the following.
<asp:ButtonField runat="server" ButtonType="Link" headerText="Amount" datatextfield="AMOUNT" CommandName="Select" />
I added the CommandArgument='<%# ((GridViewRow) Container).RowIndex %>'. But it is still not firing Grid_RowCommand.
How can we display the error in the catch block,it's not entering into try block.
ViewState is enabled.
I changed the link button from template column to buttonfield in the .aspx page.Now the row command is firing.How to access the button filed in the row command.
I tried the following.
<asp:ButtonField runat="server" ButtonType="Link" headerText="Amount" datatextfield="AMOUNT" CommandName="Select" />
protected void Grid_RowCommand(object sender, GridViewCommandEventArgs e)
{
GridView grd = (GridView)sender;
try
{
int iRowIndex = Convert.ToInt32(e.CommandA
switch (grd.ID.ToString())
{
case "grd1":
{
int index = Convert.ToInt32(e.CommandA
GridViewRow mySelectedRow = (GridViewRow)grdTrans.Rows
txtAmount.Text = ((LinkButton)mySelectedRow
txtType.Text = ((TextBox)mySelectedRow.Fi
txtDate.Text = ((TextBox)mySelectedRow.Fi
txtDate.Text = grd1.Rows[iRowIndex].Cells
txtAmount.Text = lnk.Text.Trim();
txtType.Text = grdTrans.Rows[iRowIndex].C
break;
}
}
}
catch (Exception ex)
{
string s = ex.Message;
}
finally
{
}
}
I am getting the argumentoutofrange exception.
How to access the selected row in gridview row command and button filed in the selected row.
Thanks