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

Grid Efficiency

9 Answers 74 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Maher
Top achievements
Rank 1
Maher asked on 21 Jul 2015, 09:33 AM

hi Telerik

this is my first post

I'm evaluating your last release for my company for choosing a third party controls

i have multiple issues

I'm building a page with a grid with invoices when selecting invoice and click edit (Custom button not the grid command ) it open that invoice in another page (invoiceDetail.aspx?ID=..) in a Rad window so the user can edit the items in the invoice and add more or edit

normally i had item search in the detail page that should open the item list to choose item s

1- about the efficiency i read on your forum that to increase the the speed of the grid load time i should use this method

http://www.asp.net/web-forms/overview/data-access/paging-and-sorting/efficiently-paging-through-large-amounts-of-data-cs

but this does not work with filtering ??? is there any thing to include filtering with this technique

2-when you read my situation you will know that i need to open radwindow within another radwindow (open search page within the invoice detail page)

this some thing i can't do

the first window opens perfect

    function ShowEditForm(id, rowIndex) {
                    var grid = $find("<%= RadGrid1.ClientID %>");
                var rowControl = grid.get_masterTableView().get_dataItems()[rowIndex].get_element();
                grid.get_masterTableView().selectItem(rowControl, true);
                window.radopen("trans.aspx?Serial=" + id, "UserListDialog", 1000, 800,30,30);
                return false;
            }​

 <telerik:RadWindowManager ID="RadWindowManager1" runat="server" EnableShadow="true">
            <Windows>
                <telerik:RadWindow ID="UserListDialog" runat="server" Title="Editing record" Height="320px"
                    Width="310px" Left="150px" ReloadOnShow="true" ShowContentDuringLoad="false"
                    Modal="true">
                </telerik:RadWindow>
            </Windows>
        </telerik:RadWindowManager>

this code run on the first page but not the second

should i put another window manager with another window on the second page

https://pnamburi.wordpress.com/2010/03/31/open-radwindow-from-within-a-radwindow/

no thing on this page worked with me

the manager always null even window.radopen(url) give error TypeError: d is undefined window.radopen​

3- the item search page (i open it now via normal JavaScript ) just a page with grid of items if the parent row is edit mode(Change the item) and return the selected item instead of the old item

if the parent row is new allow multiselect in this case i need to add these items to the grid

 

thank you

9 Answers, 1 is accepted

Sort by
0
Maher
Top achievements
Rank 1
answered on 21 Jul 2015, 07:22 PM

i managed to solve Q2

http://demos.telerik.com/aspnet-ajax/window/examples/dialogreturnvalue/defaultcs.aspx

Q3 Changed

i opened the search page with radwindow 

this code to get a datatable with the selected rows(dtTable is grid datasource)

  dtResult = dtTable.Clone();
            foreach (GridDataItem item in RadGrid1.SelectedItems)
            {
                dtResult.ImportRow (dtTable.Select("F_ACCOUNTNO=" + item["F_ACCOUNTNO"].Text.ToString())[0]);
            }​

3-a :how to send this datatable dtResult  to Parent?

3-b: if it is edit mode(in place edit) i need to put the result of the search in the  F_ACCOUNTNO edit text

    if new create new rows and keep them in edit mode

0
Maher
Top achievements
Rank 1
answered on 23 Jul 2015, 07:58 AM

Hi two days and no answer ???

3-A: i will but the datatable in session but what server event will fire when radwindow close

0
Pavlina
Telerik team
answered on 24 Jul 2015, 10:15 AM
Hello,

Useful tips for improving RadGrid performance are available in the article below:
http://docs.telerik.com/devtools/aspnet-ajax/controls/grid/performance/grid-performance-optimizations

Please give them a try and let us know if you need additional assistance.

Regarding your third question:
The only way to catch a RadWindow's event on the server is to manually trigger the postback (full or partial). The control is entirely client-side and this is why it has no server events. You can refer to the forum post below where the same subject is discussed:
http://www.telerik.com/forums/catching-close-event-server-side

About question 3-b - I am not sure what exactly you are trying to achieve. Could you elaborate a bit more in the details.

Regards,
Pavlina
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Maher
Top achievements
Rank 1
answered on 24 Jul 2015, 11:38 AM

Thank you for repay

3-b: if it is edit mode(in place edit) i need to put the result of the search in the  F_ACCOUNTNO edit text
    if new create new rows and keep them in edit mode

what do i mean

if it is existing row -   grid edit mode in place - with the first field is Account No  - i put a search button to Search for Account

i need to take the selected value from the search form(Opened in rad window) and put that value in the Account Field and replace the old Value

if it is New Row the user can select Multiple Accounts now i should create  Multiple  grid rows put each account in a row

and keep the rows on edit mode to complete the row data 

 

0
Maher
Top achievements
Rank 1
answered on 24 Jul 2015, 05:36 PM

Regarding catching close event of Radwindow

the situation is similar to that demo

http://demos.telerik.com/aspnet-ajax/window/examples/dialogreturnvalue/defaultcs.aspx​

main page open radwindow that it self open another radwindow

now your solution i guess will be in main page where the RadAjaxManager isbut i need to catch it from the first Radwindow

(the opener ) as the search result (Datatable)

0
Pavlina
Telerik team
answered on 29 Jul 2015, 11:35 AM
Hello,

Below you can find a code that shows how you can locate the control that contains the cell's value and, depending on the type of the column editor, cast it to the appropriate type, and access the value:
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
{
    if (e.Item is GridEditableItem && e.Item.IsInEditMode)
    {
       GridEditableItem editableItem = e.Item as GridEditableItem;
       TextBox textBox = editableItem["AccountColumnUniqueName"].Controls[0] as TextBox;
       // replace the old value based on your requirements
    }
}

Once you have the old value you can replace it with the one you wish based on your scenario.

Regards,
Pavlina
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Pavlina
Telerik team
answered on 29 Jul 2015, 12:23 PM

Hello,

Regarding your question related to RadWindow control - using the javascript code below you should be able to get reference to the opened window:
function openWin2() {
               var parentPage = GetRadWindow().BrowserWindow;
               var parentRadWindowManager = parentPage.GetRadWindowManager();
               window.setTimeout(function () {
               var window2 = parentRadWindowManager.open("Dialog2.aspx", "RadWindow2");
               }, 0);
           }


Then you should be able to add a function that will be called when a RadWindow is closed using add_close method. Thus you will be able to execute your custom logic that will change the content of the first window when the second one is closed:
http://docs.telerik.com/devtools/aspnet-ajax/controls/window/client-side-programming/radwindow-object#methods-for-modifying-client-side-event-handlers-dynamically
window2.add_close(some_handler);

Regards,
Pavlina
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Maher
Top achievements
Rank 1
answered on 30 Jul 2015, 04:17 PM

thank you for response

but your solution is client side (add_close)

how can i send Datatable(Selected items from grid)though that

the situation send selected rows from grid in radwindow to the other radwindow

i managed to put selected rows on datatable now i need to pass them (session , variable ,object ,etc)

0
Pavlina
Telerik team
answered on 04 Aug 2015, 01:57 PM
Hi,

You can refer to the article below for more information how to access selected items client-side:
http://docs.telerik.com/devtools/aspnet-ajax/controls/grid/client-side-programming/gridtableview-object/properties/get_selecteditems%28%29

Regards,
Pavlina
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Grid
Asked by
Maher
Top achievements
Rank 1
Answers by
Maher
Top achievements
Rank 1
Pavlina
Telerik team
Share this question
or