Hi,
I have a grid view having images and text.. i used handler to display image. but after implementing the code to display image,,, autogenerated edit/delete options are not displaying
Data Fields........
mpId...int(Text),
mpName.... varchar(Text),
mpLocation... varchar (dropdown list),
mpImageF.. image ,
mpGender... varchar(radio button list)
Please Guide me how i edit and delete record in gridview
Code is ......

            //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
            //        Handler.ashx
            //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

             public void ProcessRequest (HttpContext context) {
                    string imgID = context.Request.QueryString["ID"].ToString();
                    SqlCommand cmd = new SqlCommand("Select * from MissingPerson where mpId="+imgID, con);
                    con.Open();
                    SqlDataReader Dr = cmd.ExecuteReader();
                    Dr.Read();

                    context.Response.BinaryWrite((byte[])Dr["mpImageF"]);
                    con.Close();
                }


            //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
            //        UploadedByMe.aspx
            //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
            <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" >
            <Columns>
              <asp:TemplateField HeaderText = "Id" Visible= "false">
                <ItemTemplate>
                <asp:Label ID="l" Text= '<%# Eval("mpId") %>' runat="server" />
                </ItemTemplate>
                </asp:TemplateField>

                <asp:TemplateField HeaderText = "Picture">
                <ItemTemplate>
                <img  height="100" width = "100" src="Handler.ashx?ID=<%# Eval("mpId") %>"  />
                </ItemTemplate>
                </asp:TemplateField>

                <asp:TemplateField HeaderText= "Name">
                <ItemTemplate>
                <asp:Label ID= "lblname" runat="server" Text = '<%# Eval("mpName") %>' />
                </ItemTemplate>
                </asp:TemplateField>

                <asp:TemplateField HeaderText= "Gender">
                <ItemTemplate>
                <asp:Label ID= "lbl9" runat="server" Text = '<%# Eval("mpGender") %>' />
                </ItemTemplate>
                </asp:TemplateField>

                <asp:TemplateField HeaderText= "Location" >
                <ItemTemplate >
                <asp:Label ID = "loc"  runat = "server" Text = '<%# Eval("mpLocation") %>' />
                </ItemTemplate>
                </asp:TemplateField>

                </Columns>
                </asp:GridView>
            //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
            //        UploadedByMe.aspx.cx
            //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
            protected void Page_Load(object sender, EventArgs e)
                {
                    if (!IsPostBack)
                        BindGrid();
                }
             void BindGrid()
                {
                    SqlDataAdapter da = new SqlDataAdapter("Select * from MissingPerson", con);
                    DataSet Ds = new DataSet();
                    da.Fill(Ds);
                    GridView1.DataSource = Ds;
                    GridView1.DataBind();
                }
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.