none
scrollable datagrid

Answers

All replies

  • When you put more rows in a DataGrid that is gets outside of his visable bounds a scrollbar is automaticly shown.

    Edit
    I noticed that you last questions on the forum are webforms related, so when you want a scrollbar in a asp:DataGrid then just put the asp:DataGrid in a <div> or in a panel or something. Don't forget to set scroll = true.

    Thursday, January 12, 2006 12:27 PM
    Moderator
  • Yes, webform related...i have datagrid in a panel but panel has not scroll property in web application...

    Code:

    <asp:panel.........>

    <p>

    <asp:panel.......>

    <asp:datagrid ...........>

    <asp:columns>

    ...

    Thursday, January 12, 2006 12:56 PM
  • Put it in a <div> so it will be:


    <div scroll=true style="width: 100px; height: 100px">
        <asp:datagrid.... >
        </asl:datagrid>
    </div>

     

    Thursday, January 12, 2006 12:59 PM
    Moderator
  • Thx but it doen0s work!

    i have 2 problem:

    1.i have set datagrid width to 100%, ihave to remove it?

    2.visual studio tell me that that's not right place where put a "div". I solved it (because it was in <P> but now it said that div has not scroll property!

    Thursday, January 12, 2006 1:06 PM
  • 1. Give the div a 100% width to.
    2. Just ignore the VS warning.

    A div got a scroll attribute:

    <div scroll="true"> ... </div>
     

    Thursday, January 12, 2006 1:11 PM
    Moderator
  • sure? Visual Studio 2003 tells me that there isn't...i'm writing in a web user control
    Thursday, January 12, 2006 1:17 PM
  • Give it a try! First try it, then screem here when it doesn't work.
    Thursday, January 12, 2006 1:19 PM
    Moderator
  • obviously i try before...and it doesn't work...

    it says also width is not allowed in div... and even if i ignore it, i have not the scroll bar

    Thursday, January 12, 2006 1:23 PM
  • The div doesn't have a Width attribute. You must use CSS for that, that is why you need to specify the Width and Height in the Style attribute.

    You place a asp:DataGrid withing the div, when the asp:DataGrid is greater then the div where it is in, scrollbars are shown when the sroll="true" attribute is set within the div.

    I hope you understand it now.
    Thursday, January 12, 2006 1:27 PM
    Moderator
  • i understand but i can't do it...maybe it's some 100%...

    i have:

    <panel heigth =100%>

    <panel1>

    <div scroll="true">

    <datagrid>

    <button>

    </panel1>

    <panel2>...</panel2>

    Thursday, January 12, 2006 1:41 PM
  • Read post before:

    i solved in this way:

    <div style="overflow-y:scroll; height: 100px">
    Thursday, January 12, 2006 2:10 PM
  • Oke, so placing it in a div solved your problem, only you needed to set the overflow-y to scroll.

    This is browser indipended, scroll="true" isn't i read on a newsgroep.
    Thursday, January 12, 2006 2:45 PM
    Moderator