Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I develop a Webpart, which should be deployed in other SP-Farms.
The Webpart contains a DataTable.
I deployed the solution and the DataTable appears in the right side of the Website.
I'm using a gridView and have some style-components like margin-right: 50px.

I understand that the Table appears in the right side of the Website, but is there a opportunity to get the Table only into the Webpart?

at the momemt

should be

I use a GridView and want to do the css here with the cssstylecollection. but it doesnt really work?

cssstylecollection

share|improve this question
    
Hi Grekko, I'm not sure what you are asking, to clarify could you possible post an image of your issue? I gave you 5 points for your post which should give you enough to post the image. –  Hugh Wood Nov 28 '12 at 15:15
    
The DataTable should be in the WebPart no matter how big the size of the Screen or the browser is. –  grekko Nov 28 '12 at 15:34
    
Hi Grekko, this looks like a CSS issue definitely. Are you able to go to jsfiddle.net and paste an example of the offending html there from the issue, and we can have a play and make it fit? –  Hugh Wood Nov 28 '12 at 15:50

1 Answer 1

up vote 0 down vote accepted

hi can you please post your css, its all todo with the position element weather it relative or absolute, also set the display to block. So the two element should have the following css:

.treeviewcss
{
  float:left!important
  display:inline-block!important;
}

.datatable
{
  float:left!important
  display:inline-block!important;
}

add this class to 12hive:

for me I have a master css class that add other css classes too it like for webparts using import directive.

@import url (/_Layouts/1033/styles/customfolder/webparts/thisIsTheCssFile.css);

but you can do the following:

protected override void CreateChildControls()
{
    CssRegistration.Register("/_layouts/STYLES/WebPartName/styles.css");
}

http://stackoverflow.com/questions/536734/how-to-use-custom-css-with-my-sharepoint-webpart

within the code where your creating your object you need to assign the cssclass class name to the control you want changing, so as an example:

    protected override void CreateChildControls()
    {
       TreeView tv = new TreeView();
       tv.CssClass = "treeviewcss";

       DataTable dt = new DataTable();
       dt.CssClass = "datatable";
    }

hope it helps :)

share|improve this answer
    
the float:left!important and Display:inline-block!important were very helpful. thanks. –  grekko Dec 5 '12 at 14:22
    
your welcome! glad to be of some help –  ali Sharepoint Dec 5 '12 at 14:32

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.