Forms Data Controls ::restrict Edits In A Gridview Column?
Feb 5, 2010
Is there a way to restrict being able to edit a gridview column to some users but not to others ? Say setting the column to read only and then resetting it when the row is in edit mode.
View 2 Replies
Similar Messages:
Aug 20, 2010
I have a form that collects some dates. The users can go to this form any time, view the data, and edit the data.
The user should only be able to enter today or future dates only. We don't want users to go in here and be able to past date these dates.
So I created a compare validator which compares the text box against today's date. This works great. The user saves the form and life goes on.
But then, lets say they come back 1 week later and want to change a date. Now all the old dates will fire this validator and they can't save anything unless they change all the dates to today or newer. This is a problem.
So what I thought was when I load the form with the data from the database, I would just disable the validator if there is a date, and if it's null enable the validator. But this won't work because then they can back-date all of those dates with the validator disabled.
So for the dates that are not null, it shouldn't fire the validator unless they change the date.
When I load the form, I'm going to load all these dates into Viewstate. I'm going to create a custom validator and check the value they enter against the previous date that is in Viewstate. If it matches that date then it is valid, if it doesn't match that date then I will run it through the validator to check for past-date.
View 3 Replies
Jan 11, 2011
I have a page with a gridview. It has a select command and an edit command which are both SPs. I added a standard "Edit, Update, Cancel" CommandField to the gridview so that I can edit. The edit and update are working fine. However, I have found that if the underlying data changes after I have loaded the page and before I hit "Edit", and this change causes the row I'm going to edit to be in a different row than before, the gridview will open the wrong row for editing.
For example, say the gridview is sorted by the a field called ID, and currently there are rows in the DB with ID of 2,4,6 and 8. I load the page and see those 4 records. While I'm looking, someone adds a record with ID of 1. When I click Edit on the row with ID = 4, I will actually end up editing the record with ID 2. Basically, i'm clicking on Edit in the second row, and I end up editing the record in the 2nd row, but the 2nd row is now a different record than before.
It seems like there HAS to be a way to fix this, otherwise editing in the gridview seems exceptionally dangerous. Is there any easy way to handle this, to make sure the user is editing the row they think they are?
View 17 Replies
Oct 29, 2010
I'm using Visual Web Developer 2010 against SQL Server 2008 R2.
I have a number of GridViews and FormViews working now, with edit functionality. However I have one field in my main database table that is of type 'Text'. With that one field, the edits won't take. I click Edit, change the text in the GridView, and click Update, but it just reverts back to the unchanged text.
It seems like I've tried everything. Is there a way to make that work without having to code it the hard way with a Textarea control?
View 4 Replies
Mar 31, 2010
I have a gridview bound to a sqldatasource with editing enabled. If I click Edit, then either Cancel or Update, the update or cancel occurs and the Edit button reappears. However, I cannot then click the browser's back button without having the Update and Cancel buttons reappear. A second click of the back button takes me to a state where the Edit button shows again, *then* another back button click will take me to the referring page (the one before the one with the gridview on it.) IOW, it looks like the postbacks are cached. How can I prevent this and have the back button go straight to the referring page?
View 4 Replies
May 10, 2010
User clicks the Edit Link Button on my grid and I want to launch a new screen for the user to do some edits...I need to be able to pull the ID but I cannot figure out what I need to pass to the HandleSelect function and then how to read my column3 to get selectButton.Attributes.Add("onClick", "return HandleSelect(????);")
View 8 Replies
Oct 12, 2010
I want to display gridview column heading when mouse over to the particular column in the gridview.I am working in VisualStudio 2005 with MS.Net2.0 framework.I don't want to use ajax.
View 4 Replies
Oct 29, 2010
[Code]....
Main Gridview[Code]....
View 3 Replies
Jan 6, 2011
I have a gridview which is binded to a Sqldatasource. I would like to replace a column data field value to 'Not Applicable' if that column has got a value of 2 in database.
View 2 Replies
Oct 12, 2010
want to display gridview column heading when mouse over to the particular column in the gridview.
View 9 Replies
Jul 22, 2010
How to add a button at first column of gridview and get cell value in another column?
For example, add a button named it as "Click me". Once user clicks will get third column cell's (ID) value.
View 2 Replies
Mar 4, 2011
No sense in showing a competely blank column. how to make a GridView column invisible if every cell in that column is empty?
View 3 Replies
Jul 14, 2010
I have a gridview with 3 columns. In second column I want to display some text in 2 rows and then a gridview.
Here is my code:
[Code]....
The problem is my third row is displayed as a row under first column. How do I make it a separate column in my girdview. Not sure what is going wrong.
View 11 Replies
Jan 8, 2011
I am using GridView ,I want to do a validation like if i edit any one of the Cell in that column, it will through the validation when the sum of column value is more than 100. How can i do this validation?
View 10 Replies
Apr 27, 2016
I saw post [URL] .... which is converting rows into column item,quantity ,price. I have one other image field .how can bind image in this program?
View 1 Replies
Aug 16, 2013
As per my requirement, I am getting CompID, Company Name and URL from SQL database. I want to display just CompName and URL in gridvew. So, I need to hide the CompID in gridview. One way I can do BoundField field Visible to false but I need to retrive that compID id when user selected any of the row. if I set visible to false user wont see any compID in gridvew but I want access the selected compID also using SelectedRow.Cells[1].Text..
View 1 Replies
May 7, 2015
I am using item template and eval function in the gridview to display the records. Can I add a coulmn which is not in the table?
I have to add some columns which is not in the table and assign the values from code behind to that particular column
View 1 Replies
Feb 3, 2014
I have a grid view with 4 columns and 12 rows. Getting the row index is not problem; ;however, I cannot find a way to get the column index of the cell that i select.
View 1 Replies
Jul 9, 2010
how to implement Insert feature to a grid view?I need to use fields with scroll bar inside of a grid view. Is that possible through the template field?
View 23 Replies
Mar 8, 2011
I have one filed that is encrypted using Rajindal algorithm and stored in MSSQL db.When I retrieve that column in gridview it's displayed in encrypted. I have the code that decrypts it but the problem is:How can I all loop throw this column values in the gridview and decrypt them all and display it in the gridview decrypted.See my code below:
[Code]....
View 9 Replies
Feb 9, 2011
I'm facing a wierd problem with GridView and ObjectDataSource. I bind GridView to my business objects via ObjectDataSource. Everything was working fine until I decided to add a new field in my buisness object and wanted to add a column to GridView to show it. Somehow that column is NOT shown in the GridView's list of available columns. I have tried refreshing schema, rebinding, etc. I'm using GridView inside a user control which is used as a web part. Does that make a difference ?
View 3 Replies
May 19, 2013
I have read your article from aspsnippets.com about custom paging it really work, but there are a problem that if there are more record in database (2000 to 5000) than  number of page index  will be goes in large number. like 1 to 200, any way which can divide it  like 12345678910...2000.
View 1 Replies
Jan 28, 2010
I want to use a value of a column from a selected row in a gridview as default value of a dropdownlist on a form on the same page. how to get this done in VB?
View 4 Replies
May 9, 2010
How to Get Column value of gridview in c #
[Code]....
[Code]....
View 2 Replies
Mar 15, 2011
I need to get the value of some columns in a gridview control.
Ive tried:
[Code]....
But that doesn't work. I get an error 'Identifier Expected'
View 3 Replies