Showing posts with label CSS. Show all posts
Showing posts with label CSS. Show all posts

Monday, November 17, 2008

Sharepoint Date time control rendering issue

Hi all,

We are using SharePoint Date time picker Control in Custom Field as well as in custom web parts.

The problem that we are facing is sometime calendar which is opening looks like there is no CSS applied to that control. But same control works in other list.

This is the rendering issue with Sharepoint date time control.

If we are using this date time control with asp.net ajax control then this control is defiantly not work properly.



So while surfing we find the solution on this site

This site says:
To fix the problem, drop the following line of code into %programfiles%\common files\microsoft shared\web server extensions\12\templates\layouts\iframe.aspx
<link rel="stylesheet" type="text/css"href="/_layouts/1033/styles/datepicker.css"/>

Put it right below the <HEAD> tag at the top, and the calendar should render correctly from now on.


We tried it and it work like a charm.
Again thanks to Rich Finn for his wonderful post.

Friday, July 18, 2008

Collapsible Panel extender CSS issue with Moss

Since I start implementing AJAX in moss, we are facing problem with most of the every control.
Asp.Net Ajax Controls is not easy to integrate with SharePoint.

In my previous post I solve problem with Tab Container with header display issue.

Now, here I’m explaining collapsible panel extender issue with SharePoint /Moss.
I am facing a problem that Collapsible Panel is not collapsing in SharePoint/Moss webpart.

By default it should hide the content area and on clicking on the header it should expand the content area.
But it is not working as easily like it is working in Simple Asp.Net application.

In my case collapsible panel is not hiding content, it just flicker and again come to the same position as it is in default position.

So from this behavior what I think is that if it is (same code) working in standard asp.net than there is not any problem in control but because it is rendering in SharePoint and because of SharePoint’s JavaScript/JS and its CSS it conflicting with something while rendering.

So first I start with CSS because defiantly it’s easy.

Now if you check your AjaxControlToolKit -- > sample website --> StyleSheet.css

You will find two css class under “/*CollapsiblePanel*/”

One is “.collapsePanel”
Other is “.collapsePanelHeader”

So I used it in my .ascx (sorry I forget to explain that I’m using user control for webpart)
By adding <style type="text/css" > </style> tag.

As we are not facing any problem in header so there is no need to touch that CSS.

So by trial and error I found one solution.

I have to add in the div of content panel
style="height:0px;position:absolute;”

And have to set two properties of “CollapsiblePanelExtender”
CollapsedSize="0"
ExpandedSize="700"


Here is the working code


<style type="text/css" >
/* IE theme – Backgrounds */
.collapsePanel {
background-color:white;
overflow:hidden;
/*height:0px;
position:absolute;*/
}

.collapsePanelHeader{
width:100%;
height:30px;
background-image: url(images/bg-menu-main.png);
background-repeat:repeat-x;
color:#FFF;
font-weight:bold;
}
</style>

<asp:Panel ID="Panelheader" runat="server" style="cursor:pointer;" >
<div id="div1" runat="server" >want to check its working or not ?</div>
</asp:Panel>
<br />
<asp:Panel id="Panelcontent" runat="server" >
<div id="div2" style="height:0px;position:absolute;" >
your data will go here
<br />
<br />
<br />
it's working ....
</div>
</asp:Panel>
<cc1:CollapsiblePanelExtender
ID="CPanelGeneralInformation"
runat="server"
TargetControlID="Panelcontent"
CollapseControlID="Panelheader"
ExpandControlID="Panelheader"
Collapsed="true"
SuppressPostBack="true"
AutoCollapse="false"
AutoExpand="false"
ScrollContents="false"
ExpandDirection="vertical"
CollapsedSize="0"
ExpandedSize="700"
>
</cc1:CollapsiblePanelExtender>

Wednesday, July 9, 2008

Ajax control toolkit Tab container header display issue with moss

Using Ajax is very complicated.
And when it comes with SharePoint than nothing worst like that.

Recently we are starting implementing ASP.NET AJAX with SharePoint.
And while implementing we came to know that we were wrong.
Its more challenging then what we are thinking.

Here I am explaining a problem with Ajax control toolkit’s Tab Container.
While implementing we came to know about this header display problem.

We are getting header text of the tab is only half. Other half is not displaying.
Than after googling we came to know that this is known issue.

But even after searching for 4 hours we are not getting the except problem solution for moss.
So I found that the same problem is in DNN(Dot Net Nuke) also.
and found an article how to solve it in DNN here

The only thing you have to do is that.

Add following style in you webpart.
<style type="text/css">
.ajax__tab_xp .ajax__tab_tab {
height: 21px;
}
</style>


I tried it in my webpart in MOSS.
And BINGO.

So enjoy the AJAX.

Wednesday, June 4, 2008

Finding CSS in MOSS

While developing custom webpart, we always wonder for which style sheet class to use.
And try to find out by checking view source of the default page.

Here is the link for
CSS Reference Chart for SharePoint 2007 (Microsoft Office SharePoint Server 2007 and Windows SharePoint Services v3) by Heather Solomon.

This is the wonderful post by Heather Solomon which helped me to solve my many GUI and CSS related problems.



Share your SharePoint Experiences with us...
As good as the SharePointKings is, we want to make it even better. One of our most valuable sources of input for our Blog Posts comes from ever enthusiastic Visitors/Readers. We welcome every Visitor/Reader to contribute their experiences with SharePoint. It may be in the form of a code stub, snippet, any tips and trick or any crazy thing you have tried with SharePoint.
Send your Articles to sharepointkings@gmail.com with your Profile Summary. We will Post them. The idea is to act as a bridge between you Readers!!!

If anyone would like to have their advertisement posted on this blog, please send us the requirement details to sharepointkings@gmail.com