|
Hello !
Is there any possibility to modify the number of rows that a datagridview can show instantly ?
For example a datagridview can show 12 record instantly.
On runtime , is possible to make a modifications in order that the datagridview to show 10 records instantly ( the remaining datagridview area can be empty ).
Thank you !
|
|
|
|
|
What do you mean by "can show instantly"? The vertical size of the DataGridView?
|
|
|
|
|
I mean can show together in one page.
I want to modify this number ( but without changing the datagridview vertical size. )
|
|
|
|
|
If you don't use the DataGridView in databound-mode then you can set the number of rows displayed with its .RowCount -property. In databound-mode that is not possible.
|
|
|
|
|
No it's databound-Mode.
So you think there's no possibility to do that ?
|
|
|
|
|
If you want to restrict the amount of rows in databound-mode then you have to restrict the amount of rows in the datasource.
If your datasource is a DataView of a DataTable with some integer as primary key (or just any unique integer column) you could use the .RowFilter -property of the DataView to filter from the total rows the rows that should currently be displayed, e.g.:
dataView.RowFilter = "idColumn >= 10 AND idColumn < 20"
If the values of that column aren't consecutive you would have to scan the rows before and determine the actual value of that column at the position that should be the last on the page.
|
|
|
|
|
If a apply a filter , then the vertical scrollbar will be hide , and the user may think that there are no more records in the gridview.
|
|
|
|
|
The vertical scrollbar doesn't hide when applying a filter, unless the filter restricts the amount of rows to less than the height of the DataGridView. If that's not true for your DataGridView the reason must be somewhere else.
|
|
|
|
|
Yes , but if you read my first post , this is what I want t o do.
Actually gridview has for example , 36 records and he show 12 records per page.
I want to reduce this number for example to 10.
but the total height of 10 records is less than gridview height , so if I apply a filter to show 10 records , the vertical scrollbar will be hidden.
|
|
|
|
|
Alright, but what would a visible scrollbar change about the user possibly thinking that there are no more records when he scrolls to the end but in fact there are still more records? You will have to indicate that by something better than a scrollbar. Didn't you want to display something like <prev> 1 2 3 4 5 <next>? That would inform the user about more records.
|
|
|
|
|
the reason why I want this behavior , is because sometimes the last record on a page is not full displayed.
So the gridview shows 12 , but the last record is not full displayed. so I want to reduce the number to 11 or 10.
I know that I can make this by changing the gridview's height on design to full display the last record, but on runtime the user can resize the row's height so will be the same situation
|
|
|
|
|
|
|
Hi
I downloaded the source from a encrypt/decrypt program made by Thad Van den Bosch: http://www.codeproject.com/Articles/12092/Encrypt-Decrypt-Files-in-VB-NET-Using-Rijndael
and it gave me an idea to scare one of my friends with such a tool but i couldn't find out which type of code i had to edit so it would work in my project(I'm actually a beginner) so does anyone know how i could make my program encrypt folders at start and decrypt them in the end?
Thanks
|
|
|
|
|
Not an answer to your question but a well meant advice: If you get something working and you decide to pull that prank on your friend, make a backup of everything before. Best make an image of the whole harddisk. If your program for whatever reason fails to decrypt his files afterwards and you don't have a backup ready, he'll probably stab you.
|
|
|
|
|
hmmm yeah you're right i had it once so maybe i can try to make sure the program makes a backup of the drives itself on a remote server so he wont notice, otherwise he would see me on his computer with a external hdd copying files and saying i'm just looking
|
|
|
|
|
hi sorry for the late reply,
yes i was thinking about that too, so i made it hidden and it will first backup the drive and upload it to my ftp server and then it will start the main process
|
|
|
|
|
Member 11574509 wrote: I'm actually a beginner Then don't try this, it is far too easy to destroy everything if you do not understand what you are doing. As a test try it on your own system first.
|
|
|
|
|
Richard MacCutchan wrote: it is far too easy to destroy everything if you do not understand what you are doing
Heck, it is far too easy even when you do understand what you are doing...
Geek code v 3.12
GCS d--- s-/++ a- C++++ U+++ P- L- E-- W++ N++ o+ K- w+++ O? M-- V? PS+ PE- Y+ PGP t++ 5? X R++ tv-- b+ DI+++ D++ G e++>+++ h--- r++>+++ y+++*
Weapons extension: ma- k++ F+2 X
I use 1TBS
|
|
|
|
|
Oh yes, we've all been there.
|
|
|
|
|
I was already thinking for doing this on a test machine i've got from C programming
|
|
|
|
|
Hello !
Is there any possibility to implement a paging for a winform datagridview ? I like to do this in a similar way like in a webpage , where there's a navigation area in bottom with a Previous button followed by Page numbers and a next button at the end :
<Previous> 1 2 3 4 5 <Next>
Is possible to implement a similar scenario for a Winform Datagridview , so the users can navigate using Previous or Next button , or can access directly a specific page of records clicking on corresponding number. I've seen some models , but all have only Previous and Next buttons only , but not page numbers to access directly a specific page.
Thank you !
|
|
|
|
|
|
Thank , but I have the idea about the code I should use. I need help to build a navigation structure.
For example , if the number of records in the grid are <= the number of records that the grid can display , the navigation area should be like that :
<Previous> 1 <Next>
Where Previous and Next should be disables.
Is user add records and a some point he number of records goes over the number of rows the grid can display , the navigation area should be like this :
<Previous> 1 2 <Next>
where 1 is "clicked" , Next is enable , Previous is disable.
The user can remove records , or can add again .....etc.
So How can I build a navigation structure that can dynamically change on run time?
Thank you !
|
|
|
|
|
Surely at least one if not all of those half-suitable solutions already include the logic to disable the previous/next-buttons if there are less records than one full page. In that case you would also display the "1" disabled. And if the user adds records you would just have to re-evaluate that disable-condition.
|
|
|
|