Solved

DevExpress - ASPXGridView - Limiting number of entries

Posted on 2010-11-15
9
1,591 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 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
The Orion Papers

Are you interested in becoming an AWS Certified Solutions Architect?

Discover a new interactive way of training for the exam.

 

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

The Orion Papers

Are you interested in becoming an AWS Certified Solutions Architect?

Discover a new interactive way of training for the exam.

Question has a verified solution.

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

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
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 this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

688 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