Hi
I have a Grid with batch edit mode .The user fill grid rows then press save button.Then a valdation occurs on server side for code duplication chek .How we can restore grid rows(items) after postback and validation fails?
Thanks very much.
i am trying to set the rowheight of RadGrid to eg. 20 px.
RadGrid provides a property: mastertableview.itemstyle.height
but this doesnt work :-)
Is there any possibility to set RadGrids rowheight to fixed heigth???
Thanks in advance.
The following code doesn't work - it doesn't cause the controls to fire their client-side events in edit mode - any thoughts?
CS:
protected void rgRepricingApproval_ItemCreated(object sender, GridItemEventArgs e) { if (e.Item is GridEditableItem && e.Item.IsInEditMode) { GridEditableItem item = (GridEditableItem)e.Item; GridEditManager editMan = item.EditManager; GridNumericColumnEditor editorAgreedSellPrice = (GridNumericColumnEditor)editMan.GetColumnEditor("AgreedSellPrice"); RadNumericTextBox txtAgreedSellPrice = editorAgreedSellPrice.NumericTextBox; txtAgreedSellPrice.ClientEvents.OnValueChanged += string.Format("return ToggleValues({0});", e.Item.ItemIndex); RadDropDownList rcbHibernate = (RadDropDownList)item.FindControl("ddlHibernateID"); rcbHibernate.OnClientSelectedIndexChanged += string.Format("return ToggleValues({0});", e.Item.ItemIndex); // ONLY THIS WORKS (non-Telerik) CheckBox chkIsError = (CheckBox)item.FindControl("chkIsError"); chkIsError.Attributes["onchange"] += string.Format("return ToggleValues({0});", e.Item.ItemIndex); } }
ASPX:
<telerik:GridNumericColumn HeaderText="Agreed Sell Price" UniqueName="AgreedSellPrice" DataField="AgreedSellPrice" NumericType="Currency" DecimalDigits="3" ColumnEditorID="ceAgreedSellPrice"> <HeaderStyle Width="120px" /> <ItemStyle Width="120px" /> </telerik:GridNumericColumn> <telerik:GridTemplateColumn HeaderText="Hibernate Period" UniqueName="HibernateID" DataField="HibernateID" ConvertEmptyStringToNull="true"> <HeaderStyle Width="110px" CssClass="headerHibernate" /> <ItemStyle Width="110px" Height="50px" /> <ItemTemplate> <asp:Label runat="server" ID="lblHibernate" Text='<%# Eval("Hibernate.HibernateText") %>' /> </ItemTemplate> <EditItemTemplate> <telerik:RadDropDownList runat="server" ID="ddlHibernateID" AppendDataBoundItems="true" DataSourceID="edsHibernate" DataValueField="HibernateID" DataTextField="HibernateText"> <Items> <telerik:DropDownListItem Value="" Text="" /> </Items> </telerik:RadDropDownList> </EditItemTemplate> </telerik:GridTemplateColumn> <telerik:GridTemplateColumn HeaderText="Error?" UniqueName="Error" AllowSorting="false" AllowFiltering="false"> <HeaderStyle Width="60px" CssClass="headerError" /> <ItemStyle Width="60px" HorizontalAlign="Center" /> <ItemTemplate> <asp:CheckBox ID="chkIsError" runat="server" /> </ItemTemplate> </telerik:GridTemplateColumn> <telerik:GridTemplateColumn HeaderText="Error Reason" UniqueName="ErrorReason" DataField="ErrorReason"> <HeaderStyle Width="200px" CssClass="headerError" /> <ItemStyle Width="200px" /> <ItemTemplate> <asp:TextBox ID="txtErrorReason" runat="server" TextMode="MultiLine" Columns="20" Rows="2" Enabled="false" /> </ItemTemplate> </telerik:GridTemplateColumn> All items are in edit mode:
protected void rgRepricingApproval_PreRender(object sender, EventArgs e)
{
for (int i = 0; i < rgRepricingApproval.MasterTableView.PageSize; i++)
{
rgRepricingApproval.EditIndexes.Add(i);
}
rgRepricingApproval.Rebind();
}

<telerik:RadGrid ID="RadGridExport" runat="server" Visible="False" > <ExportSettings ExportOnlyData="True" IgnorePaging="True" Excel-Format="Biff" HideStructureColumns="True"> <Excel Format="Biff" /> </ExportSettings> <MasterTableView ShowHeader="False" AutoGenerateColumns="True"> <RowIndicatorColumn Visible="False"> </RowIndicatorColumn> <ExpandCollapseColumn Created="True"> </ExpandCollapseColumn> </MasterTableView> <FilterMenu EnableTheming="True"> <CollapseAnimation Type="OutQuint" Duration="200"> </CollapseAnimation> </FilterMenu> </telerik:RadGrid>--------------------------Public Sub ExportRadGrid(ByRef radGrid As Telerik.Web.UI.RadGrid) '-- Export the specified grid to the specified format radGrid.Visible = True radGrid.Rebind() With radGrid.ExportSettings If radGrid.ID = "RadGrid1" Then .FileName = "DivisionTotals" ElseIf radGrid.ID = "RadGrid2" Then .FileName = "GrantorTotals" Else .FileName = "GrantList" End If .ExportOnlyData = True .IgnorePaging = True .OpenInNewWindow = True End With Select Case ddlExportFormat.SelectedValue Case "Microsoft Excel" If radGrid.ID = "RadGrid1" Then For Each col As GridColumn In radGrid.MasterTableView.RenderColumns col.HeaderStyle.Width = Unit.Pixel(175) Next ElseIf radGrid.ID = "RadGrid2" Then For Each col As GridColumn In radGrid.MasterTableView.RenderColumns 'For Each col1 As GridColumn In radGrid. col.HeaderStyle.Width = Unit.Pixel(275) Next ElseIf radGrid.ID = "RadGridExport" Then 'RadGridGrants on Grants.aspx Debug.Print("START") radGrid.ShowHeader = False radGrid.ExportSettings.SuppressColumnDataFormatStrings = False For Each col As GridColumn In radGrid.MasterTableView.RenderColumns Debug.Print("DataTypeName: " + col.DataTypeName) Debug.Print("ColumnType: " + col.ColumnType) Debug.Print("HeaderText: " + col.HeaderText) Debug.Print("UniqueName: " + col.UniqueName) col.HeaderText = col.UniqueName 'For Each col1 As GridColumn In radGrid. col.HeaderStyle.Width = Unit.Pixel(275) Next Debug.Print("END") End If radGrid.MasterTableView.ExportToExcel() Case "Microsoft Word" radGrid.MasterTableView.ExportToWord() Case "Adobe PDF" radGrid.MasterTableView.ExportToPdf() Case "CSV" radGrid.MasterTableView.ExportToCSV() End Select End SubHi,
in my web application I use RichTextBox control to load docx template (created in Word 2013), which fill with data and then save this file to local destination.
Problem is, when I save file to local destination, Word 2013 open them in compatibility mode.
whether richtextbox supports office 2013 files?
Thans