C# - RadGrid Column Editable On Insert But Set To Readonly On Update?

Nov 6 10 at 1:56

I have a RadGrid which has a column like:

<telerik:GridTemplateColumn HeaderText="Car" >
<asp:Label ID="MakeLabel" runat="Server" Text='<%# Eval("Make") %> />
<asp:TextBox ID="MakeTextBox" runat="Server" Text='<%# Bind("Make") %> />
</telerik:GridTemplateColumn >

and I'm wanting to set it up so that this column will allow input when inserting new values but won't when updating values.


Forms Data Controls :: How To Update Row On Editable Gridview Depending On Two Column

Jun 29, 2010 10:54 AM

Solved like this

currentID = Convert.ToInt32(GridView_ABC.DataKeys[0].Values[0]);
activityName = Convert.ToString(GridView_ABC.DataKeys[1].Values[1]);
DataRow row =
originalDataTable.Select(String.Format("EmployeeID = {0} AND ActivityName = '{1}'", currentID, activityName))[0];

View 1 Replies View Related

How To Make A Readonly Text Box Editable On Mouse-over Using J Query

Aug 15 10 at 7:47

I have a read-only text-box with text in it. How to make it editable on mouse-over using J query ?

View 1 Replies View Related

Only Allow One Edit Or Insert In A RadGrid?

Jul 22 10 at 17:30

I'm using the Telerik rad grid and I'm allow the user to enter data directly to the grid.

I am using the "EditForms" edit mode and I also allow inserts using the same.

If the user edits a row, then I don't want to allow any other edits or inserts until the current one is complete or cancelled.

View 1 Replies View Related

Update Gridview Getting Error("Cannot Insert The Value NULL Into Column )

Feb 9, 2009, 13:23

I have a gridview.I modified the gridview to display 2 dropdowns instead of a textbox when editing.(the 1st and last columns)When I edit the grid (with my edit button), everything shows up fine, textboxes and dropdown where supposed to. The problem is if I make a change in a value. When I hit "update", I get an error:

"Cannot insert the value NULL into column 'PagTipoID', table MPLServicos.dbo.tblPagamentos'; column does not allow nulls. Update fails. The statement has been terminated".

I understand the error. I just don't understand what to do to correct this.Why can't the grid get the seleccted value of the dropdown from the 1st column? (the one originating the problem).

My code.VBNET Code:
<asp:UpdatePanel ID="UpdatePanel4Grid" runat="server">

View 6 Replies View Related

Insert Item Button From Within A Radgrid Row?

Mar 30 at 18:52

I want to take an already existing row in a RadGrid and instead of open an edit template I want to open the Insert template with that data.

I have a requirement to allow the user to make edits to the rows on their "key" values, the result being a new row that they didnt have to type everything over again.

My guess is to put an insert button on the row, but I'm not sure how to open the insert template and still have it bind that rows data to it.

View 1 Replies View Related

C# - Truncate Text In RadGrid Column?

Jan 19 10 at 15:21

using Telerik RadGrid* in a LINQ context, with ASP.NET/C#, how to truncate text to a maximum length when displaying in columns? By maximum, I mean if original string's length is shorter than the specified maximum length, no errors will raise.I have seen many examples of this on the net, but it seems that the Container.DataItem used to achieve this is different when using LINQ. Sometimes we see DataItem as a method, sometimes not. Examples are usually using a DataSet.Here's an example found (source) :

<asp:TemplateField HeaderText="Description">
<%# ValidateString(Container.DataItem("Description")) %>


View 2 Replies View Related

C# - Telerik RadGrid - How To Set The MaxLength For The Insert Textbox

Jul 23 10 at 12:15

I have a radGrid on the page with the "Add New Record" button. When I click the "Add New Record" button, a textbox appears above each column that allows me to enter values. I want to limit the number of characters that can be entered in the textbox. How do I set the MaxLength of those textboxes

View 1 Replies View Related

C# - Extra Column Appearing When Paging In Telerik RadGrid?

Oct 5 10 at 13:19

I'm getting a blank column when switching to another page using the default pager in the telerik radgrid. As data for each row, it shows the type of data i am using for the rows (SearchRecord)

Anyone have any clues as to why this may be happening? It doesn't show up on initial population of the grid, but only when I do paging. My columns are built dynamically but i confirmed that when my columns are built, they are the correct number.

View 1 Replies View Related

Column In DataView Not Rendering When Databound To DataGrid (or RadGrid)?

Sep 7 10 at 6:51

Using ASP.NET Web Forms.I am databinding a DataView to a DataGrid with AutoGenerateColumns set to trueThe final column of the DataView is not rendering.Using the debugger I can see that the column definitely exists in the data grid's datasource. The column is of type decimal and some of the rows in the column have data in them.The column has a column name.The other columns are rendering fine.What's going on?Some more infoFunnily enough, I can set AutoGenerateColumns to false, then just add the columns manually:

foreach(DataColumn column in dataView.Table.Columns)
datagrid.Columns.Add(new BoundColumn {
HeaderText = column.ColumnName });
datagrid.DataSource = dataView;

This works fine. Why can't .NET do this with AutoGenerateColumns?

View 1 Replies View Related

Best Practice To Manage Telerik RadGrid Grid And Column Widths?

May 25 10 at 10:12

I wanted to ask what is the best practice to manage width of the radGrid.

For my application most users are running 1280 x 1024 so I would be happy to set my overall grid width to 1100. However, depending on the form in use, I sometimes have horizantal scroll bars. To solve this, I have been playing with the width of the grid, and also I have played with setting the itemstyle-width for one or two columns. Sometimes I accidentally get it right, and sometimes it is not quite right.

What is the best way to manage this? Do I set the grid, and then all columns, or just the grid, or just the columns? I guess there is a best practice, so just wondering how you handle it,

View 2 Replies View Related

Editable Column In Gridview?

Nov 9 09

I created an ASP.NET 4 columns gridview programmatically using VB.NET. The first two columns are bound to checkboxes and a database. When the user selects one or more checkboxes the database information populates the first two columns. I want the user to be able to enter data into the second two columns' rows. Is this possible and, if it is, how is it accomplished? Following is the code for the gridview:


View 9 Replies View Related

Radgrid Edit / Update Not Working?

Oct 26 10 at 23:48

I'm having a wired problem with Radgrid.. Im using a Radgrid to display some results where the user can edit/update/delete them. I'm using a single SQL Server 2000 table to fetch the results... Not sure why the events are not firing in radgrid. But I am able to do it successfully using the Gridview control... Im using .NET framework 4

Radgrid code

<telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="False" AutoGenerateDeleteColumn="True"
AutoGenerateEditColumn="True" DataSourceID="SSDS" GridLines="None" Width="844px"

View 1 Replies View Related

Using Telerik RadGrid - How To Set The Date Format For Autogenerated Column In Edit Mode

May 23 10 at 11:54

Using VS2008, and Telerik radGrid version 2010.1.519.35

I have a about 50 DNN modules using telerik radgrid and I need to display my dates in dd/mm/yy format. It is possible to do this easily in view mode, but when I switch to edit mode, it is more of a struggle. I can write a snippit of code to reformat the displayed date values to dd/mm/yy, but for inserts the user must enter mm/dd/yy.

IOW, I need to change the culture of the form to en-GB culture.

In my DotnetNuke App, I have made a change to the web.config, but it still assumes en-US format.

I am not sure whether I need to set this at web.config level, page level or at the column within the control.

View 3 Replies View Related

Forms Data Controls :: Showing Image In One Column In Radgrid Using Values From Database?

Jan 19, 2010 07:48 AM

I am having one column in each row of my radgrid in which i want to show an image. I am getting values from database saying 1,2 for that particular column and for each of these values i want to show different images for different values. For Example if i am getting 1 from database i want to show "roseImage" and for 2 i want to show "lotusimage",

View 3 Replies View Related

Forms Data Controls :: Set ReadOnly For A GridView Column In C#?

Apr 11, 2010 03:14 AM

I need to change ReadOnly from false to true for one column in GridView depending on who the user is. In my particular case it is a BoundField (also I would like to know how to do it for a Template field as well) and DataField is "dteRequired". I would like to code something like that right in the Page_Load handler:

View 8 Replies View Related

C# - Make A Specific Column Editable Upon Clicking Edit?

Jan 22 at 16:44

I have a gridview with "Edit Update Cancel" command field. When I click Edit, all the columns in the particular row becomes editable. I just need to have 2 specific columns editable. How is that made possible ? (Screen Shot Attached) [In the screen shot all 3 columns are editable, I just need the second and third to be editable]

View 2 Replies View Related

Forms Data Controls :: Formview Default Insert - Need ReadOnly View

Mar 22, 2010 11:34 AM

I'm using a formview in Insert mode with an AccessDataSource. I want to switch to readonly mode upon insertion to let the user confirm the input worked, then give them the option to insert a new record. If I set the DefaultMode to Insert, then after the first record is inserted, I get a new blank insertion form (no confirmation). If I set the DefaultMode to ReadOnly, after insertion, I get a blank form (presumably because I am not on the record just inserted).

How do I get the just inserted record to display? If I need to set the ID of the formview to the just inserted record OnInserted, how do I get that given I'm using an AccessDataSource?

View 6 Replies View Related

Forms Data Controls :: Creating An Entirely Editable Column In A GridView?

Jan 25, 2010 04:43 PM

I am looking for a way in which to make a column in a GridView editable.

Currently i am looking into overriding the GridView so that the whole view is editable and then making all the column I do not want to be editable, read only.

I'm sure there is a better way, but I cant find it.

View 1 Replies View Related

Forms Data Controls :: Insert A Button Called Update And When Press Button The Price Column?

Feb 01, 2010 06:05 AM

I have a Data Grid View which display values from a SQL Query, and inside the data grid view I have two template fields one is Quantity and it is a text box and the other is Total Price and it is a label.

What I want to do is to insert a button called update and when I press this button the price Column should be multiplied by the quantity Column and the result should be displayed in the total Column.

View 11 Replies View Related

Forms Data Controls :: Setting GridView Column's ReadOnly Attribute From Code?

Sep 23, 2009 05:09 PM

My GridView has a CheckBoxField bound column that I want to make ReadOnly for all rows based on user's permissions. This doesn't appear to be an option with the ReadOnly property eventhough other properties are available for setting in the PageLoad event.

For example, I can do this:


But I can't do this:


View 7 Replies View Related

How To Make GridView Column Read Only / Editing Whole Row Of The Grid Is In Editable Mode?

Jun 2 10

I am using Gridview and on that data is binded conditionally.the problem is that at the time of editing whole row of the grid is in editable mode and i want only few of the columns editable. my code is as follows


View 4 Replies View Related

Gridview Mode Not Changing Back To Readonly After Update?

Aug 19 09

I am having Trouble with a Gridview control In my asp.net/C# application. It contains Some boundFields and one checkbox field. My gridview allows Editing. It succesfully enters edit mode and when i hit update the Datasource updates but the control will not return to readonly mode. I have gone far enough to figure out the problem is caused by the Checkbox field.The checkbox works and passes the correct true/false value to the datasource but will not bind after update When I Make it readonly and remove that value from my Stored Procedure the Gridview control works normal.

View 15 Replies View Related

C# - When Update A Field With ReadOnly Mode In GridView ,value Of That Is Empty?

Jul 2 10 at 11:20

One of the few fields that have their ReadOnly property equal to True then Edit and Update the value field is empty ReadOnly property is recorded.I also have a ReadOnly property and its value is not empty. (GridView to the SqlDataSource is connected)

View 1 Replies View Related

Retrieve Readonly Values When Using A DetailsView Control To Update A Record?

Mar 24 10 at 19:15

I'm using a detailsview control to update a record, however in this particular case there's only one field that can be changed out of a many. The update method for my object takes all fields as parameters. When the detailsview's updating method fires, the values for the readonly fields (those rendered as a Label) are not available in the e.NewValues collection.

I'm currently grabbing a reference to the object when the detailsview is databound (in the objectdatasource selected event handler), storing it in session and manually adding entries to the e.NewValues collection when updating fires. It works but seems kind of heavy handed. So, is there a better way to get the read only values back into my update method? Or is there a better way of doing this altogether?

View 1 Replies View Related

Web Forms :: Allow Users To Update The Records For The Textboxes With Readonly Property Set To True

Apr 12, 2010 02:46 AM

In my asp.net application, users are allowed to enter values into textboxes only from popup windows, so i have set the textboxes to readonly=true; this works fine for me until the first the record is saved. when the record is retireved from database and user updates these textboxes from popupwindows and tries to save the record, the record is never updated, i know the reason because textboxes with readonly cannot be changed on the clientside.

how to allow users to update the records for the textboxes with readonly property set to true.

View 4 Replies View Related

Forms Data Controls :: GridView Trying To Update ReadOnly Property On Object?

Jul 05, 2006 08:59 PM

I am using an ObjectDataSource with a gridview that has a readonly ID column like below:


The ID property on my object is set to protected as this cannot be set externally from the object. However, when I edit a row in my gridview, it throws the following exception:

The 'ID' property on the type specified by the DataObjectTypeName property in ObjectDataSource '_dataSource' is readonly and its value cannot be set.

Is there any way that I can prevent the gridview from attempting to update the ID column or will I have to code the object update manually?

View 7 Replies View Related

Forms Data Controls :: Editable Gridviews - Updating Rows Not Editable / Bound

Jun 30, 2010 08:25 AM

Note: Code is taken from this tutorial [URL] I currently have an editable gridview with only some columns editable by the user. In the background I want to record the time/date they have saved the data to the grid. This column 'Time' is not bound to the grid. Is there anyway I can still include this update when rebinding the newly edited data?

I'm also having a problem saving the updated data of my column ActivityTotal. I've been debugging that and following the variable, and it holds the correct value, but just doesnt seem to update. I am providing the codes below for both my gridview and the cs behind and would be grateful if someone could take a look, I assume it's a sort of minor sql issue on my part.


protected void UpdateButton_Click(object sender, EventArgs e) { originalDataTable = (DataTable)ViewState["originalValuesDataTable"]; foreach (GridViewRow r in GridView_ABC.Rows) if (IsRowModified(r)) { GridView_ABC.UpdateRow(r.RowIndex, false); } // Rebind the Grid to repopulate the original values table. tableCopied = false; GridView_ABC.DataBind(); }

View 4 Replies View Related

VS 2005 GridView Update - Make Editable - All Active Fields Unchecked

Dec 23rd, 2009, 08:21 PM

I am using GridViewand bounding values from 2 tables. tbl_login and tbl_register. In tbl_register Table the Field is UserName In tbl_login Table the Field is Active(yes/no field) I used this command to show the fields into the gridview.


SELECT tbl_createuser.UserName, tbl_createuser.Role, tbl_login.Active FROM (tbl_createuser INNER JOIN tbl_login ON tbl_createuser.UserID = tbl_login.UserID1) ORDER BY tbl_createuser.RegistrationDate DESC

Initially when the user register, his account is inactive. The admin only wants to make the account active. After showing the fields in gridview, how to make it editable, initially all the Active Field is unchecked, so when the admin checks it, it must be updated to the database?

View 26 Replies View Related

Forms Data Controls :: Make Editable Gridview - Add - Update - Delete

Feb 24, 2010 01:58 PM

I've got my data in the gridview via:


Now I need to make all the data editable (add, update, delete). Why isn't the Gridview the same as DataGridView? With the DGV, the data showed EXACTLY as it did in the database and one could add a record, edit a record, or delete a record.

View 2 Replies View Related

Forms Data Controls :: GV Update Database With Readonly Fields Send Null Values?

Dec 08, 2009 01:11 PM

I'm using wizard generated update statements and the following field sends null because of the read only flag, is there any way to get around this, except rewriting the entire update procedure in codebehind?

DataField="Credit" [code]....

View 4 Replies View Related

Forms Data Controls :: An Editable Details View Control The Databinding Of Gridview Once Update Is Clicked?

Nov 23, 2009 01:57 PM

I have a gridview that allows you to select a row, and then display the details view. The details view is editable. In the details view, the user has the option to change the records status to "Remove". If that happens, I need for the initial gridview to "refresh" so that this record with a status of "Remove" is no longer included. How do I get a button in my editable details view to control the databinding of the initial gridview that is populated by a sqldatasourceID?

View 1 Replies View Related

SQL Insert - How To Combine More Than One Field Value To A Single Column Insert

Jan 18, 2010, 21:00

I have a form with many form fields and controls, with some offering an "other" if a value does not meet the needs for the user. How can I bind the sql insert so that it will take the ddl selection along with the txt field selection for the "other" value? Even if the txt field is empty it should not be a big deal since the ddl would provide something other than null. Since the column in the db does not allow nulls. I'm using asp.net (vb) 3.5 sp1

View 3 Replies View Related

Custom Server Controls :: Show Multi Column Gridview With Editable Controls?

Nov 16, 2010 09:04 PM

Any one know any open source user control that is similar to gridtreeview. Basically, I want to show a multi column treeview that when expanded, user can edit certain column values. The columns can have a text box or dropdown etc.

View 8 Replies View Related

FormView From Insert Mode To ReadOnly Mode

Feb 23, 2011 05:07 PM

have a WebForm with a Form View to insert new items in my database.These items that i will insert also are conected to other many-to-many relations that i also wanna add after my new item is inserted.For Example: With the classic Autors-Books data base (autors with many books each books with many autors), i want a FormView that for defoult enter to the InsertMode where you will add a new Autor with name, age, style, etc... After you insert this new autor i wanna show the details of this autor but also his books (when new this table will be empty) and below that table i want a button that says "Add a new book to this autor"

View 1 Replies View Related

DataSource Controls :: Sql Insert Failing On Detailsview Insert Or Update?

Mar 06, 2010 05:11 PM

I am using 1 textbox with a Ajax Calendar extender to allow my user's to select a date graphically (exp: 12/15/2009). I have another textbox for the hour and minutes in military time(exp: 15:30). I think i have the code to grab the data from the 2 textbox's and combine them to be inserted into the field (exp: 12/15/2009 15:30). Here is my insert code for the Field:


However unless I make all the fields Nullable the insert fails, on top of that none of the other field that I have selected on the Detailsview Insert or Edit are inserted into there fields. Half of my fields have to be non-null values. So how do I fix this?

I can supply additional vb code and the aspx code if needed.

This is the error I'm getting: Cannot insert the value NULL into column 'Operation_type', table '/GAOSDB.MDF.dbo.BC_Perf_Log'; column does not allow nulls. INSERT fails. The statement has been terminated.'

This is the first non-null column.

I need to get this figured out because I have 30 other web pages that will be utilizing the same approach.

View 4 Replies View Related

SQL Server :: Update Column Into Identity Column By Removing Null Values?

Aug 10, 2010 03:05 AM

I have a table converted from Access and the identity keys were lost. Now I need to make the id column the identity column, but it already has a lot of null values, how do I auto generate integer values for the null rows? The row ids are incremented, so if there is a way to auto increment the ids

View 7 Replies View Related

SQL "index" Field Cannot Be ReadOnly For Update To Work

Apr 2 09

Using GridView and SqlDataSource I found that an index field defaults to "ReadOnly=True" and I have to change it to False and then hide it before my sql UPDATE command works. This seems awkward and I was wondering if there was a better way of getting a GridView to work with MS SQL.


-SelectCommand = "SELECT * FROM xxx"
-UpdateCommand="UPDATE xxx SET yyy WHERE [index]=@index;

The SELECT gets "index". If I explicitly code the select so that index is not fetched, the UPDATE will never work.

I tried removing index from the GridView as I didnt want it to be monkied with by the user but I found that the SQL UPDATE does not work if index is not a bound field. Seeming, it has to show up somewhere in the GridView. If I set ReadOnly to true, then the user cannot edit the index field, but I cant make the SQL UPDATE work either. So I set the index field "ReadOnly=False" and then I hid the column and the SQL UPDATE started working fine.

View 1 Replies View Related

How To Replace With Having Only One Button In Footer Of The GridView That Can Update All The Rows In The DtTable By Timesing Price Column To Quantity Column

Jan 30, 2009 02:33 PM

I have a datatable as Shopping Cart and GV to display the Columns in the DT, also I have another Column Update, so every Row has an Update Cell that calculates the Subtotal by timesing The quantity Column to Price Column. How can I replace with having only one button in Footer of the GridView that can update all the Rows in the DtTable by timesing Price column to Quantity Column. something like Looping through all the rows.

View 9 Replies View Related

Forms Data Controls :: Gridview Perform Update And Insert At The Same Time (in Edit Mode When Clicking Update)?

Nov 06, 2009 08:16 PM

Is there a way to perform and update and insert at the same time?I have a gridview and in edit mode I need the user to check a check box, when they click the Update button to save the data I want to 1st update the table my data is coming from with some value and I also want to insert some data into another table for tracking purposes. Is there a way to do this?If so can you also provide a ling to learn more about this or a code snippet as well please.

View 6 Replies View Related

Copyrights 2005-14 www.BigResource.com, All rights reserved