I am trying to create my second column “mentor name”, since I used css, which he gave the style for the whole grid. I also tried "control styl css class = (some other css file)" and "item styl horizontal align = right" and also change the align = right property using # in the css file, but the template field does not allow "id" to implement my css the .aspx page and css ar below,
.mGrid { width: 100%; background-color: #fff; margin: 0px 0 0px 0; border: 0px #525252; } .mGrid table { border:0px; } .mGrid td { padding: 2px; border-width: 0px ; background-color:#3A3F3E; color: #fff; text-align:left; } td#Mname { text-align:left; } .mGrid th { padding: 4px 2px; color: #fff; background-color:#3A3F3E; border-width: 0px ; font-size: 0.9em; text-align:center; } <asp:GridView Width="300px" ID="GridView1" runat="server" AutoGenerateColumns="False" Font-Size="10pt" OnRowCreated="GridView1_RowCreated" CssClass="mGrid"> <Columns> <asp:BoundField DataField="mentor_id" HeaderText="Image" /> <asp:TemplateField HeaderText="Image"> <ItemTemplate> <asp:Image ID="Image2" runat="server" ImageUrl="~/images/small_image.png" /> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Mentor Name"> <ItemTemplate> <asp:Label ID="Label1" Text='<%#Eval("mentor_FirstName")+ "</br> " + "<b>Experience: </b>"+Eval("mentor_experience") %> ' runat="server"></asp:Label> </ItemTemplate> </asp:TemplateField> </Columns> </asp:GridView>
hopes for your suggestions in advance thanks
source share