Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
195 views
Hello,
I am brand new to RadGrid.
I working on a grid that have only 3 columns.

Firstly, data are retrieved from database into a DataTable, like this:
 static DataTable GetData()
    {
        DataTable table = new DataTable();
        table.Columns.Add("Name"typeof(string));
        table.Columns.Add("Activate"typeof(string));
        table.Columns.Add("Actions"typeof(string));        
 
        table.Rows.Add("Toilets", "Activate""Duplicate Delete");
        table.Rows.Add("Swimming pools", "Activate", "Duplicate Delete");
        table.Rows.Add("Pumps", "Deactivate", "Duplicate Delete");
        table.Rows.Add("Taps", "", "Duplicate Delete");
        table.Rows.Add("Boiler""Activate""Duplicate Delete");
        return table;
    }"

then bind to radgrid using: .DataScource = dataTable;

I want to archive the followings:
1. Active column: i wanna use Image button to render "Activate", "Deactivate" command. When user click those buttons, how can i know from which rows, the buttons were clicked. If the data cell is empty, then do not show any button.
2. I wanna replace Duplicate and Delete with two image buttons inside the same cell.

It seems that i should use ItemTemplate or something like that but after reading documents from telerik, i still can not find out the solution. I am really appreciate your help. Thanks in advanced.
Jayesh Goyani
Top achievements
Rank 2
 answered on 02 Feb 2013
1 answer
100 views
Is it possible to add a label/text to the command bar that appears when you have commanditemdisplay="top" in the mastertableview set. See my graphic for a better explanation
Jayesh Goyani
Top achievements
Rank 2
 answered on 02 Feb 2013
7 answers
158 views
Hi,

I am getting a selection out of range when binding to a datasource in a formview.  This happens on occasion if the previously saved ID for say a company on the formview no longer exists in the company datasource.

That is fine and I expect an exception to be raised as the company ID does indeed not exist in the datasource.  

I need to be able to intercept that exception with a try / catch and then manually change the empty item text to something like "Invalid company value".  The user can then select a different company.

Because the binding is handled by the formview I'm not sure where to have the try/catch...  

Any suggestions?

Regards,

Jon
Darren
Top achievements
Rank 1
 answered on 01 Feb 2013
4 answers
280 views
I use EditMode="EditForms" for user to insert/edit item of the RedGrid. Once in the Edit/Insert form, how to force the user to either click  edit/insert button or Cancel button before leaving the Edit/Insert form ? Or at least providing a warning of losing data ?

Thanks a lot in advance !


Anna Gao
Top achievements
Rank 1
 answered on 01 Feb 2013
3 answers
282 views
Is thre a way to set the search box text from the client side?
ACubukcu
Top achievements
Rank 1
 answered on 01 Feb 2013
1 answer
91 views
I have a problem where all the links for the pages are set to "disabled" even though they have been enabled in the control and are showing up. 

Here is my declaring code:

<!-- TAB 1 -->
<asp:Panel ID="panelTab1" runat="server">
    <div>
        <telerik:RadGrid ID="DataFeedGrid" runat="server" AllowSorting="true" AllowPaging="true"
            AllowCustomPaging="true" OnSortCommand="Grid_Sorting" OnPageIndexChanged="Grid_Paging"
            Skin="Vista" meta:resourcekey="DataGrid">
            <MasterTableView AutoGenerateColumns="False" EnableNoRecordsTemplate="true" ShowHeadersWhenNoRecords="false"
                 NoMasterRecordsText="No records match the search criteria.">
                <Columns>
                    <telerik:GridBoundColumn
                        ItemStyle-Width="125px" meta:resourcekey="GridBoundColumn1" />
                    <telerik:GridBoundColumn
                        ItemStyle-Width="100px" meta:resourcekey="GridBoundColumn2" />
                    <telerik:GridTemplateColumn >
                        <HeaderTemplate>
                            <asp:CheckBox ID="cbHdrFlightExplorer" runat="server" />
                        </HeaderTemplate>
                        <ItemTemplate>
                            <asp:CheckBox ID="cbFlightExplorer" runat="server"  />
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>
                </Columns>
            </MasterTableView>
            <AlternatingItemStyle BackColor="#E9E9E9" />
            <PagerStyle Mode="NumericPages" />
            <ClientSettings>
                <ClientEvents OnGridCreated="OnClientGridCreated" />
            </ClientSettings>
        </telerik:RadGrid>
    </div>

Here is the code in question it generates in relation to paging:
<td class="rgPagerCell NumericPages"><div class="rgWrap rgNumPart">
                        <a onclick="return false;" disabled="disabled" class="rgCurrentPage"><span>1</span></a><a disabled="disabled"><span>2</span></a><a disabled="disabled"><span>3</span></a><a disabled="disabled"><span>4</span></a>
                    </div><div class="rgWrap rgInfoPart">
                          Displaying page 1 of 4, items 1 to 2 of 8.
                    </div></td>

I can not find any code client side or server side that causes this behavior. 

Can anyone help?
Wade
Top achievements
Rank 1
 answered on 01 Feb 2013
5 answers
389 views
Hello,
I've been using the self referencing capability of the RadGrid for some time now. Today I was loading data in to the DB that the grid is pulling from and the grid starting throwing out of memory exceptions.

This grid is fully functional, and I had been using test data sets of up to several hundred rows. When I loaded the real data set of just over 6500 rows the grid started throwing the error. I was able to get it work up to 3400 rows, after that the error is thrown. Page processing takes a couple of minutes when it's trying to load the data, during which you can see it taking up memory little by little until .NET tells it to take a hike. The system has 8GB of memory installed, and a test server has 4GB. Fails on both.

This is clearly a bug to me. This is basic text, each row contains a couple of GUIDs and a single text sentence, and it can't handle a few thousand rows? DataTables, GridViews, et all, work without issue.

There is no paging enabled on this grid nor can there be, as it is a grid of a hierarchy that needs to keep expanding.

Please let me know if there is something wrong with my setup, or if there is a known fix. My markup is below, as well as the error message.

<telerik:RadGrid runat="server" ID="TaxonomiesRadGrid" AllowMultiRowSelection="true" Visible="false"  
    OnNeedDataSource="TaxonomiesRadGrid_NeedDataSource" Skin="WebBlue" AutoGenerateColumns="false"  
    Width="100%" GridLines="None" MasterTableView-GridLines="None" ClientSettings-AllowGroupExpandCollapse="true"  
    OnItemCreated="TaxonomiesRadGrid_ItemCreated" ShowStatusBar="true" OnInsertCommand="TaxonomiesRadGrid_InsertCommand"  
    OnUpdateCommand="TaxonomiesRadGrid_UpdateCommand" OnDeleteCommand="TaxonomiesRadGrid_DeleteCommand">  
    <MasterTableView HierarchyDefaultExpanded="false" HierarchyLoadMode="Client" CommandItemDisplay="Top"  
        CommandItemSettings-AddNewRecordText="Add a new Taxonomy Parent" EditMode="InPlace"  
        NoMasterRecordsText="No taxonomy items to display. Please add an item using the link above."  
        DataKeyNames="taxonomyItemId, taxonomyParentId">  
        <SelfHierarchySettings ParentKeyName="taxonomyParentId" KeyName="taxonomyItemId"  
            MaximumDepth="100" />  
        <Columns>  
            <telerik:GridBoundColumn DataField="taxonomyText" DataType="System.String" HeaderText="Taxonomy Description"  
                SortExpression="taxonomyText" UniqueName="taxonomyText">  
            </telerik:GridBoundColumn>  
            <telerik:GridEditCommandColumn ButtonType="PushButton" ItemStyle-Width="120px" ItemStyle-HorizontalAlign="Right">  
            </telerik:GridEditCommandColumn>  
            <telerik:GridClientDeleteColumn ButtonType="PushButton" ItemStyle-Width="50px" ItemStyle-BorderWidth="0px"  
                ItemStyle-HorizontalAlign="Center" ConfirmText="Are you sure you want to delete this taxonomy item and any items beneath it?">  
            </telerik:GridClientDeleteColumn>  
        </Columns>  
    </MasterTableView>  
    <ClientSettings AllowExpandCollapse="true" AllowGroupExpandCollapse="true">  
    </ClientSettings>  
</telerik:RadGrid>  


Server Error in '/NTTR' Application.  
  
Exception of type 'System.OutOfMemoryException' was thrown.  
  
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.   
  
Exception Details: System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.  
  
Source Error:   
  
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  
  
Stack Trace:   
  
  
[OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.]  
   System.String.GetStringForStringBuilder(String value, Int32 startIndex, Int32 length, Int32 capacity) +29  
   System.Text.StringBuilder.GetNewString(String currentString, Int32 requiredLength) +69  
   System.Text.StringBuilder.Append(String value) +97  
   System.Web.UI.ScriptControlManager.RegisterScriptsForScriptDescriptors(IEnumerable`1 scriptDescriptors, Control control) +240  
   System.Web.UI.ScriptControlManager.RegisterScriptDescriptors(IScriptControl scriptControl) +113  
   System.Web.UI.ScriptManager.RegisterScriptDescriptors(IScriptControl scriptControl) +21  
   Telerik.Web.UI.RadCompositeDataBoundControl.RegisterScriptDescriptors() +37  
   Telerik.Web.UI.RadCompositeDataBoundControl.RenderContents(HtmlTextWriter writer) +38  
   Telerik.Web.UI.RadGrid.RenderContents(HtmlTextWriter writer) +56  
   Telerik.Web.UI.GridBaseDataList.Render(HtmlTextWriter writer) +88  
   Telerik.Web.UI.RadGrid.Render(HtmlTextWriter writer) +125  
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27  
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99  
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25  
   Telerik.Web.UI.ControlRenderer.Render(HtmlTextWriter writer) +84  
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27  
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99  
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25  
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +134  
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +19  
   System.Web.UI.Control.Render(HtmlTextWriter writer) +10  
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27  
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99  
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25  
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +134  
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +19  
   System.Web.UI.UpdatePanel.RenderChildren(HtmlTextWriter writer) +234  
   System.Web.UI.Control.Render(HtmlTextWriter writer) +10  
   System.Web.UI.UpdatePanel.Render(HtmlTextWriter writer) +34  
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27  
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99  
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25  
   Telerik.Web.UI.PreControlToAjaxify.Render(HtmlTextWriter writer) +112  
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27  
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99  
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25  
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +134  
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +19  
   System.Web.UI.Control.Render(HtmlTextWriter writer) +10  
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27  
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99  
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25  
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +134  
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +19  
   System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer) +163  
   System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) +32  
   System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter output) +51  
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27  
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99  
   System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter writer) +40  
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +134  
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +19  
   System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) +32  
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27  
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99  
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25  
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +134  
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +19  
   System.Web.UI.Control.Render(HtmlTextWriter writer) +10  
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27  
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99  
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25  
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +134  
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +19  
   System.Web.UI.Page.Render(HtmlTextWriter writer) +29  
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27  
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99  
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25  
   Telerik.Web.UI.RadAjaxControl.RenderPageInAjaxMode(HtmlTextWriter writer, Control page) +594  
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +256  
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +19  
   System.Web.UI.Page.Render(HtmlTextWriter writer) +29  
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27  
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99  
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25  
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1266  
  
Version Information: Microsoft .NET Framework Version:2.0.50727.4200; ASP.NET Version:2.0.50727.4016  

Pavlina
Telerik team
 answered on 01 Feb 2013
1 answer
146 views
I have a 3 layer multi grid, on the firest layer of the grid, I have a dropdown tempaltes, click one of the item on the dropdown, will open a radwindow. The grid set

 

 

HierarchyLoadMode="Client"

 



I set the each layer of the grid view with with Width="98%"
when I use AllowColumnResize="true" and UseStaticHeaders="true", and when all the grid level are expand,  everytime when I  below code to open pop up radwindow, the grid colum won't fit the winow well, instead it bumps to the left side for the second and third level of the grid. see attachment. It looks like AllowColumnResize="true"  and UseStaticHeaders="true" won't work for hierarchy grid. also, if try to resize (expand)the seocnd or third level of the grid, the grid will go out of the window width.

 

 

StringBuilder sbShowwndProcHist = new StringBuilder();

 

sbShowwndProcHist.Append(

 

"radopen(null, 'wndProcHist');");

 

 

 

ScriptManager.RegisterStartupScript(this, GetType(), "ViewwndProcHistKey", sbShowwndProcHist.ToString(), true);

 

<ClientSettings EnableRowHoverStyle="true" AllowColumnsReorder="true" ColumnsReorderMethod="Reorder"
                       ReorderColumnsOnClient="true">
                       
                      <Scrolling AllowScroll="true" ScrollHeight="" UseStaticHeaders="true" />
                       <Resizing AllowColumnResize="true" EnableRealTimeResize="true"  AllowResizeToFit="true"                 
   </ClientSettings>


Please help!
Pavlina
Telerik team
 answered on 01 Feb 2013
6 answers
332 views
Ok so I have some javascript in my RadGrid ItemTemplate of a GridTemplateColumn that does some calculations which fires just fine on the intial page load. But after I hit refresh on the commandbar it disappears, the RadGrid is wrapped in an Ajax Panel. how would I be able to call the javascript again?

 

<telerik:GridTemplateColumn DataField="TotalSize" DataType="System.String" HeaderText="Size" UniqueName="Size">
                 <ItemTemplate>
                      <script type="text/javascript">
                      ...
                      </script>
                </ItemTemplate>
 </telerik:GridTemplateColumn>

 

 

 

 

Pat Huesers
Top achievements
Rank 1
 answered on 01 Feb 2013
5 answers
350 views
Hi,
           I have a ASP.Net page having  the RadTabStrip and RadMultiPage. Each RadPageView has only one RadGrid having width 99% and Height 100%. RadGrid are using the Skin = Office2010Silver. Now, I do have Horizontal Scroll bar when columns with are more then the space. But I do not have the Vertical Scroll bars. 
            I tried setting the Height, and also the ScrollHeight to 70 px (while height was 100%). Any suggestions, When there are more items, it does not even show all items and also the horizontal scroll bar does not show up as its at the bottom.
Pavlina
Telerik team
 answered on 01 Feb 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?