protected void commentsR_SelectedIndexChanging(object sender, ListViewSelectEventArgs e)
{
string comid = "";
Button edit = (commentsR.Items[e.NewSelectedIndex].FindControl("duzenleC")) as Button;
Label lbl = (commentsR.Items[e.NewSelectedIndex].FindControl("commentID")) as Label;
if (lbl != null)
comid = lbl.Text;
string SelectQuery = "SELECT * FROM comments C, users U WHERE C.ID = @comid AND C.userID = @userid";
cn.Open();
MySqlCommand com = new MySqlCommand(SelectQuery, cn);
com.Parameters.AddWithValue("@comid", comid);
com.Parameters.AddWithValue("@userid", userid);
dr = com.ExecuteReader();
if(dr.Read())
{
edit.Visible = true;
}
else
{
edit.Visible = false;
}
cn.Close();
commentsR.EditIndex = -1;
commentsR.DataSource = GetEmployee();
commentsR.DataBind();
}
Listview içerisindeki butonu gizlemek istiyorum fakat başarılı olmuyor bir türlü.
Tecrübeli arkadaşlar yardım ederse sevinirim.