[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

DevExpress - ASPXGridView - Limiting number of entries

Posted on 2010-11-15
9
Medium Priority
?
1,625 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
9 Comments
 
LVL 3

Assisted Solution

by:Epitel0920
Epitel0920 earned 500 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 500 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
Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

 

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
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…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…

656 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