window.onload = function() { Disable(); } function Disable() { var txt = $find("RadTextBox1"); txt.disable(); }
private void BindGrid() { RadGrid1.DataSource = _dsBudgetVerification.Tables["BVSummary"]; RadGrid1.Width = Unit.Percentage(98); RadGrid1.AutoGenerateColumns = false; RadGrid1.GridLines = GridLines.Both; //TODO: This doesn't seem to work RadGrid1.CssClass="gridborder"; RadGrid1.MasterTableView.DataKeyNames = new string[] { "ExpenditureType" }; RadGrid1.MasterTableView.Name = "tvSummary"; RadGrid1.MasterTableView.HierarchyLoadMode = GridChildLoadMode.ServerBind; //RadGrid1.MasterTableView.HierarchyLoadMode = GridChildLoadMode.Client; //RadGrid1.ClientSettings.AllowExpandCollapse = true; //Add Summary table RadGrid1.MasterTableView.Width = Unit.Percentage(100); GridBoundColumn boundColumn; GridDropDownColumn ddlColumn; foreach (DataColumn dataColumn in _dsBudgetVerification.Tables["BVSummary"].Columns) { //these apply to every column in Summary boundColumn = new GridBoundColumn(); RadGrid1.MasterTableView.Columns.Add(boundColumn); boundColumn.HeaderText = dataColumn.Caption; boundColumn.HeaderStyle.CssClass = "gridheader"; //we know the column names of the text fields, so let's set their formatting switch (dataColumn.Caption) { case "EscalatorID": case "EscalatorName": { //TODO: figure out how to add combobox here boundColumn.DataField = dataColumn.Caption; break; } case "ExpenditureType": case "ExpenditureTypeExists": { boundColumn.DataField = dataColumn.Caption; if (dataColumn.Caption == "ExpenditureTypeExists") boundColumn.Visible = false; break; } default: //anything else will be an amount { boundColumn.DataField = dataColumn.Caption; boundColumn.HeaderStyle.Width = 50; //also build our list of months for use in the Total column lstMonths += '"' + dataColumn.ColumnName + '"' + ','; break; } } } //now trim the last comma off the list lstMonths = lstMonths.Substring(1, lstMonths.Length - 3); //now add a calculated Total column at the end of the summary CreateCalcColumn(RadGrid1.MasterTableView, lstMonths); //Add Details table GridTableView tableViewDetails = new GridTableView(RadGrid1); RadGrid1.MasterTableView.DetailTables.Add(tableViewDetails); tableViewDetails.Width = Unit.Percentage(100); tableViewDetails.DataSource = _dsBudgetVerification.Tables["BVDetails"]; tableViewDetails.DataMember = "BVDetails"; tableViewDetails.DataKeyNames = new string[] { "ExpenditureType" }; tableViewDetails.Name = "tvDetails"; GridRelationFields relationFields = new GridRelationFields(); relationFields.MasterKeyField = "ExpenditureType"; relationFields.DetailKeyField = "ExpenditureType"; tableViewDetails.ParentTableRelation.Add(relationFields); RadGrid1.MasterTableView.DetailTables.Add(tableViewDetails); foreach (DataColumn dataColumn in _dsBudgetVerification.Tables["BVDetails"].Columns) { switch (dataColumn.Caption) { case "EscalatorID": case "EscalatorName": { //ddlColumn = new GridDropDownColumn(); //tableViewDetails.Columns.Add(ddlColumn); //ddlColumn.UniqueName = "Escalator"; //ddlColumn.ListTextField = "Escalator"; //ddlColumn.ListValueField = "EscalatorID"; //ddlColumn.ListDataMember = "Escalator"; //ddlColumn.DataSourceID = "dsrcEscalators"; //ddlColumn.DataField = dataColumn.Caption; //ddlColumn.HeaderText = dataColumn.Caption; //ddlColumn.HeaderStyle.CssClass = "gridheader"; //ddlColumn.EditItemTemplate = new ddlTemplate(); break; } default: { boundColumn = new GridBoundColumn(); tableViewDetails.Columns.Add(boundColumn); boundColumn.DataField = dataColumn.Caption; boundColumn.HeaderText = dataColumn.Caption; boundColumn.HeaderStyle.CssClass = "gridheader"; break; } } } //now add a calculated Total column at the end of the details CreateCalcColumn(tableViewDetails, lstMonths); } <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"> <AjaxSettings> <telerik:AjaxSetting AjaxControlID="RadGrid1"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" /> </UpdatedControls> </telerik:AjaxSetting> </AjaxSettings> </telerik:RadAjaxManager> <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server"> </telerik:RadAjaxLoadingPanel> <telerik:RadGrid ID="RadGrid1" runat="server" OnItemDataBound="RadGrid1_ItemDataBound" />Hello
I have a grid just like in this demo:
http://demos.telerik.com/aspnet-ajax/grid/examples/client/resizing/defaultcs.aspx
with Column Resize = true and Resize grid on column resizing = false
at first my grid was fine and it resizes perfectly.
Then I add a property Scrolling.......
we set Scrolling = true, Static Header = true
My problem now is that when i resize the column to the right, the columns do not fit in the grid like in the demo above instead it overflow and it add a horizontal scrollbar.
I really dont want the horizontal scrollbar.
also if you adjust the column to the left, a white space is seen on the right.
Is there a way to stop the columns from overflowing or making white spaces.(letting the columns adjust like in the link above when you resize a column)
Thanks

In the following code, when i click on the Submit button, the page is not refreshed but the file is not uploaded. Who can i do it to upload file without the page is refreshed?
<telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" Height="152px"
Width="300px" HorizontalAlign="NotSet">
<telerik:RadUpload ID="RadUpload1" runat="server"
AllowedFileExtensions=".jpg,.jpeg,.bmp,.gif"
ControlObjectsVisibility="ClearButtons" MaxFileInputsCount="1" MaxFileSize="1000000"
Skin="Vista" TargetFolder="~/Files" />
<hr />
<asp:Button ID="Button1" runat="server" Text="Submit" onclick="Button1_Click" />
</telerik:RadAjaxPanel>