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

How to update calculated columns after rad window closes

2 Answers 53 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Chris LaFrancis
Top achievements
Rank 1
Chris LaFrancis asked on 26 Apr 2010, 09:16 PM
In the itemDataBound event I change the image of a couple of columns when the page is initially loaded. The images are based on an upper and lower limit that is initially set to default values and compared to the value in another data bound column. That is working fine.
My questions is this - I have a  link button in the command item template that opens a Rad Window and allows them to set their upper and lower limit. When the window closes I need to update the images on those 2 columns again based on the limits they selected.
What is the best way to accomplish this?
Thank you for your help with this.

2 Answers, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 27 Apr 2010, 07:05 AM

Hi Chris,

You could attach OnClientClose() event to radwindow and pass the upper/lower limits to code behind by invoking an ajaxRequest() as described in the forum.

Now in the AjaxManager_AjaxRequest event, get the parameters and iterate through the radgrid items using foreach loop. Then update the images (using same logic that you tried in ItemDataBound) based on the upper/lower limits passed.

 
    protected void RadAjaxManager1_AjaxRequest1(object sender, AjaxRequestEventArgs e)   
    {   
        string values = e.Argument;  // Get the argument passed  
        string[] array;   
        array = values.Split(',');   
        foreach (GridDataItem item in RadGrid1.MasterTableView.Items)  
        {  
            // Your logic to update the images  
        }  
    }  

Feel free to share the comments :)

Shinu.

0
Chris LaFrancis
Top achievements
Rank 1
answered on 27 Apr 2010, 01:56 PM
That worked great. I had the AjaxRequest to get the array values from the window, just didn't know to loop through the data items to update them.
Thank you for your help.
Tags
Grid
Asked by
Chris LaFrancis
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Chris LaFrancis
Top achievements
Rank 1
Share this question
or