Ramco Ramco

Ramco Ramco

  • 443
  • 3.4k
  • 521.4k

Button option not appearing

May 10 2023 10:41 AM

Hi

  I have below code but button open like Hritvi not appearing on Srini .. Image also attached.

                for (int i = 8; i < e.Row.Cells.Count - 1; i++)
                {
                    string cellValue = e.Row.Cells[i].Text;
                    var row = (DataRowView)e.Row.DataItem;
                    LinkButton button = new LinkButton();
                    button.Text = cellValue;

 
                    if (row[i].ToString().ToUpper().Trim() == "A")
                    {
                        button.CssClass = "badge badge-danger";
                    }
                    else if (row[i].ToString().ToUpper().Trim() == "B")
                    {
                        button.CssClass = "badge badge-warning";
                    }
                    else if (row[i].ToString().ToUpper().Trim() == "ND")
                    {
                        button.CssClass = "badge badge-secondary";
                        button.OnClientClick = "return false;";
                    }
                    else if (row[i].ToString().ToUpper().Trim() == "D")
                    {
                        button.CssClass = "badge badge-success";
                    }
                    else if (row[i].ToString().ToUpper().Trim() == "S")
                    {
                        button.CssClass = "badge badge-info";
                    }
                    else if (row[i].ToString().ToUpper().Trim() == "HB")
                    {
                        button.CssClass = "badge badge-primary";
                    }
                    e.Row.Cells[i].Controls.Add(button);
                    e.Row.Cells[i].HorizontalAlign = HorizontalAlign.Center;
                }

Thanks


Answers (1)