or
If I resize a column by dragging one side of the column left or right and then resize the whole browser window, the grid does not conform to the Width="100%" attribute.
The grid needs to expand and contract along withthe width of the browser window. After resizing a column, the grid remains at the original width and is then fixed until the page is refreshed.
The grid behaves properly before the column is resized.
<telerik:RadGrid ID="grdRules" runat="server" AllowPaging="true" AutoPostBack="true" AllowSorting="false" EnableViewState="true" AutoGenerateColumns="false" GridLines="None" PagerSettings-Visible="true" HeaderStyle-CssClass="GridHeader" RowStyle-CssClass="GridShade" AlternatingRowStyle-CssClass="AltGridShade" OnItemDataBound="grdRules_OnItemDataBound" OnPageIndexChanged="grdRules_OnPageIndexChanged" OnPageSizeChanged="grdRules_OnPageSizeChanged" OnRowCommand="grdRules_OnRowCommand" Width="100%" PageSize="20" AllowFilteringByColumn="false" BorderStyle="None" Skin="Default" > <PagerStyle Position="TopAndBottom" Mode="NextPrevAndNumeric" /> <ClientSettings Resizing-AllowResizeToFit="true" Scrolling-AllowScroll="false" Resizing-AllowColumnResize="true" /> <MasterTableView TableLayout="Auto" > <Columns> <telerik:GridBoundColumn DataField="RuleName" HeaderText="Name" HeaderStyle-HorizontalAlign="Left" ItemStyle-Wrap="true" /> <telerik:GridBoundColumn DataField="TargetCategoryDescription" HeaderText="Category" HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="Left" /> <telerik:GridBoundColumn DataField="TargetCompany" HeaderText="Manufacturer" HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="Left" /> <telerik:GridBoundColumn DataField="TargetModel" HeaderText="Model" HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="Left" /> <telerik:GridBoundColumn DataField="RuleTypeDescription" HeaderText="Action" HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="Left" /> <telerik:GridBoundColumn DataField="EntityCount" HeaderText="Attachments" HeaderStyle-HorizontalAlign="Right" ItemStyle-HorizontalAlign="Right" /> <telerik:GridBoundColumn DataField="RuleCriteriaID" HeaderText="ID" HeaderStyle-HorizontalAlign="Right" ItemStyle-HorizontalAlign="Right" /> <telerik:GridTemplateColumn Resizable="false" ItemStyle-HorizontalAlign="Right" > <ItemTemplate> <asp:Image ID="btnPopup" runat="server" ImageUrl="images/Expand.jpg" CssClass="gridMenuIcon" /> <telerik:RadContextMenu ID="mnuRow" runat="server" OnItemClick="RulesContextMenu_Click" OnClientItemClicking="OnDeleteItemClicking" CollapseAnimation-Duration="100" ExpandAnimation-Duration="100" ExpandDelay="0"> <Targets> <telerik:ContextMenuControlTarget ControlID="btnPopup" /> </Targets> </telerik:RadContextMenu> </ItemTemplate> </telerik:GridTemplateColumn> </Columns> </MasterTableView> </telerik:RadGrid>
GridEditableItem UpdateItem = (GridEditableItem)e.Item;fmsdupdate.SD = Convert.ToDecimal((UpdateItem["SDtest"].Controls[0] as TextBox).Text.Trim());<telerik:RadToolBarDropDown Text="Export Options"> <Buttons> <telerik:RadToolBarButton runat="server" ImageUrl="~/_assets/images/report/excel.png" ToolTip="Export to Excel" /> <telerik:RadToolBarButton runat="server" ImageUrl="~/_assets/images/report/csv.png" ToolTip="Export to CSV (Raw Data Dump)" /> </Buttons></telerik:RadToolBarDropDown>
<telerik:RadAjaxPanel ID="callogRadPnl" runat="server"> <telerik:RadGrid ID="callogGrd" style="border:0; margin-top:-20px;" runat="server" AllowSorting="true" PageSize="5" AllowPaging="true" Width="99%" CssClass="gridView1" AutoGenerateColumns="false" onitemcommand="callogGrd_ItemCommand1" onitemcreated="callogGrd_ItemCreated" AllowFilteringByColumn="true" onneeddatasource="callogGrd_NeedDataSource" oninit="callogGrd_Init"> <MasterTableView> <HeaderStyle HorizontalAlign="Left" Height="10px" /> <ItemStyle Font-Names="Arial" Font-Size="12px" ForeColor="#000000"/> <AlternatingItemStyle Font-Names="Arial" Font-Size="12px" ForeColor="#000000"/> <PagerStyle Mode="NumericPages"/> <Columns> <telerik:GridBoundColumn DataField="BeginTime" HeaderText="Begin" SortExpression="BeginTime" HeaderStyle-Width="150px" FilterControlWidth="55px"/> <telerik:GridBoundColumn DataField="EndTime" HeaderText="EndTime" SortExpression="EndTime" HeaderStyle-Width="180px" AllowFiltering="false" /> <telerik:GridBoundColumn DataField="DispatcherName" HeaderText="Dispatcher" SortExpression="DispatcherName" FilterControlWidth="55px"/> <telerik:GridBoundColumn DataField="ConsoleName" HeaderText="Console" SortExpression="ConsoleName" FilterControlWidth="55px" AllowFiltering="true"/> <telerik:GridBoundColumn DataField="EndpointName" HeaderText="Endpoint" SortExpression="EndpointName" FilterControlWidth="55px"/> <telerik:GridBoundColumn DataField="CallType" HeaderText="CallType" SortExpression="CallType" FilterControlWidth="55px" HeaderStyle-Width="130px" /> <telerik:GridBoundColumn DataField="CallData" HeaderText="CallData" SortExpression="CallData" AllowFiltering="false"/> <telerik:GridBoundColumn DataField="TimeToAnswer" HeaderText="AnswerTime" SortExpression="TimeToAnswer" AllowFiltering="false" /> <telerik:GridBoundColumn DataField="CallDuration" HeaderText="Duration" SortExpression="CallDuration" UniqueName="calDuration" AllowFiltering="false"/> </Columns> </MasterTableView> <ExportSettings Csv-FileExtension="Csv" Csv-RowDelimiter="NewLine"> </ExportSettings> </telerik:RadGrid> </telerik:RadAjaxPanel>function OnClientSelectionChange(editor, args) { editor.get_document().execCommand("ForeColor", false, "Red");}
But in this case font colour changes to red event when user select some part of the text with mouse or with keyboard, and that is totally wrong. I also tried to handle "keydown" event for the content area, but in this case each symbol is wrapped by span tag, so I get something like<span style="font: red;">r<span style="font: red;">e<span style="font: red;">s</span></span><span>