remove row from temporary gridview
I have a gridview which stores temporary data. but I want to remove row by auto generated delete button. SO how to do it, plz suggest me some solutions.
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
korskor .Posted Sep 18, 2014, 6:00 PM
shibasankar beheraPosted Sep 17, 2013, 4:06 AM
if (dr["Item_ID"] == id),, this line m getting error, showing
possible unintended reference comparision;to get a value comparision, cast the left hand side to type string
Iftikar HussainPosted Sep 17, 2013, 3:32 AM
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" EnableViewState="true" Inherits="WebApplication1.WebForm1" %>
shibasankar beheraPosted Sep 17, 2013, 3:17 AM
give me some other solutions.
Iftikar HussainPosted Sep 17, 2013, 1:59 AM
object temp=sender;
DataTable dt= GridViewItemlist.DataSource as DataTable;
GridViewItemlist.DataSource = dt;
shibasankar beheraPosted Sep 17, 2013, 1:55 AM
Iftikar HussainPosted Sep 17, 2013, 1:52 AM
shibasankar beheraPosted Sep 17, 2013, 1:47 AM
here is my child grid view below
EmptyDataText="No Records Selected" Style="width: 263px;" RowStyle-CssClass="Row"
AlternatingRowStyle-CssClass="AltRow">
Iftikar HussainPosted Sep 17, 2013, 1:44 AM
shibasankar beheraPosted Sep 17, 2013, 1:42 AM
I am getting the data from GridViewItemSrch(gridview) by checkbox and setting to new gridview(GridViewItemlist).
Iftikar HussainPosted Sep 17, 2013, 1:34 AM
Regards,
Iftikar
shibasankar beheraPosted Sep 17, 2013, 1:30 AM
Object reference not set to an instance of an object.
Line 220: LinkButton lnkRemove = (LinkButton)sender; Line 221: string id = lnkRemove.CommandArgument; Line 222: for (int i = dt.Rows.Count - 1; i >= 0; i--) Line 223: { Line 224: DataRow dr = dt.Rows[i];Iftikar HussainPosted Sep 17, 2013, 1:11 AM
in your code
DataTable dt= GridViewItemlist.DataSource as DataTable;
GridViewItemlist.DataSource = dt;
Regards,
Iftikar
shibasankar beheraPosted Sep 17, 2013, 12:51 AM
i am storing the data from another gridview to this gridview. And my gridview aspx page is--
Iftikar HussainPosted Sep 17, 2013, 12:46 AM
Please provide the code for binding your gridview.
Regards,
Iftikar