<asp:TemplateField HeaderText="Approved Km By CTV" Visible="false"> <ItemTemplate> <asp:TextBox ID="txtdistancectv" MaxLength="6" CssClass="textBox_for6tds" runat="server"> </asp:TextBox> <asp:RegularExpressionValidator ID="revtxtdistancectv" runat="server" Display="Static" SetFocusOnError="True" ValidationExpression="[0-9]*\.?[0-9]*" ControlToValidate="txtdistancectv"></asp:RegularExpressionValidator></ItemTemplate> <ItemStyle HorizontalAlign="center" /> </asp:TemplateField>
if (!Page.IsPostBack) { if (intRoleId == 1) { //GridZeroApprovedKm.Levels[0].Columns[4].Visible = true; } ControlBinding.FillCombo(ddlhub, "ASSOCIATED_HUBS", Session[TMS.Common.CommonConstants.CONST_COMPANY_ID].ToString(), Session[TMS.Common.CommonConstants.CONST_USER_HUB_ID].ToString(), Session[TMS.Common.CommonConstants.CONST_USER_ID].ToString(), "", "", "", false); }
for(int i=0;i<gridview1.rows.count-1;i++)> { if (RoleId == 1)//give your condition { GridView1.rows[i].cells[4].Visible = true; //Change the cell[4] Cell["cellname"] or change index } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)