This is a migrated thread and some comments may be shown as answers.

[Solved] Very low performance on DataBing using an Excel-like grid implementation

9 Answers 172 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Marco Miccini
Top achievements
Rank 1
Marco Miccini asked on 07 Jan 2010, 08:21 AM
Dear all,
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

Sort by
0
Pavlina
Telerik team
answered on 07 Jan 2010, 09:19 AM
Hi Marco,

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.
0
Marco Miccini
Top achievements
Rank 1
answered on 07 Jan 2010, 07:08 PM
Dear Pavlina,
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.
0
Pavlina
Telerik team
answered on 08 Jan 2010, 04:54 PM
Hello Marco,

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.
0
Marco Miccini
Top achievements
Rank 1
answered on 08 Jan 2010, 05:31 PM
Dear Pavlina,
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.
0
Pavlina
Telerik team
answered on 11 Jan 2010, 02:38 PM
Hello Marco,

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.
0
Stefan
Top achievements
Rank 1
answered on 22 May 2013, 01:49 PM
Hi Marco,

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
0
Pavlina
Telerik team
answered on 27 May 2013, 10:13 AM
Hello 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
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Stefan
Top achievements
Rank 1
answered on 27 May 2013, 12:02 PM
Hi Pavlina,

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
0
Pavlina
Telerik team
answered on 30 May 2013, 11:59 AM
Hello 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
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Grid
Asked by
Marco Miccini
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Marco Miccini
Top achievements
Rank 1
Stefan
Top achievements
Rank 1
Share this question
or