Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
171 views
I am experiencing a problem with column resizing and the Grid itself not resizing correctly.

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>

 

 

 

 

 

Pavlina
Telerik team
 answered on 09 Nov 2011
5 answers
389 views
On the update event, i am trying to populate myu object with the new values entered:

GridEditableItem UpdateItem = (GridEditableItem)e.Item;

I then do the following to try and get the new value (this works on other pages) from the input control, in this case in column "SDTest"

fmsdupdate.SD = Convert.ToDecimal((UpdateItem["SDtest"].Controls[0] as TextBox).Text.Trim());


This only returns me the original value in the field, not the updated one that i have just input. Any help would be greatly appreciated.
Michael
Pavlina
Telerik team
 answered on 09 Nov 2011
1 answer
143 views
I am having trouble reading this xml file into Telerik  Ajax RadGrid. The problem is that the xml file is in a weird format that Telerik does not seem to recognize.  Here is an example from the xml file that I want to read into my grid. Does anyone have any suggestions? Thanks
 

<Attribute>
     <Object>
         <Id>27</Id>
         <Type>212</Type>
    </Object>
   <AttributeDef>
        <Id>38</Id>
  </AttributeDef>
  <RowId>0</RowId>
  <StringValue/>
  <DecimalValue xsi:nil="true"/>
  <DateTimeValue xsi:nil="true"/>
  <LongStringValue/>
  <IsLinked>Y</IsLinked>
  <MayModify>Y</MayModify>
  <ValueDescription/>
</Attribute>
Daniel
Telerik team
 answered on 09 Nov 2011
1 answer
110 views
Hello,

I'm quite new with Telerik and I really like the look and functionality of a RadGrid, so I would really like to make my wishes come true with the use of a RadGrid.

My wishes are the following:
-I would like to add a hyperlink and some text in 1 cell, but both are gathered from different datafields. 
-between the hyperlink and the the text I would like an <br />
-and I would like to all handle this in the .cs 

I don't know if this is even possible, I really hope so.

Yours,
Folmer



Princy
Top achievements
Rank 2
 answered on 09 Nov 2011
2 answers
183 views
Dear Telerik,

Currently I have 4 different RadDockZone each with a RadDock in it. On the bottom of my page I have a RadRotator with 10 RadDockZone each with a RadDock too. Inside each RadDock I have the RadChart to display the chart from my SQL database. Currently I'm using these code to drag and exchange RadDock between zones, and it's working great.

<script type="text/javascript">


    // Javascript for swapping between DockZones
    var initialZone;
    var initialIndex;
    function OnDragStart(dock, args) 
    {
        initialIndex = dock.get_index();
        initialZone = dock.get_dockZone();
    }


    function OnClientDockPositionChanged(dock, args) 
    {
        var currentZone = dock.get_dockZone();
        var dockToBeDocked = currentZone.get_docks()[dock.get_index() + 1];
        if (dockToBeDocked != null && initialZone != null && currentZone != initialZone) 
        {
            initialZone.dock(dockToBeDocked, initialIndex);
        }
    }

</script>

I would like that whenever I drag a RadDock into the rotator, the dock would display an Image instead of the RadChart's graph. Each of the raddock should has its own image.The initial RadDock in the Rotator on page load only display the image too. Is this something possible to do using Javascript, or I have to do with code behind and autopostback? 

I've been trying to figure out without success. Please help me on this problem.

Thank you,
Loc Huynh
Loc
Top achievements
Rank 1
 answered on 09 Nov 2011
3 answers
174 views
I have the following definition for a RadToolBar:
<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>

For some reason these items won't show up (see attachment). The parent RadToolBar instance is using the Windows7 skin, although I also tried the Vista skin and no luck there either. There is no data binding on this toolbar - all items are static and the RadToolBarDropDown in question is at the root level (inside the main <Items> collection). I'm on Q2 2011.

Thoughts?
digitall
Top achievements
Rank 1
 answered on 09 Nov 2011
2 answers
172 views
Hi All,

I am using the technique show in this forum to refresh a RadGrid on a RadWindow close:

http://www.telerik.com/community/forums/aspnet-ajax/window/refresh-radgrid-on-close-of-radwindow.aspx

This works like a charm.  :)  My challenge is, however, while the grid refreshes itself beautifully, the context menu targeting the grid "disables" itself.  Specifically, when the user right-clicks, nothing happens at all.

When I refresh the page, the context menu "re-enables" itself, and I'm back off to the races.  

To resolve this, I've tried to DataBind the context menu in the Code Behind (in the AjaxRequest procedure as show in the forum post above).  But, that did not help.

So, I think my specific question is how do I "reactivate" a context menu targeting a RadGrid after I run the procedure shown in the forum post above?  

Thanks you very much for any help that you can provide.

Jim
James
Top achievements
Rank 1
 answered on 09 Nov 2011
5 answers
124 views
When I enter text in the RadEditor for SharePoint 2010 (a page content field), highlight the text and select Heading 1 from the menu, and then press enter, the new line is still within the H1 element (and has similar styles applied).

I expected that the H1 element would be closed (unless I specifically extended it by pressing shift+enter).

I have demonstrated this behavior on my trial install of RadEditor for SharePoint (as well as on the Telerik demo at http://sharepoint.telerik.com/aspnet-ajax/web-parts/Pages/Content-Editor-Web-Part-using-RadEditor.aspx), in IE8 and Chrome 15. (Behavior is as expected in Firefox 7.)

Unfortunately, this is the same as the behavior of SharePoint 2010's default rich-text editor. I reported the behavior to Microsoft (see http://social.msdn.microsoft.com/Forums/en-US/sharepoint2010general/thread/49f4276d-c709-43ad-9ebd-e5fc44c1b4f4/), which they say they will address in a future update. This is the primary reason why I am evaluating 3rd-party rich-text editors.

Are there any workarounds for this behavior?
Rumen
Telerik team
 answered on 09 Nov 2011
1 answer
146 views
Hi
I have a radgrid.
When I'm sorting the fields the grid height is changing and  headertext also changing like if headertext is in two words
after click the column words showing one on another.
I have to display time into two line, so I hardcoded the headertext width.
When grid load initially its showing date correctly, but if I do soting its not showing date correctly as I expected.
Like this if I sort one column other getting affected.
.I have this problem in two grid.
here is my code.
Please help me as soon as possible
<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>
Pavlina
Telerik team
 answered on 09 Nov 2011
1 answer
301 views
Hi.

I need to load text to RadEditor from database that can be changed by user from website. The problem is that default text colour must be black, and all changes that user makes must be in red colour only. How can I achieve this? I tried to use something like

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>

And this is incorrect to, also, it causes problems with performance in the case of long text. Could someone please help me with this issue?
Rumen
Telerik team
 answered on 09 Nov 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?