i want to add pay now button as shown in bounded Gridview in asp.net.
I have used like following
<asp:GridView ID="GridView1" runat="server" AllowPaging="True"
AutoGenerateColumns="False" DataKeyNames="ID" DataSourceID="challanstatus"
Width="646px">
<Columns>
<asp:BoundField DataField="ID" HeaderText="ID" InsertVisible="False"
ReadOnly="True" SortExpression="ID" />
<asp:BoundField DataField="RegisNo" HeaderText="RegisNo"
SortExpression="RegisNo" />
<asp:BoundField DataField="Reason" HeaderText="Reason"
SortExpression="Reason" />
<asp:BoundField DataField="Code" HeaderText="Code" SortExpression="Code" />
<asp:BoundField DataField="DateofChallan" HeaderText="DateofChallan"
SortExpression="DateofChallan" />
<asp:BoundField DataField="Status" HeaderText="Status"
SortExpression="Status" />
<asp:BoundField DataField="Amount" HeaderText="Amount"
SortExpression="Amount" />
<asp:ButtonField ButtonType="Button" CommandName="Edit" Text="Edit" Visible="True" CommandArgument='<%# Container.DataItemIndex %>' />
</Columns>
</asp:GridView>
<asp:AccessDataSource ID="challanstatus" runat="server"
DataFile="~/App_Data/Database.mdb"
SelectCommand="SELECT * FROM [tblchallan] WHERE (([RegisNo] = ?) AND ([RegisNo] = ?))">
<SelectParameters>
<asp:ControlParameter ControlID="DropDownList1" Name="RegisNo"
PropertyName="SelectedValue" Type="String" />
<asp:ControlParameter ControlID="DropDownList1" Name="RegisNo2"
PropertyName="SelectedValue" Type="String" />
</SelectParameters>
</asp:AccessDataSource>
where i use
<asp:ButtonField ButtonType="Button" CommandName="Edit" Text="Edit" Visible="True" CommandArgument='<%# Container.DataItemIndex %>' />
to insert button but it gives following error:
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: Databinding expressions are only supported on objects that have a DataBinding event. System.Web.UI.WebControls.ButtonField does not have a DataBinding event.
Ans :- to get value from row in variable
Bind button as like this
Get value of this row on OnRowCommand event like this :-
hope this helps you to get value..