prabu thiru

prabu thiru

  • NA
  • 4
  • 6.4k

Grid view button Issue

Apr 11 2011 1:42 AM
 

Hi,
Before Web Hosting
-----------------------------
We have developed 1 project Namely TNPDA.
In that We have gridview that grid has
Three buttons namely display/hide and cancel.
When I click display hide will show.sql table flag is update into d.
When I click hide means flag update into h then display will show snow.
When press cancel flag will update c.
In row command event

Collapse | Copy Code

BLLSuggestion_Mast ObjApp = new BLLSuggestion_Mast();
            if (e.CommandName == "Display")
                ObjApp.UpdateTopic(Convert.ToInt16(e.CommandArgument), Session["FLG"].ToString());
            else if (e.CommandName == "Hide")
                ObjApp.UpdateTopic(Convert.ToInt16(e.CommandArgument), Session["FLG"].ToString());
            else if (e.CommandName == "Deny")
                ObjApp.UpdateTopic(Convert.ToInt16(e.CommandArgument), Session["FLG"].ToString());
            BindTopics();

In row data bound event
------------------------

Collapse | Copy Code

  if (e.Row.RowType == DataControlRowType.DataRow)
            {

                Button objDisplay = (Button)e.Row.FindControl("btnApprove");
                Button objHide = (Button)e.Row.FindControl("btnHide");
                Button objCancel = (Button)e.Row.FindControl("btnCancel");
                if (dgTopics.DataKeys[e.Row.RowIndex].Values[1].ToString() == "A")
                {
                    objDisplay.Visible = false;
                    objHide.Visible = true;
                    objCancel.Visible = true;
                }
                else if (dgTopics.DataKeys[e.Row.RowIndex].Values[1].ToString() == "H")
                {
                    objDisplay.Visible = true;
                    objHide.Visible = false;
                    objCancel.Visible = true;
                }
                else if (dgTopics.DataKeys[e.Row.RowIndex].Values[1].ToString() == "C")
                {
                    objDisplay.Visible = true;
                    objHide.Visible = false;
                    objCancel.Visible = false;
                }
            }
        }

After Web Hosting
-----------------------------
All the process done properly before web hosting but after web hosted there.
When I press display button in the grid flag also changed into D but not shows the hide button.
Can any one help me?

Thanks and regards
Prabu T

 

 

FM0ue

Answers (4)