Solved

DevExpress - ASPXGridView - Limiting number of entries

Posted on 2010-11-15
9
1,526 Views
Last Modified: 2012-05-10
Hi,

Im using the AsPXGridView from DevExpress and Im wondering if it is possible to limit the number of entries in the grid. For example, the grid may start with no entries and the user clicks 'New' and creates an entry.

When the user has added the maximum number of entries the 'New' button is removed and only 'Edit' and Delete are visible.  If they Delete an entry then New is visible again etc.

Is this behaviour possible?
0
Comment
Question by:pize
9 Comments
 
LVL 3

Assisted Solution

by:Epitel0920
Epitel0920 earned 125 total points
ID: 34141371
Have a counter increment each time they hit a New button and decrement when they hit Delete.
On page load have if counter > some ammount NewButton.Visible = false; else newButton.Visible = true
0
 

Author Comment

by:pize
ID: 34141461
What Im really asking if this is intrinsic to the grid itself.  The Grid is smart enough to know when there arent any entries at all as you only get the 'New' button.  When there is one or more you get New/Edit/Delete.  Im wondering if there is a property like 'MaxEntries' that can be set on the grid so that the New/Edit/Delete behave accordingly when that maximum is reached
0
 
LVL 7

Assisted Solution

by:mr_nadger
mr_nadger earned 125 total points
ID: 34144273
not according to intellisense or the gridview properties list, as Epitel said your best bet is to hide the button, possibly on the insert event if the row limit's been reached.

http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.gridview_properties.aspx

0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Accepted Solution

by:
pize earned 0 total points
ID: 34160309
Im actually talking about the AsPXGridView from DevExpress and not Microsofts GridView control.  Turns out there is a CommandButtonInitialise event on this grid in which I can check the rows in the grid and hide the buttons accordingly
0
 
LVL 3

Expert Comment

by:Epitel0920
ID: 34160372
The desired result has also been sugested by me and mr_nadger, it is objectionable that the asker be allowed to close the question without giving us the points and keeping the question in the knowledge base, especially since he decided to change the essence of the question after getting a possible solution.
0
 

Author Comment

by:pize
ID: 34215097
Yes, I am relatively new here and yes I am aware that I can choose as many comments in the solution.  As I didnt implement the suggestions as 'the solution' how can I award the suggestions points?  I would need to implement those to make sure they worked in order to classify them as 'A Solution'.

The properties comment was talking about a totally different grid than the one I had asked about.

I would have thought that the solution you actually use is the one most relevant as that has had some form of testing done against it.

Anyway, Im not too fussed with what you want to do in regard to awarding points etc, happy to award the points as you described


0
 

Expert Comment

by:_alias99
ID: 34216253
All,
 
Following an 'Objection' by Epitel0920 (at http://www.experts-exchange.com/Q_26622855.html) to the intended closure of this question, it has been reviewed by at least one Moderator and is being closed as recommended by  ModEErf.
 
At this point I am going to re-start the auto-close procedure.
 
Thank you,
 
_alias99
Community Support Moderator
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Problem to picture file 3 42
ASP.net VB.net Email  a webpage 3 26
Trouble with References... 5 26
Get String split 5 33
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now