Disabling textbox using HTML.GRID

Mar 31, 2014 at 9:39 AM
@Html.Grid(Model).Named("ordersGrid").Columns(columns =>
{ columns.Add().Titled("Name").Encoded(false).Sanitized(false).SetWidth(30).RenderValueAs(c => @<div style="width: 100px;">
<input type="text" value="@c.Name @c.LastName " id="Name"/> </div>);
columns.Add(c => c.RecordId).Titled("Actions").Encoded(false) .Sanitized(false) .SetWidth(30) .RenderValueAs(c => CustomRenderingOfColumn(c)); }).WithPaging(15).Sortable(true)

I Bind textbox in grid to bind values from database into it. and also generate empty textbox for new record.
I want to disable all textbox except the textbox used for adding new data.
Please tell me how i can do this. .. ?
Coordinator
Apr 5, 2014 at 7:36 AM
Hi, For disabling textbox you can use 'disable' attribute

<input type="text" disabled />

Also you can disable it, based on condition:

<input type="text" disabled="@Model.X" /> - disable when X - true
Apr 5, 2014 at 10:51 AM
ok. i will try to do this.. thanks..

Could you please tell me that HOW CAN I REFRESH THE HTML GRID SOON I DELETE ONE ITEM FROM GRID AND IT WILL REFRESH WITH UPDATED RECORDS.

I am using window.location.reload() for this. But i dont want to use this. I want to refresh only the GRID.

PLEASE HELP ME OUT ON THIS.