I've got question. I created my first WebForms Application. Now I am on my way to create Site.Master
(toolbar). So I write Menu from DevExpress controls, didn't change anything in Site.css and I have something that I can't understand.
When I run project via Chrome my Toolbar looks like:
[div class float-left][div class float-left] [div class float-right]
But when I reboot PC, run project again (compile), my Toolbar looks like:
[div class float-left] [div class float-right]
[div class float-left]
I have to delete my cache from Chrome and then everything is ok.
This is code for Site.Master:
<div class="float-right">
<dx:ASPxMenu ID="ASPxLogin" runat="server" Theme="Moderno" Font-Size="Small" Cursor="pointer" ShowAsToolbar="True">
<Paddings PaddingLeft="3px" PaddingRight="3px" />
<Items>
<dx:MenuItem Text="0" Enabled="False">
<Image Url="~/Images/Controls/btn-profile-black.png" UrlHottracked="~/Images/Controlsbtn-profile-white.png" UrlDisabled="~/Images/Controls/btn-profile-grey.png" />
<ItemStyle BackColor="Aqua" Font-Size="Small"></ItemStyle>
</dx:MenuItem>
<dx:MenuItem Text="A">
<Image Url="~/Images/Controls/btn-off-white.png" UrlDisabled="~/Images/Controls/btn-off-grey.png">
</Image>
<ItemStyle BackColor="#E06666" ForeColor="White">
<HoverStyle BackColor="#970000">
</HoverStyle>
</ItemStyle>
</dx:MenuItem>
</Items>
</dx:ASPxMenu>
</div>
<div class="float-left">
<dx:ASPxMenu ID="ASPxMenu" runat="server" Theme="Moderno" Font-Size="Small" Cursor="pointer" ShowAsToolbar="True">
<Paddings PaddingLeft="3px" PaddingRight="3px" />
<Items>
<dx:MenuItem Text=" ">
<Image Url="~/Images/logo.jpg" Height="32px"></Image>
<ItemStyle BackColor="White">
<HoverStyle BackColor="White">
</HoverStyle>
</ItemStyle>
<SubMenuStyle BackColor="#CC0000" />
</dx:MenuItem>
<dx:MenuItem Text="B">
<Image Url="~/Images/Controls/btn-home-black.png" UrlDisabled="~/Images/Controls/btn-home-grey.png" UrlHottracked="~/Images/Controls/btn-home-white.png" />
<ItemStyle BackColor="Aqua">
<HoverStyle BackColor="Black">
</HoverStyle>
</ItemStyle>
</dx:MenuItem>
</Items>
</dx:ASPxMenu>
</div>
<div class="float-left">
<dx:ASPxMenu ID="ASPxMenu1" runat="server" Theme="Moderno" Font-Size="Small" Cursor="pointer" ShowAsToolbar="True">
<Paddings PaddingLeft="3px" PaddingRight="3px" />
<Items>
<dx:MenuItem Text="C" BeginGroup="True">
<Image Url="~/Images/Controls/btn-view-black.png" UrlDisabled="~/Images/Controls/btn-view-grey.png" UrlHottracked="~/Images/Controls/btn-view-white.png">
</Image>
<ItemStyle BackColor="Aqua">
<HoverStyle BackColor="Black">
</HoverStyle>
</ItemStyle>
</dx:MenuItem>
<dx:MenuItem Text="F">
<Image Url="~/Images/Controls/btn-add-black.png" UrlDisabled="~/Images/Controls/btn-add-grey.png" UrlHottracked="~/Images/Controls/btn-add-white.png">
</Image>
<ItemStyle BackColor="#B6D7A8">
<HoverStyle BackColor="#009900">
</HoverStyle>
</ItemStyle>
</dx:MenuItem>
<dx:MenuItem Text="R">
<Image Url="~/Images/Controls/btn-bin-white.png" UrlDisabled="~/Images/Controls/btn-bin-grey.png">
</Image>
<ItemStyle BackColor="#E06666" ForeColor="White">
<HoverStyle BackColor="#970000">
</HoverStyle>
</ItemStyle>
</dx:MenuItem>
</Items>
</dx:ASPxMenu>
</div>
This is code for Site.css:
header, footer, hgroup,
nav, section {
display: block;
}
mark {
background-color: #a6dbed;
padding-left: 5px;
padding-right: 5px;
}
.float-left {
float: left;
}
.float-right {
float: right;
}
Related
I am using Asp Menu in my application In menu item I want to display in border everything is fine but at bottom of this menu items border is not appearing. where i am going wrong
I tried
myborder:last-child {
border-bottom: 1px solid lightblue;
}
But No changes where i am going wrong ?
html
<div style="position: absolute; left: 50px; top: 80px;" id="menu">
<asp:Menu AccessKey="N" ID="MainMenu" runat="server" BackColor="Transparent"
BorderColor="Blue" BorderStyle="None" BorderWidth="2px" Font-Names="Arial"
Font-Size="Small" ForeColor="Black" Orientation="Horizontal"
OnMenuItemClick="MainMenu_MenuItemClick" CssClass="myborder"
Style="width: 400px; text-align: left">
<DynamicHoverStyle BackColor="#66ccff" BorderColor="Black" BorderStyle="Solid"
BorderWidth="1px" ForeColor="Black" />
<DynamicMenuStyle BackColor="White" BorderColor="Black"
BorderStyle="Solid" BorderWidth="1px" />
<DynamicMenuItemStyle BackColor="White" HorizontalPadding="5px"
VerticalPadding="2px" CssClass="myborder"/>
<Items>
<asp:MenuItem Text="Home" Value="Home"></asp:MenuItem>
<asp:MenuItem Text="|" Value="|"></asp:MenuItem>
<asp:MenuItem Text="Master" Value="Master" Selectable="False">
<asp:MenuItem Text="Assets Master" Value="Assets Master" />
<asp:MenuItem Text="Staff Master" Value="Staff Master" />
<asp:MenuItem Text="Group Master" Value="Group Master" />
<asp:MenuItem Text="Group Cost Center Master" Value="Group Cost Center Master" />
<asp:MenuItem Text="Cost Center Master" Value="Cost Center Master" />
<asp:MenuItem Text="Mobile User Login" Value="Mobile User Login" />
</Items>
<StaticMenuItemStyle HorizontalPadding="5px" VerticalPadding="2px" />
<DynamicSelectedStyle BackColor="#BFBFBF" />
<StaticHoverStyle BackColor="#BFBFBF" ForeColor="Black" />
</asp:Menu>
Screen Shots
When I click edit in purchase tab grid view cell mode is fine but in sales tab grid view cell mode not accurate what i want....i don't understand what should i do now...i want sales tab cell mode as purchase tab cell mode. hope you can help me
I'm including picture for better understand
and its html code
<asp:GridView ID="GridView1" runat="server" CssClass="dataGridTable" AutoGenerateColumns="False" Width="100%" AllowPaging="True" BackColor="White" BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" CellPadding="3" DataSourceID="ObjectDataSource1" HeaderStyle-Height="30" OnRowCreated="GridView1_RowCreated" PageSize="30" DataKeyNames="invoiceNumber,productName,productCategory" OnSelectedIndexChanged="GridView1_SelectedIndexChanged" OnRowDeleting="GridView1_RowDeleting" OnRowUpdating="GridView1_RowUpdating" OnRowDataBound="GridView1_RowDataBound">
<Columns>
<asp:CommandField ShowEditButton="true"/>
<asp:TemplateField ShowHeader="False">
<ItemTemplate>
<asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" CommandName="Delete" Text="Delete"></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="invoiceNumber" HeaderText="Invoice" ReadOnly="true" SortExpression="invoiceNumber" />
<asp:BoundField DataField="productName" HeaderText="Name" ReadOnly="true" SortExpression="productName" />
<asp:BoundField DataField="productCategory" HeaderText="Category" ReadOnly="true" SortExpression="productCategory" />
<asp:BoundField DataField="totalQuantity" HeaderText="Quantity" SortExpression="totalQuantity" />
<asp:BoundField DataField="totalPurchasePrice" HeaderText="Total Price" SortExpression="totalPurchasePrice" />
<asp:BoundField DataField="salePricePerItem" HeaderText="Sale Price/Item" SortExpression="salePricePerItem" />
<asp:BoundField DataField="comments" HeaderText="Comments" SortExpression="comments" />
<asp:BoundField DataField="date" HeaderText="Date" ReadOnly="true" SortExpression="date" />
<asp:TemplateField>
<ItemTemplate>
<asp:ImageButton ID="ImageButton1" runat="server" Height="24px" ImageUrl="~/Images/detailsInfo.png" Width="24px" OnClick="ImageButton1_Click" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
<FooterStyle BackColor="White" ForeColor="#000066" />
<HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" CssClass="gridHeaderAlignment" />
<PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" />
<RowStyle ForeColor="#000066" HorizontalAlign="Center" VerticalAlign="Middle" />
<HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
<SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" />
<SortedAscendingCellStyle BackColor="#F1F1F1" />
<SortedAscendingHeaderStyle BackColor="#007DBB" />
<SortedDescendingCellStyle BackColor="#CAC9C9" />
<SortedDescendingHeaderStyle BackColor="#00547E" />
</asp:GridView>
and its html code
<asp:GridView ID="GridView1" runat="server" CssClass="dataGridTable" AutoGenerateColumns="False" Width="100%" AllowPaging="True" BackColor="White" BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" CellPadding="3" DataSourceID="ObjectDataSource1" HeaderStyle-Height="30" OnRowCreated="GridView1_RowCreated" PageSize="30" OnRowDeleting="GridView1_RowDeleting" OnRowUpdating="GridView1_RowUpdating" DataKeyNames="invoiceNumber,productName,productCategory">
<Columns>
<asp:CommandField ShowEditButton="True" />
<asp:TemplateField ShowHeader="False">
<ItemTemplate>
<asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" CommandName="Delete" Text="Delete"></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="invoiceNumber" HeaderText="Invoice" ReadOnly="true" SortExpression="invoiceNumber" />
<asp:BoundField DataField="productName" HeaderText="Name" ReadOnly="true" SortExpression="productName" />
<asp:BoundField DataField="productCategory" HeaderText="Category" ReadOnly="true" SortExpression="productCategory" />
<asp:BoundField DataField="totalQuantity" HeaderText="Quantity" SortExpression="totalQuantity" />
<asp:BoundField DataField="totalPrice" HeaderText="Price" SortExpression="totalPrice" />
<asp:BoundField DataField="paidAmount" HeaderText="Paid Amount" SortExpression="paidAmount" />
<asp:BoundField DataField="comments" HeaderText="Comments" SortExpression="comments" />
<asp:BoundField DataField="date" HeaderText="Date" ReadOnly="true" SortExpression="date" />
<asp:TemplateField>
<ItemTemplate>
<asp:ImageButton ID="ImageButton1" runat="server" Height="24px" ImageUrl="~/Images/detailsInfo.png" Width="24px" OnClick="ImageButton1_Click" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
<FooterStyle BackColor="White" ForeColor="#000066" />
<HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" CssClass="gridHeaderAlignment" />
<PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" />
<RowStyle ForeColor="#000066" HorizontalAlign="Center" VerticalAlign="Middle" />
<HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
<SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" />
<SortedAscendingCellStyle BackColor="#F1F1F1" />
<SortedAscendingHeaderStyle BackColor="#007DBB" />
<SortedDescendingCellStyle BackColor="#CAC9C9" />
<SortedDescendingHeaderStyle BackColor="#00547E" />
</asp:GridView>
You need ItemStyle and ControlStyle property of bound field. ItemStyle modifies the style for gridview column and ControlStyle modifies the style for control present in gridview column.
<asp:BoundField DataField="totalQuantity" HeaderText="Quantity" SortExpression="totalQuantity" />
<ItemStyle Width="200px" />
<ControlStyle Width="100%" />
</asp:BoundField>
Adjust the width as per your wish.
You could also use ControlStyle-CssClass or ItemStyle-CssClass, if you want to generalized you style.
I cannot figure out how to align the calendar in the middle of a page.
Here is my code:
<div style="text-align:center">
<asp:Calendar ID="Calendar1" runat="server" BackColor="White" BorderColor="White" BorderWidth="1px" Font-Names="Verdana" Font-Size="9pt" ForeColor="Black" Height="190px" NextPrevFormat="FullMonth" Width="350px">
<DayHeaderStyle Font-Bold="True" Font-Size="8pt" />
<NextPrevStyle Font-Bold="True" Font-Size="8pt" ForeColor="#333333" VerticalAlign="Bottom" />
<OtherMonthDayStyle ForeColor="#999999" />
<SelectedDayStyle BackColor="#333399" ForeColor="White" />
<TitleStyle BackColor="White" BorderColor="Black" BorderWidth="4px" Font-Bold="True" Font-Size="12pt" ForeColor="#333399" />
<TodayDayStyle BackColor="#CCCCCC" VerticalAlign="Middle" HorizontalAlign="Center" />
</asp:Calendar>
<br />
</div>
Change your div style to this:
<div style="width:X%; margin: 0 auto;">
Set X to be the same as the width attribute for your calendar.
You can also change your calendar's width attribute to be 100% instead of a pixel amount, and then set the width attribute of your div to 50%. You can then toy with those to get them to look any way you want.
I have a GridView. I am not adding any style in it but still it's giving me blue color header labels. How can I fix it.
My GridView is as follow.
<asp:GridView ID="grdViewApp" runat="server" AutoGenerateColumns="False" DataKeyNames="APPLICATION_ID,APPNAME,APPDESCRIPTION,REMARKS,VERSION,SCHEDULE_ID,AUTHENTICATION_TYPE"
BorderStyle="None" BorderWidth="0px" Width="100%" BorderColor="Transparent" OnRowCommand="grdViewApp_RowCommand"
OnSorting="grdView_Sorting" AllowSorting="true" AllowPaging="true" PageSize="4"
OnPageIndexChanging="grdViewApp_PageIndexChanging" OnRowDataBound="grdViewApp_RowDataBound">
<AlternatingRowStyle CssClass="AltRow" />
<HeaderStyle HorizontalAlign="Left" />
<RowStyle CssClass="Row" />
<Columns>
<asp:TemplateField HeaderText="Edit" ItemStyle-HorizontalAlign="left" ItemStyle-Width="5%">
<HeaderStyle HorizontalAlign="Left" />
<ItemTemplate>
<asp:ImageButton ImageUrl="~/images/edit-icon.png" ID="ImgBtnEditApp" runat="server"
Height="18" Width="18" CommandArgument='<%# DataBinder.Eval(Container, "RowIndex") %>'
CommandName="EditApp" title="Edit Record" />
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" Width="5%" />
</asp:TemplateField>
<asp:BoundField DataField="APPLICATION_ID" HeaderText="ID" ReadOnly="True" SortExpression="APPLICATION_ID">
<ItemStyle Width="15%" HorizontalAlign="Left" />
</asp:BoundField>
<asp:BoundField DataField="AppName" HeaderText="Names" SortExpression="AppName">
<ItemStyle Width="15%" HorizontalAlign="Left" />
</asp:BoundField>
<asp:BoundField DataField="AppDescription" HeaderText="Description" SortExpression="AppDescription">
<ItemStyle Width="15%" HorizontalAlign="Left" />
</asp:BoundField>
<asp:BoundField DataField="Version" HeaderText="Version" SortExpression="Version">
<ItemStyle Width="15%" HorizontalAlign="Left" />
</asp:BoundField>
</Columns>
</asp:GridView>
The grid uses a table element as the header, plus since you have sorting enabled it also uses a header text with a link, so likely the style is coming from the header link. You will have to use CSS to style the link to use another color.
I have a doubt in gridview design can anyone help me.
I have created a gridview, but when im giving any text to that grid cell my grid design is changing. My question is how to give a fixed height to the gridview even if we are entering text into one cell or no: of cells. And Here is my code.
Thank You in Advance.
<asp:GridView ID="GrvSchoolName1" runat="server" AllowPaging="True" PageSize="4" Height="30px" BackColor="White"
BorderColor="#999999" BorderStyle="Solid" BorderWidth="1px" CellPadding="3"
GridLines="Vertical" CssClass="grvclass"
AutoGenerateColumns="False"
ForeColor="Black" onpageindexchanging="GrvSchoolName1_PageIndexChanging">
<PagerSettings Mode="NumericFirstLast" PageButtonCount="4" FirstPageText="First" LastPageText="Last"/>
<AlternatingRowStyle BackColor="#CCCCCC" />
<Columns>
<asp:TemplateField HeaderText="Emergency Alert" HeaderStyle-Height="30px">
<ItemTemplate>
<div style="overflow:auto; height:60px;">
<asp:Label ID="Label1" runat="server" Text='<% #Eval("AlertMessage") %>' ></asp:Label>
</div>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<FooterStyle BackColor="#CCCCCC" />
<HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" />
<SelectedRowStyle BackColor="#000099" Font-Bold="True" ForeColor="White" />
<SortedAscendingCellStyle BackColor="#F1F1F1" />
<SortedAscendingHeaderStyle BackColor="#808080" />
<SortedDescendingCellStyle BackColor="#CAC9C9" />
<SortedDescendingHeaderStyle BackColor="#383838" />
</asp:GridView>
</div>
Give a css class to your itemstyle template. Same works for the header :)
.NET
<ItemStyle CssClass="items"> </ItemStyle>
<ItemTemplate>
your stuff
</ItemTemplate>
CSS.
.items{width:200px;}