We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Hide text boxes on inlineform add mode

Thread ID:

Created:

Updated:

Platform:

Replies:

119617 Jul 15,2015 06:21 AM Jul 16,2015 08:10 AM ASP.NET Web Forms 1
loading
Tags: Grid
David Farmer
Asked On July 15, 2015 06:21 AM

Hi,

I'm working on a asp.net project using the syncfusion grid control. There are some columns in the grid (e.g. the primary key field) that I wish to display in the grid, but do not want the users to be able to Edit or type anything into when adding a new record. I am using inline form editing and have added AllowEditing="False" to the properties of the columns I wish to be read only. This works for the edit form, which has these text boxes greyed out, but when adding a new record the text boxes allow input. How can I either hide or lock these input boxes.

thanks

David

Prasanna Kumar Viswanathan [Syncfusion]
Replied On July 16, 2015 08:10 AM

Hi David,

Thanks for using Syncfusion products.

Your requirement has been achieved by using the property IsIdentity in columns of ejGrid.


Please refer the below UG documentation for more details regarding IsIdentity property,

Link : http://helpjs.syncfusion.com/js/api/ejgrid#members:columns-isidentity

Please refer the following code example :


<asp:Content runat="server" ID="BodyContent" ContentPlaceHolderID="MainContent">

        <ej:Grid ID="Grid" runat="server" AllowSorting="True" AllowPaging="True" AllowGrouping="true" AllowResizing="true"  AllowMultiSorting="true">

           <EditSettings AllowEditing="True" AllowAdding="True" AllowDeleting="True" EditMode="InlineForm"></EditSettings>

           <ToolbarSettings ShowToolbar="True" ToolbarItems="add,edit,delete,update,cancel"></ToolbarSettings>

            <Columns>

                <ej:Column Field="OrderID" HeaderText="Order ID" IsPrimaryKey="True" IsIdentity="true" TextAlign="Right" Width="100" />

                <ej:Column Field="CustomerID" HeaderText="Customer ID" Width="100" />

                <ej:Column Field="EmployeeID" HeaderText="Employee ID" TextAlign="Right" Width="100" />

                <ej:Column Field="Freight" HeaderText="Freight" TextAlign="Right" Width="100" Format="{0:C}" />

                <ej:Column Field="OrderDate" HeaderText="Order Date" TextAlign="Right" Width="100" Format="{0:MM/dd/yyyy}" />

                <ej:Column Field="ShipCity" HeaderText="Ship City" Width="100" />

            </Columns>

        </ej:Grid>
</asp:Content>


Please refer the below screenshot :



For your reference, we attached a sample in the following link

Sample Link : http://www.syncfusion.com/downloads/support/forum/119617/ze/Sample2129905322

Please let us know if you need any further assistance.

Regards,
Prasanna Kumar N.S.V

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;