Ellis Posted June 13, 2003 Posted June 13, 2003 For some reason, when I fill my datagrid with data. The scrollbars dont seem to be enabled until I adjust the width of one of the columns manually. How could I do this in code so the scrollbars are available immediatley, straight after datagrid has been filled? Any help would be appreciated. Quote
wyrd Posted June 13, 2003 Posted June 13, 2003 Scroll bars don't show until the width or height of the DataGrid goes past the edges of it. If in your case the width/height is past the edges of your DataGrid and the scroll bars still aren't showing, then I'm not really sure what to say.. odd bug. Perhaps you disabled the scroll bars by default on accident? (I believe there's a property in the properties window to do this) Quote Gamer extraordinaire. Programmer wannabe.
Ellis Posted June 16, 2003 Author Posted June 16, 2003 Hi wyrd, Thanks for your reply. The width/height of my datagrid does go past the edges. Im not sure which property is used to enable scrollbars on a datagrid. The datagrid doesnt seem to have one??? It just seems strange that although the scrollbars appear after the data is filled, it wont let me use them until ive adjusted the row height or column width (during runtime). Quote
topo Posted June 23, 2003 Posted June 23, 2003 I was fighting with it myself but then I found http://www.makeitscroll.com... you might want to give it a try. Quote
dalmond Posted November 10, 2003 Posted November 10, 2003 DataGrid Scrollbars I did not find a property in the datagrid to control the scrollbars. I would like to disable the horizontal scrollbar altogether. Does anyone know how this can be done? Quote
pcPirate Posted November 11, 2003 Posted November 11, 2003 well, there's a website : http://www.syncfusion.com/faq/winforms/search/876.asp the website is about : Forcing the vertical scrollbar in my DataGrid to always be visible Dalmond , Why do you want to disable the horinzontal scrollbar??? pcPirate Quote Be you his eunuch, and your mute I'll be: When my tongue blabs, then let mine eyes not see.
dalmond Posted November 11, 2003 Posted November 11, 2003 Well, I have the datagrid columns at fixed widths so there is no need for the horizontal scrollbar, yet it still appears on the grid and at times it blocks the last row from being seen. If I could turn it off it would fix this problem. Quote
pcPirate Posted November 12, 2003 Posted November 12, 2003 Then, why don't you try to change the width of the column? I think the reason the horinzontal bar come out is because your column width is wider than your datagrid width. pcPirate Quote Be you his eunuch, and your mute I'll be: When my tongue blabs, then let mine eyes not see.
dalmond Posted November 12, 2003 Posted November 12, 2003 That's what I thought so I readjusted the column widths and for some reason that didn't fix the problem, so then I went looking for ways to turn it off. Quote
pcPirate Posted November 14, 2003 Posted November 14, 2003 (edited) Dalmon, try this. This derive from DataGrid. public class MyDataGrid : System.Windows.Forms.DataGrid { public DataGrid myNewDataGrid = null; public MyDataGrid() { this.myNewDataGrid = new DataGrid(); this.HorizScrollBar.Size = new Size( 0, 0 ); } } This actually set the horizontal scrollbar's size to zero but it does the trick. Hope it helps. pcPirate Edited November 14, 2003 by pcPirate Quote Be you his eunuch, and your mute I'll be: When my tongue blabs, then let mine eyes not see.
dalmond Posted November 14, 2003 Posted November 14, 2003 Thanks pcPirate, After converting the code to VB.net it worked great!. Dennis Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.