<script>
var $ = $telerik.$; //make jQuery available through $ alias
function oncreated() {
var RadGrid1 = RadGrid1.gridObj();
}
function pageLoad() {
setGridHeight(); //set grid's height on page load
}
$(window).resize(function () {
setGridHeight(); //maintain grid's height on window resize
});
function setGridHeight() {
var headerHeight = $('.header').outerHeight(), //header height including margin, padding and borders
footerHeight = $('.footer').outerHeight(), //footer height including margin, padding and borders
windowHeight = $(window).height(), //window height
gridObj = $find('<%= RadGrid1.ClientID%>'), //grid's client object
gridHeight = windowHeight - (headerHeight + footerHeight + 2); //calculate grid's height
$('#' + gridObj.get_id()).height(gridHeight); //set grid's height to the calculated
gridObj.repaint(); //it is required to repaint the grid so it can recalculate its metrics after window resize
}
</script>
<telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="true" PageSize="50" AllowSorting="true" OnNeedDataSource="RadGrid1_NeedDataSource">
<MasterTableView Width="100%" TableLayout="Fixed">
</MasterTableView>
<ClientSettings>
<Scrolling AllowScroll="true" UseStaticHeaders="true" />
<ClientEvents OnGridCreated="oncreated" />
</ClientSettings>
</telerik:RadGrid>
<style>
html,
body,
form {
height: 100%;
margin: 0;
padding: 0;
vertical-align: top;
}
.header {
height: 20px;
background: green;
color: white;
}
.footer {
height: 20px;
background: green;
color: white;
}
</style>

<title></title> <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server"> <script type="text/javascript"> function Update() { var batchManager = grid2.get_batchEditingManager(); batchManager.saveChanges(grid2.get_masterTableView()); }......<body> <form id="form" runat="server"> <div> <telerik:RadAjaxPanel ID="RadAjaxPanel2" runat="server" Height="100%" Width="100%" HorizontalAlign="NotSet" OnAjaxRequest="RadAjaxPanel2_AjaxRequest"> <telerik:RadGrid ID="RadGrid2" runat="server" AutoGenerateColumns="False" Culture="ko-KR" GroupPanelPosition="Top" OnNeedDataSource="RadGrid2_NeedDataSource" OnBatchEditCommand="RadGrid2_BatchEditCommand" OnItemCreated="RadGrid2_ItemCreated" Height="445px" OnPreRender="RadGrid2_PreRender" AllowAutomaticUpdates="True" ShowFooter="True"> <ClientSettings AllowColumnsReorder="True" ReorderColumnsOnClient="True" AllowKeyboardNavigation="True"> <ClientEvents OnRowCreated="RowCreated" OnBatchEditCellValueChanged="RadGrid2_OnBatchEditCellValueChanged" /> <KeyboardNavigationSettings AllowSubmitOnEnter="True" CancelChangesKey="D1" /> <Scrolling AllowScroll="True" UseStaticHeaders="True" /> </ClientSettings> <MasterTableView EditMode="Batch" BatchEditingSettings-EditType="Cell"> <Columns>................................ protected override void OnPreInit(EventArgs e) { baseScriptManager = new ScriptManager(); baseScriptManager.AsyncPostBackTimeout = 600; Page.Items[typeof(ScriptManager)] = baseScriptManager; base.OnPreInit(e); } protected override void OnPreLoad(EventArgs e) { Page.Items[typeof(ScriptManager)] = null; baseScriptManager.AllowCustomErrorsRedirect = true; baseScriptManager.AsyncPostBackError += this.baseScriptManager_AsyncPostBackError; this.Form.Controls.Add(baseScriptManager); base.OnPreLoad(e); } private void baseScriptManager_AsyncPostBackError(object sender, AsyncPostBackErrorEventArgs e) { baseScriptManager.AsyncPostBackErrorMessage = e.Exception.Message; } protected void RadGrid2_BatchEditCommand(object sender, GridBatchEditingEventArgs e) { ................ using (DbConnection connection = db.CreateConnection()) { connection.Open(); DbTransaction transaction = connection.BeginTransaction(); try { DbCommand dbCommand = null; foreach (DBParameter DBParameter in parameters) { dbCommand = db.GetStoredProcCommand("uspw_test1"); dbCommand.CommandTimeout = commandTimeout; if (DBParameter != null) { foreach (Parameter parameter in DBParameter.ListParameter) db.AddInParameter(dbCommand, parameter.Name, parameter.DBType, parameter.Value); } result += db.ExecuteNonQuery(dbCommand, transaction); } // Commit the transaction transaction.Commit(); } catch (System.Exception ex) { // Rollback transaction transaction.Rollback(); throw ex; } connection.Close(); return; } }<telerik:GridTemplateColumn HeaderText="Name" SortExpression="NAME" UniqueName="Name" HeaderTooltip="Name" DataField="NAME" HeaderStyle-Width="25%" ItemStyle-Width="25%" Exportable="true"> <ItemTemplate> <asp:LinkButton id="lnkName" ForeColor="Blue" runat="server" Text='<%# Convert.ToString(DataBinder.Eval(Container.DataItem, "NAME"))%>' CommandName="LAUNCH_NAME" CausesValidation="false"></asp:LinkButton> </ItemTemplate></telerik:GridTemplateColumn>function isTaskNA(chk,idx) {var chkNA = document.getElementById(chk);var masterTable = $find("<%=GrdMain.ClientID %>").get_masterTableView(); var PN = masterTable.get_dataItems()[idx].get_cell("Name");var row = masterTable.get_dataItems()[idx].get_element(); if (chkNA.checked){ row.style.color = 'gray'; row.style.textDecoration = 'line-through'; row.style.fontStyle = 'italic'; PN.style.ForeColor = 'gray'; PN.disabled = 'disabled'; }else { row.style.color = 'black'; row.style.textDecoration = 'none'; row.style.fontStyle = "normal"; PN.style.ForeColor = 'blue'; }}myDataSource = new ObjectDataSource { ... };myDataSource.Selecting += SourceSelecting;...private void SourceSelecting(object sender, ObjectDataSourceSelectingEventArgs e){ e.InputParameters["filterExpression"] = myGrid.MasterTableView.FilterExpression;}