add columns to the right in gridview - c#

I have a grid view and when i click on the radiobutton approve it should update the recommend tag value to 1 based on the employeeID.However I am getting an error saying that object is not set to an instance of an object..My columns are also being added to the left..instead of right..Below is the code I have tried.
C# code
public void GridViewBind()
{
dadapter = new SqlDataAdapter("SELECT M_Emp_Personal.EmpName, M_Division.DivShort, M_Designation.DesigShort, T_TADA_tempform.BasicSalary, T_TADA_tempform.GPFNo, T_TADA_tempform.Gradepay,T_TADA_tempform.move_date, T_TADA_tempform.purpose, M_City.CityDesc, T_TADA_tempform.estt_visited, T_TADA_tempform.duration_stay, M_mode.mode_type, T_TADA_tempform.duration_unit, T_TADA_tempform.place, T_TADA_tempform.authority, T_TADA_tempform.exp_debited, T_TADA_tempform.reason FROM T_TADA_tempform INNER JOIN M_Emp_Personal ON T_TADA_tempform.EmpID = M_Emp_Personal.EmpID INNER JOIN M_Division ON T_TADA_tempform.DivisionID = M_Division.DivisionID INNER JOIN M_Designation ON M_Emp_Personal.DesigID = M_Designation.DesigID INNER JOIN M_City ON T_TADA_tempform.CityID = M_City.CityID INNER JOIN M_mode ON T_TADA_tempform.mode_ID = M_mode.mode_ID where M_Emp_Personal.EmpID=" + ddlname.SelectedValue + "", conn);
dset = new DataSet();
dadapter.Fill(dset);
GridView1.DataSource = dset.Tables[0];
GridView1.DataBind();
}
protected void submit_info(object sender, EventArgs e)
{
GridViewRow grow = (GridViewRow)(sender as Control).Parent.Parent;
RadioButton rbpApprove = (RadioButton)grow.FindControl("rbtnapprove");
RadioButton rbpReject = (RadioButton)grow.FindControl("rbtnreject");
if (rbpApprove.Checked == true)
{
conn.Open();
SqlCommand cmd = new SqlCommand("UPDATE T_TADA_tempform SET Recommened_tag =1 where EmpID=#EmpID", conn);
cmd.Parameters.AddWithValue("#EmpID", ddlname.SelectedValue);
conn.Close();
}
this is my ASP.NET code
<asp:GridView ID="GridView1" runat="server" CssClass="vutblrow" TabIndex="6"
CellPadding="4" ForeColor="#333333" GridLines="None" Width="100%"
PagerStyle-Mode="NumericPages" >
<PagerStyle CssClass="pgr" Height="25px" BorderStyle="Solid" />
<Columns>
<asp:TemplateField HeaderText="Approve">
<ItemTemplate>
<asp:RadioButton runat="server" GroupName="status" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Reject">
<ItemTemplate>
<asp:RadioButton runat="server" GroupName="status" />
</ItemTemplate>
</asp:TemplateField><asp:TemplateField HeaderText="Submit">
<ItemTemplate>
<asp:Button CssClass="btnAction" Text="Sumbit" runat="server" OnClick="submit_info" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
<HeaderStyle CssClass="vutblhdr" />
</asp:GridView>

You will see that error when you're trying to use an object that hasn't been initialised correctly.
Likely candidates are:
RadioButton rbpApprove = (RadioButton)grow.FindControl("rbtnapprove");
RadioButton rbpReject = (RadioButton)grow.FindControl("rbtnreject");
If the rbpApprove Control isn't found then this line here:
if (rbpApprove.Checked == true)
Will give you the error you are getting.
However only seeing a subset of your code it could be elsewhere.

I think you are missing the Ids of the radionbuttons, try this
<asp:TemplateField HeaderText="Approve">
<ItemTemplate>
<asp:RadioButton ID="rbtnapprove" runat="server" GroupName="status" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Reject">
<ItemTemplate>
<asp:RadioButton ID="rbtnreject" runat="server" GroupName="status" />
</ItemTemplate>
</asp:TemplateField>
And call Execute
if (rbpApprove.Checked == true)
{
conn.Open();
SqlCommand cmd = new SqlCommand("UPDATE T_TADA_tempform SET Recommened_tag =1 where EmpID=#EmpID", conn);
cmd.Parameters.AddWithValue("#EmpID", ddlname.SelectedValue);
cmd.ExecuteNonQuery();
conn.Close();
}

Related

Reordering Columns in a Gridview Dynamically

I have a gridview I'm trying to reorder the columns for, but I'm getting an object not found error.
The code works when I don't include the code under "//code to move columns", but when I include that code, I get an object not found error that "s += txtAD.Text.Trim();" object reference is not set to an instance. It's weird because no matter which columns I switch, it always throws the error that it can't find column 1.
Any ideas?
My HTML:
<asp:GridView ID="gridviewtxSLds" ClientIDMode="Static" runat="server" CssClass="gridclassscrolledtx" CellPadding="0" ForeColor="#333333" AutoGenerateColumns="False">
<Columns>
<asp:TemplateField HeaderText="Metric">
<ItemTemplate>
<asp:TextBox runat="server" Text='<%# Bind("item") %>'
ID="txtctrltype" class="modalpopup2" AutoPostBack="false"></asp:TextBox>
</ItemTemplate>
<HeaderStyle HorizontalAlign="Center" />
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
<asp:TemplateField HeaderText="AD">
<ItemTemplate>
<asp:TextBox runat="server" Text='<%# Bind("AD") %>'
ID="txtAD" onfocus="blur()" class="txttime" AutoPostBack="false" ReadOnly="false"></asp:TextBox>
</ItemTemplate>
<HeaderStyle HorizontalAlign="Center" />
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
<asp:TemplateField HeaderText="BD">
<ItemTemplate>
<asp:TextBox runat="server" Text='<%# Bind("BD") %>'
ID="txtBD" onfocus="blur()" class="txttime" AutoPostBack="false" ReadOnly="false"></asp:TextBox>
</ItemTemplate>
<HeaderStyle HorizontalAlign="Center" />
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
<asp:TemplateField HeaderText="CD">
<ItemTemplate>
<asp:TextBox runat="server" Text='<%# Bind("CD") %>'
ID="txtCD" onfocus="blur()" class="txttime" AutoPostBack="false" ReadOnly="false"></asp:TextBox>
</ItemTemplate>
<HeaderStyle HorizontalAlign="Center" />
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
</Columns>
</asp:GridView>
code in codebehind to fill gridview
using (var cmdtx2 = new SqlCommand(sqlcmd, conn))
{
DataTable dv = new DataTable();
SqlDataAdapter db = new SqlDataAdapter(cmdtx2);
//code to move columns
var columnMove = gridviewtxSLds.Columns[3];
gridviewtxSLds.Columns.RemoveAt(3);
gridviewtxSLds.Columns.Insert(2, columnMove);
db.Fill(dv);
gridviewtxSLds.DataSource = dv;
gridviewtxSLds.DataBind();
}
Update code, which throws the error:
protected void Bulk_Insert(object sender, EventArgs e)
{
var timeinitid = hfptstate.Value;
StringBuilder sb = new StringBuilder();
for (int i = 0; i < gridviewtxSLds.Rows.Count; i++)
{
#region textbox declarations
TextBox txtitem = gridviewtxSLds.Rows[i].FindControl("txtctrltype") as TextBox;
TextBox txtAD = gridviewtxSLds.Rows[i].FindControl("txtAD") as TextBox;
TextBox txtBD = gridviewtxSLds.Rows[i].FindControl("txtBD") as TextBox;
TextBox txtCD = gridviewtxSLds.Rows[i].FindControl("txtCD") as TextBox;
#endregion textbox declarations
#region command string
string s = "update 1874tx set AD";
s += "='";
//following line throws the error
s += txtAD.Text.Trim();
s += "', ";
s += "BD";
s += "='";
s += txtBD.Text.Trim();
s += "', ";
s += "CD";
s += "='";
s += txtCD.Text.Trim();
s += "' where item";
s += "='";
s += txtitem.Text.Trim();
s += "';";
#endregion
sb.Append(s.ToString());
SqlCommand cmd = new SqlCommand(sb.ToString(), con);
con.Open();
cmd.ExecuteNonQuery();
}
}
Edit: And before anyone comments on concatenation of SQL queries, I know, and for this specific use it doesn't matter.

Reading values in Gridview on Selection change of a DropDownList

I am really bad when it comes to playing with data inside a gridview. Here i have a simple gridview that contains a dropdownlist that gets its data from the database table Products.
what i want is on dropdownlist OnSelectedIndexChanged, the price label should read the price of the selected product in dropdownlist. the issue is when i select a product in dropdownlist the prices doesn't show. label remains empty.
ASP.NET
<asp:GridView ID="Gridview1" runat="server" ShowFooter="true" AutoGenerateColumns="false" PagerStyle-CssClass="pager" HeaderStyle-CssClass="header" RowStyle-CssClass="rows" AllowPaging="true" PageSize="5" OnRowDataBound="Gridview1_RowDataBound">
<Columns>
<asp:BoundField DataField="RowNumber" HeaderText="#">
<HeaderStyle CssClass="header" Width="60px"></HeaderStyle>
</asp:BoundField>
<asp:TemplateField HeaderText="Product">
<ItemTemplate>
<asp:DropDownList ID="dropdown1" runat="server" AutoPostBack="true" OnSelectedIndexChanged="dropdown1_SelectedIndexChanged">
</asp:DropDownList>
</ItemTemplate>
<HeaderStyle CssClass="header" />
<ItemStyle Width="170px" />
</asp:TemplateField>
<asp:TemplateField HeaderText="QTY">
<ItemTemplate>
<asp:TextBox ID="qty_txtbox" runat="server" style="text-align:center;" OnTextChanged="TextBox2_TextChanged"></asp:TextBox>
</ItemTemplate>
<ControlStyle Width="50px" CssClass="txt" />
<HeaderStyle CssClass="header" />
<ItemStyle Width="50px" CssClass="txt" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Price (AED)">
<ItemTemplate>
<asp:Label ID="amount_lbl" runat="server"></asp:Label>
</ItemTemplate>
<HeaderStyle CssClass="header" />
<ItemStyle Width="130px" CssClass="txt" />
</asp:TemplateField>
<asp:TemplateField HeaderText="">
<ItemTemplate>
<asp:ImageButton runat="server" ID="trash" Style="height: 20px;" ImageUrl="~/IMG/garbage.png" />
</ItemTemplate>
<ControlStyle Height="20px" Width="20px"></ControlStyle>
<FooterStyle HorizontalAlign="center" />
<HeaderStyle Height="30px" Width="30px" CssClass="header"></HeaderStyle>
<FooterTemplate>
<asp:ImageButton runat="server" ID="addnew" ImageUrl="~/IMG/add.png" Style="height: 20px;" OnClick="ButtonAdd_Click" />
</FooterTemplate>
</asp:TemplateField>
</Columns>
<HeaderStyle CssClass="header" />
<PagerStyle CssClass="pagerr" />
<RowStyle CssClass="rows" />
</asp:GridView>
Here is what i tried
private DataSet GetData()
{
SqlCommand cmd = new SqlCommand("SELECT ProductName, PartNumber, price FROM Products");
using (SqlConnection con = new SqlConnection(cDate.CS))
{
using (SqlDataAdapter sda = new SqlDataAdapter())
{
cmd.Connection = con;
sda.SelectCommand = cmd;
using (DataSet ds = new DataSet())
{
sda.Fill(ds);
return ds;
}
}
}
protected void Gridview1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
//Find the DropDownList in the Row
DropDownList ddproducts = (e.Row.FindControl("dropdown1") as DropDownList);
ddproducts.DataSource = GetData();
ddproducts.DataTextField = "ProductName";
ddproducts.DataValueField = "ProductName";
ddproducts.DataBind();
//Add Default Item in the DropDownList
ddproducts.Items.Insert(0, new ListItem("<----Please select---->"));
}
}
protected void dropdown1_SelectedIndexChanged(object sender, EventArgs e)
{
string dvalue = Gridview1.SelectedRow.Cells[1].Text;
string price = Gridview1.SelectedRow.Cells[3].Text;
using (SqlConnection con = new SqlConnection(cDate.CS))
{
con.Open();
SqlCommand myCommand = new SqlCommand("select price from products where ProductName = #name");
myCommand.Parameters.AddWithValue("#name", dvalue);
myCommand.Connection = con;
using (SqlDataReader myReader = myCommand.ExecuteReader())
{
while (myReader.Read())
{
price = (myReader["price"].ToString());
}
}
}
}
Error
Object reference not set to an instance of an object. for this line string dvalue = Gridview1.SelectedRow.Cells[1].Text;
As the other answer stated, the issue main issues is you are not updating the result in that particular label. But that only solves your issues, you have do something more:
Identify the DataRow in which the control belongs to..
Get the label that you wanted to access.
Perform the operations
Assign the value back to the label.
The whole process can be implemented by using the following code, please take a look and let me know if you need any clarifications:
protected void dropdown1_SelectedIndexChanged(object sender, EventArgs e)
{
DropDownList ddlProduct = (DropDownList)sender;
DataGridItem row = (DataGridItem) ddlProduct.NamingContainer;
Label lblPrice = (Label)row.FindControl("amount_lbl");
// Get current label Text
string price = lblPrice.Text;
// Perform your operations here
// Assign the price value back to the label
lblPrice.Text = price;
}
It seems that you didn't set the price back to the grid!
Update: as mentioned by 'un-lucky', to get appropriate grid row we have use the dropdown which fires the event and get associated DataRow in its parents:
protected void dropdown1_SelectedIndexChanged(object sender, EventArgs e)
{
var row = (sender as DropDownList).NamingContainer as GridViewRow; //instead of Gridview1.SelectedRow;
string dvalue = row.Cells[1].Text; //or row.FindControl(id);
//string price = row.Cells[3].Text;
string price = "1400"; //get from database
row.Cells[3].Text = price; //or row.FindControl(id);
//Gridview1.new
}

GridView_RowUpdating not firing

I have Gridview with ItemTemplate and EditItemTemplate:
But when i click "Ok" button, nothing happens. I tried to put trace point on RowUpdating event and click "Ok" button, but its not even triggered. I assume, that problem could be in the same "Id" of ItemTemplate and EditItemTemplate lbl_first_fl. But earlier this worked fine, the only thing was changed - i updated Visual studio to 2015 and changed Windows to 8. So i installed VS 2013, but problem still occures. Any suggestions? Or maybe how can i deal with it using different id's?
aspx page:
<asp:GridView ID="GridView5" runat="server" AutoGenerateColumns="false" CellPadding="4" ForeColor="#333333" Height="430px" OnRowCancelingEdit="GridView5_RowCancelingEdit" OnRowDataBound="GridView5_RowDataBound" OnRowEditing="GridView5_RowEditing" OnRowUpdating="GridView5_RowUpdating" Width="100%" CssClass="gridview" GridLines="none">
<AlternatingRowStyle BackColor="White" ForeColor="#284775" />
<Columns>
<asp:TemplateField ItemStyle-Width="100">
<EditItemTemplate>
<asp:Button ID="btn_Update_fl" runat="server" CommandName="Update" Text="Ок" />
<asp:Button ID="btn_Cancel_fl" runat="server" CommandName="Cancel" Text="Отмена" />
</EditItemTemplate>
<ItemTemplate>
<asp:Button ID="btn_Edit_fl" runat="server" CommandName="Edit" Text="✎" Enabled='<%# Flag %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="08:00 - 17:00" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Label ID="lbl_first_fl" runat="server" Text='<%# Eval("First") %>' Visible="true"></asp:Label>
</ItemTemplate>
<EditItemTemplate>
<asp:Label ID="lbl_first_fl" runat="server" Text='<%# Eval("First") %>' Visible="false"></asp:Label>
<asp:DropDownList ID="ddl_first_fl" runat="server">
</asp:DropDownList>
</EditItemTemplate>
</asp:TemplateField>
<asp:CommandField/>
</Columns>
</asp:GridView>
OnRowUpdating event:
protected void GridView5_RowUpdating(object sender, System.Web.UI.WebControls.GridViewUpdateEventArgs e)
{
DropDownList First_fl = GridView5.Rows[e.RowIndex].FindControl("ddl_first_fl") as DropDownList;
con = new SqlConnection(cs);
con.Open();
//updating the record
SqlCommand cmd_fl = new SqlCommand("Update [Duty].[dbo].[Schedule_FirstLine] set First='" + First_fl.Text + "', con);
cmd_fl.ExecuteNonQuery();
con.Close();
GridView5.EditIndex = -1;
ShowDataFirstLine();
}
Binding Gridview:
protected void ShowDataFirstLine()
{
DateTime date = Convert.ToDateTime(Calendar1.VisibleDate.Date.ToString());
var firstDayOfMonth = new DateTime(date.Year, date.Month, 1);
var lastDayOfMonth = firstDayOfMonth.AddMonths(1).AddDays(-1);
string GridDS_FirstLine = "set dateformat dmy Select DutyDate,WeekDay,First, Second from [Duty].[dbo].[Schedule_FirstLine] WHERE DutyDate >= '" + firstDayOfMonth + "' AND DutyDate <= '" + lastDayOfMonth + "'";
dt_FirstLine = new DataTable();
con_FirstLine = new SqlConnection(cs);
con_FirstLine.Open();
adapt_FirstLine = new SqlDataAdapter(GridDS_FirstLine, con_FirstLine);
adapt_FirstLine.Fill(dt_FirstLine);
if (dt_FirstLine.Rows.Count > 0)
{
GridView5.DataSource = dt_FirstLine;
GridView5.DataBind();
}
GridView5.Columns[0].Visible = true;
}
You name the event on the grid like this?
<asp:GridView ID="TaskGridView" runat="server"
AutoGenerateEditButton="True"
AllowPaging="true"
OnRowEditing="TaskGridView_RowEditing"
OnRowCancelingEdit="TaskGridView_RowCancelingEdit"
OnRowUpdating="TaskGridView_RowUpdating"
OnPageIndexChanging="TaskGridView_PageIndexChanging">
</asp:GridView>

Issue with updating rows in a gridview

I have gridview where users can edit and update data in gridview but my issue is when i put some text in the Action field, nothing is updated. I have tried to run debug mode so i can watch what what is happening but i don't see the values i typed in the text box, it shows blank in my variable. Here is my aspx code:
<asp:GridView ID="GridView1" runat="server" Width = "855px" AutoGenerateColumns = "False" Font-Names = "Arial"
OnPageIndexChanging = "OnPaging" onrowediting="EditGridView1"
onrowupdating="UpdateGridView1" onrowcancelingedit="CancelEdit" CellPadding="3"
BackColor="White" BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" >
<Columns>
<asp:TemplateField ItemStyle-Width = "30px" HeaderText = "ID">
<ItemTemplate>
<asp:Label ID="lblQST_SK" runat="server" Text='<%# Eval("QUEST_SK")%>'></asp:Label>
</ItemTemplate>
<ItemStyle Width="10px" />
</asp:TemplateField>
<asp:TemplateField ItemStyle-Width = "150px" HeaderText = "Action">
<ItemTemplate>
<asp:Label ID="lblAction" runat="server" Text='<%# Eval("ACTION")%>'></asp:Label>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="txtAction" runat="server" Text='<%# Eval("ACTION")%>' TextMode="MultiLine" Height="80px"></asp:TextBox>
</EditItemTemplate>
<ItemStyle Width="150px" />
</asp:TemplateField>
</Columns>
<FooterStyle BackColor="White" ForeColor="#000066" />
<HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White"
HorizontalAlign="Left" />
<PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" />
<RowStyle ForeColor="#000066" />
</asp:GridView>
here is my code behind:
protected void UpdateGridView1(object sender, GridViewUpdateEventArgs e)
{
string QUEST_SK = ((Label)GridView1.Rows[e.RowIndex].FindControl("lblQST_SK")).Text;
string ACTION = ((TextBox)GridView1.Rows[e.RowIndex].FindControl("txtAction")).Text;
SqlConnection con = new SqlConnection(strConnString);
SqlCommand cmd = new SqlCommand();
cmd.CommandType = CommandType.Text;
cmd.CommandText = "update mytable set ACTION=#ACTION" +
"where QUEST_SK=#QUEST_SK;" +
"SELECT QUEST_SK, ACTION FROM mytable";
cmd.Parameters.Add("#QUEST_SK", SqlDbType.VarChar).Value = QUEST_SK;
cmd.Parameters.Add("#ACTION", SqlDbType.VarChar).Value = ACTION;
GridView1.EditIndex = -1;
GridView1.DataSource = GetData(cmd);
GridView1.DataBind();
}
Try to write the function below in Page Load Event :
Page_Load()
{
if(IsPostBack)
{
return`;
}
}

Issues with dropdown causing error: Object reference not set to an instance of an object

I have drop down box that does not keep the selected value so i had to add this line of code:
ddl_Answer.Items.FindByValue((e.Row.FindControl("lblAns") as Label).Text).Selected = true;
But adding this line of code is causing me another problem. I have built the dropdown in a Gridview and the Gridview has an Edit link, once you click the edit then you should see the drop down box, but the issue now is when i click the Edit link and nothing has been selected in the dropdown then i get an error. It only works when something was already selected. Here is my code:
protected void RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow && GridView1.EditIndex == e.Row.RowIndex)
{
int current_quest_sk = Convert.ToInt32(GridView1.DataKeys[e.Row.RowIndex].Value);
DropDownList ddl_Answer = (DropDownList)e.Row.FindControl("ddl_Answer");
String strConnString = System.Configuration.ConfigurationManager.ConnectionStrings["myConnection"].ConnectionString;
SqlConnection con2 = new SqlConnection(strConnString);
SqlDataAdapter sda = new SqlDataAdapter();
SqlCommand cmd1 = new SqlCommand("select distinct DD_ANSWER from MainTable D, SecondryTable Q where Q.ANS_OPT = D.ID and QUEST_SK= '" + current_quest_sk + "' ");
cmd1.Connection = con2;
con2.Open();
ddl_Answer.DataSource = cmd1.ExecuteReader();
ddl_Answer.DataTextField = "DD_ANSWER";
ddl_Answer.DataValueField = "DD_ANSWER";
ddl_Answer.DataBind();
con2.Close();
ddl_Answer.Items.FindByValue((e.Row.FindControl("lblAns") as Label).Text).Selected = true;
}
here is the markup for the dropdown
<asp:GridView ID="GridView1" runat="server" Width="870px" OnRowDataBound="RowDataBound"
AutoGenerateColumns="False" Font-Names="Arial" Font-Size="11pt" AlternatingRowStyle-BackColor="#C2D69B"
HeaderStyle-BackColor="green" AllowPaging="True" ShowFooter="True" OnPageIndexChanging="OnPaging"
OnRowEditing="EditGridView1" OnRowUpdating="UpdateGridView1" OnRowCancelingEdit="CancelEdit"
CellPadding="4" BackColor="White" BorderColor="#336666"
BorderStyle="Double" BorderWidth="3px"
DataKeyNames="QUEST_SK">
<AlternatingRowStyle BackColor="#C2D69B" />
<Columns>
<asp:TemplateField HeaderText="Answer">
<ItemTemplate>
<asp:Label ID="lblAns" runat="server" Text='<%# Eval("DDL_ANS")%>'></asp:Label>
</ItemTemplate>
<EditItemTemplate>
<asp:Label ID="lblAns" runat="server" Text='<%# Eval("DDL_ANS")%>' Visible="false"></asp:Label>
<asp:DropDownList ID="ddl_Answer" runat="server">
</asp:DropDownList>
</EditItemTemplate>
</asp:TemplateField>
<asp:CommandField ShowEditButton="True" >
<ItemStyle Font-Size="Smaller" ForeColor="#FF3300" />
</asp:CommandField>
</Columns>

Categories

Resources