I've used a RadGrid personalized with GridTemplateColumn using as <ItemTemplate> controls such as RadNumericTextBox and no <EditItemTemplate> with the aim was to implement a sort of fast point&click Excel-like grid that is used to configure parameters of a project. Namely, the maximum dimensions of this grid are 20 columns x 50 rows - so I do not deal with millions of records...
The changing of the cell values now is very fast, more than using the classic approach of row selection, single cell update and press od the update link/button on the selected row.
Unfortunately, when I need to update something from the entire grid (also the grid itself is auto-updated in Ajax mode) it takes a very long long long time to finish... The computational part is rather simple and it is accomplished in less than 1 second but when arriving to the grid.DataBind() method it takes almost 30 secs/1 min. to visually update the grid itself on the screen.
From the generated HTML I've seen that the VIEWSTATE now is enormous and this is probably the cause of the bad performance.
According to you, is there a way to speed up this process?
9 Answers, 1 is accepted
If you are using an excel like grid, it means that you are putting all rows in edit mode. Under this circumstance, there will be a lot of controls loading on initial page load which considerably increase the mark-up rendered in your browser. This is especially true if the controls rendered are our rad controls since they are richer in functionality and necessarily produce more mark-up on the client.
However, I would suggest that you review the following links on how to optimize the performance of RadGrid:
http://www.telerik.com/products/aspnet-ajax/resources/top-performance.aspx
http://www.telerik.com/help/aspnet-ajax/grdviewstatereductiontechniques.html
http://www.telerik.com/help/aspnet-ajax/grdsavinggridviewstateinsession.html
http://www.telerik.com/help/aspnet-ajax/radinputmanager_performance.html
as well as the online examples from the 'Performance' section of the RadGrid QSF which demonstrate how to realize in practice the above-mentioned optimization techniques.
I hope this information helps.
Kind regards,
Pavlina
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
thanks for your interest.
I've followed the links and try to apply the following solutions:
- Enabling RadCompression on ViewState (modifying the Web.Config XML)
- Caching the ViewState on Session or HiddenField using the BrowserFile.browser file
- Setting the EnableViewState property to false on RadGrid
None of them significantly has enhanced the performance.
Now I would like to use the RadInputManager technique in order to substitute the RadNumericTextBox inside the ItemTemplate of the RadGrid with a simple TextBox.
The code is similar to the following (sample with only one of the final 20 columns) in the case of RadInputManager and RadGrid:
<
telerik:RadInputManager ID="inpMan" runat="server" Skin="Web20">
<telerik:NumericTextBoxSetting BehaviorID="numBeh" EmptyMessage="..." InitializeOnClient="false">
<TargetControls>
<telerik:TargetInput ControlID="txtCoord1" />
</TargetControls>
</telerik:NumericTextBoxSetting>
</telerik:RadInputManager>
<
telerik:RadGrid ID="gridGeo" runat="server" DataSourceID="objGeoSist" GridLines="None"
AllowAutomaticUpdates="true" Skin="WebBlue" Width="984px" Font-Names="Segoe Condensed"
Font-Size="10px" Height="450px" >
<MasterTableView AutoGenerateColumns="False" DataSourceID="objGeoSist"
Font-Names="Segoe Condensed" TableLayout="Fixed" DataKeyNames="Id_sistema,Cortina,Pannello">
<Columns>
<
telerik:GridTemplateColumn HeaderText="X[m]" UniqueName="Coord1" SortExpression="Coord1">
<HeaderStyle Width="50px" />
<ItemStyle Width="30px" />
<ItemTemplate>
<asp:TextBox ID="txtCoord1" runat="server" Text='<%# Bind("Coord1") %>' Width="30px"
CssClass="casella_void" Font-Names="Segoe Condensed"></asp:TextBox>
</ItemTemplate>
</telerik:GridTemplateColumn>
//OTHER COLUMNS...
</Columns>
</MasterTableView>
</telerik:RadGrid>
The problem is that, when rendered, only the first row of the datagrid has the desidered RadInputManger defined behavior while the following rows are rendered only as normal TextBox without any numeric check.
How can I modify the code to allows the RadInputManager to checks to all the rows of the DataGrid?
Please note that the final row of the DataGrid has different type of controls inside, not only numeric textbox (also normal labels and RadComboBox).
Thanks.
Please go through the following online example, which shows how you can add the grid edit form TextBoxes to different RadInputManager settings dynamically.
Using RadInputManager
I hope this helps.
Greetings,
Pavlina
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
I've had yet seen yesterday that sample but it does not work in my case:
- I've an Excel-like grid, so I have a matrix of controls and not a TemplateEdit with single controls to refer in RadInputManager;
- I cannot apply an unique RadInputManager behavior to all the controls of the RadGrid (as suggested in the sample about the Repeater control) since some columns contains text, other numeric values with no decimals, other numeric values with 3 decimals and so on.
If in RadInputManager I refer the ControlId used in the <ItemTemplate> sections of the RadGrid, only the first row of that grid will have the expected validation defined in RadInputManger, the other rows will be rendered without validation behavior.
I suggest you isolate a working sample of your project and send it enclosed to a regular support ticket. We will examine your test cases and will get back to you with our findings.
Looking forward for your reply.
All the best,
Pavlina
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Have you solved your Problem? We have the same problem, a grid like Excel and the RadInputManager does nothing with the textboxes in the Grid. Maybe you can tell us the solution.
Greetings,
Stefan
Can you specify which is the version of RadControls you are using in your project? If you are not using the latest version, I recommend you download it and see if it makes any difference. You can also examine the updated version of Excel-like RadGrid project which is available in the below link:
http://www.telerik.com/community/code-library/aspnet-ajax/grid/excel-look-and-feel-for-radgrid.aspx
Regards,
Pavlina
Telerik
Thanks for you help. I took a look on the sample but it didn't help because the RadInputManager is not used there.
We are using the newest Telerik version. I have raised a support ticket on Friday but haven't received an answer yet. Maybe they can help me.
Kind regards and thanks for the help,
Stefan
Your support ticket is already answered and I will paste the reply of my colleague here:
Thank you for contacting us.
We are planning to provide an example illustrating RadGrid with RadInputManager but this most probably be for one of the next releases.
The problem with your code is that at the moment when the editor controls are created the RadInputManager have executed its logic and was not able to find the needed controls. To resolve this you need to place the RadInputManager after the RadGrid control.
Additionally, when you are using hierarchy relations or NeedDataSource you should never call the DataBind() method of RadGrid. This could break the whole binding logic.
I modified the project to illustrate the approach. Give it a try and you should not have further problems.
Regards,
Andrey
Telerik
Regards,
Pavlina
Telerik