index > Visual C# General > scrollable datagrid

scrollable datagrid

Is it possible doing a vertical scrollable datagrid? How?

I won't page!!!

Thx




Player of Age of Empires 2 - The Conquerors
manuel0081

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.




** Microsoft Community Moderator ** http://born2code.net **
PJ. van de Sande

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>

...




Player of Age of Empires 2 - The Conquerors
manuel0081
Put it in a <div> so it will be:


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

 




** Microsoft Community Moderator ** http://born2code.net **
PJ. van de Sande

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!




Player of Age of Empires 2 - The Conquerors
manuel0081
1. Give the div a 100% width to.
2. Just ignore the VS warning.

A div got a scroll attribute:

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




** Microsoft Community Moderator ** http://born2code.net **
PJ. van de Sande
sure? Visual Studio 2003 tells me that there isn't...i'm writing in a web user control


Player of Age of Empires 2 - The Conquerors
manuel0081
Give it a try! First try it, then screem here when it doesn't work.



** Microsoft Community Moderator ** http://born2code.net **
PJ. van de Sande

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




Player of Age of Empires 2 - The Conquerors
manuel0081
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.



** Microsoft Community Moderator ** http://born2code.net **
PJ. van de Sande

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>




Player of Age of Empires 2 - The Conquerors
manuel0081

Read post before:

i solved in this way:

<div style="overflow-y:scroll; height: 100px">


Player of Age of Empires 2 - The Conquerors
manuel0081
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.


** Microsoft Community Moderator ** http://born2code.net **
PJ. van de Sande
reply 13

You can use google to search for other answers

 

More Articles

• Reading from xml file
• emitting javascript - error in my class file
• function ptr
• directX 9.0 rendering a DIB buffer
• Group by time period which spans two dates!!! HELP
• changing DataGridView cell border style on DragOver
• native types
• Dumm Question From Dumm NewBie
• Using a C# dll with a VB 6 front end.
• Resizing Form
Bookmark and Share
Welcome to Bokebb   New Update  
 

New Articles

• Enable to Change Icon button of a primar
• could not see results after sql server s
• Exceptions and objects
• finding c# memory addresses using visual
• Safe UI Wireup in Multithreaded Applicat
• BackgroundWorker and SHGetFileInfo
• How i can zip files with SharpZipLib
• how to block hot keys on excel, word or
• How do I clean out the Recycle Bin?
• Special Assignement
• How to Display Image From Byte
• e.Graphics = picCapture.CreateGraphics();
• Hook Alert or AntiHook for Specify Process
• assembly file
• C# 2005 Online or Offline

Hot Articles

• Web Application Problem
• select statement
• (INTEGRATE) Convert a string to a Function
• How get inner class info by Reflection
• Threaded Controls
• String literal problem
• How can I resize a form when border styl
• IRecordInfo::RecordCreate(), IRecordInfo
• datarow
• Refresh Desktop
• Could not load type with framework 2.0
• get a list of all local drives?
• click event
• Add events for dynamically generated Dro
• using Arrays with unknown size

Recommend Articles

• Sending Email using C#
• How to convert string to expression
• attempting to use an array across a class
• Unknown Object
• Datagridview bound to two related tables?
• Save Combobox items to file (not .txt)
• c# and .mdb files
• Using a variable to select an array
• How to make toolbar
• Random give the same value
• Forcing VS2K5 not to use partial classes
• Button_Click Event
• visual c# and crystal reports 10
• datagrid shows null
• How are Delegates used?