Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
49 views


protected void Page_Init(object sender, EventArgs e)
        {

            string strPlant = string.Empty;            

            if (Session["PlantVal"] != null)
            {
                strPlant = Session["PlantVal"].ToString();

                if (strPlant != null && strPlant.Trim().Length > 0)
                {
                    DefineGridStructure(strPlant);
                }
            }
            
        }


public DataTable DefineGridStructure(string strPlant)
        {
            dtRakeLoad = new DataTable();

            Plants oplant = new Plants();
            GridBoundColumn boundColumn = new GridBoundColumn();
            dtRakeLoad .Columns.Add("Date", typeof(string));
            this.RadGrid1.MasterTableView.Columns.Add(boundColumn);
            boundColumn.DataField = "Date";
            boundColumn.UniqueName = "Date";
            boundColumn.HeaderText = "Date";
            boundColumn.DataType = System.Type.GetType("System.String");


            GridBoundColumn boundColumn1;

            DataSet ds = new DataSet();
            ds = oplant.GetChildCode(strPlant);
            string strChildCode = ds.Tables[0].Rows[0][0].ToString();
            Session["ChildCode"] = strChildCode;
            DataTable dtgroup = new DataTable();
            string strgroup = strChildCode;
            dtgroup = oplant.GetPlant(strgroup);

            DataRow dtRow = null;
            if (dtgroup != null)
            {
                foreach (DataRow dr in dtgroup.Rows)
                {
                    String sPlantName = "";
                    String sPlantCode = "";                    
                    sPlantCode = dr["PlantCode"].ToString();
                    dtRakeLoad .Columns.Add(sPlantCode, typeof(string));
                    boundColumn1 = new GridBoundColumn();
                    this.RadGrid1.MasterTableView.Columns.Add(boundColumn1);
                    boundColumn1.DataField = sPlantCode;
                    boundColumn1.UniqueName = sPlantCode;
                    boundColumn1.HeaderText = sPlantCode;
                    boundColumn1.DataType = System.Type.GetType("System.String");

                }

            }

            

            string templateColumnName = "Total";
            GridTemplateColumn templateColumn = new GridTemplateColumn();
            dtRakeLoad .Columns.Add("Total", typeof(string));
            templateColumn.ItemTemplate = new MyTemplate1(templateColumnName);
            this.RadGrid1.MasterTableView.Columns.Add(templateColumn);
            templateColumn.UniqueName = "Total";
            templateColumn.DataField = "Total";
            templateColumn.HeaderText = "Total";
            templateColumn.DataType = System.Type.GetType("System.String");


            DataTable dtport = new DataTable();
            dtport = oplant.GetPortName(strgroup);
            GridTemplateColumn templateColumn1;
            if (dtport != null)
            {

                foreach (DataRow dr in dtport.Rows)
                {
                    string sPortName = "";
                    string sPortCode = "";
                    sPortName = dr["PortName"].ToString();
                    sPortCode = dr["PortCode"].ToString();


                    dtRakeLoad .Columns.Add(sPortName, typeof(string));
                    templateColumn1 = new GridTemplateColumn();

                    this.RadGrid1.MasterTableView.Columns.Add(templateColumn1);
                    templateColumn1.ItemTemplate = new TemplatePort(sPortCode);

                    templateColumn1.DataField = sPortName;
                    templateColumn1.UniqueName = sPortName;
                    templateColumn1.HeaderText = sPortName;
                    templateColumn1.DataType = System.Type.GetType("System.String");


                }
            }

            string templateColumnName2 = "UnAllot";
            GridTemplateColumn templateColumn2 = new GridTemplateColumn();
            dtRakeLoad.Columns.Add("UnAllot", typeof(string));
            templateColumn2.ItemTemplate = new MyTemplate3(templateColumnName2);            
            this.RadGrid1.MasterTableView.Columns.Add(templateColumn2);
            templateColumn2.UniqueName = "Unallot";
            templateColumn2.HeaderText = "UnAllot";
            templateColumn2.DataField = "UnAllot";
            templateColumn2.DataType = System.Type.GetType("System.String");

            string templateColumnName3 = "Rake";
            GridTemplateColumn templateColumn3 = new GridTemplateColumn();
            dtRakeLoad.Columns.Add("Rake", typeof(string));
            templateColumn3.ItemTemplate = new MyTemplate4(templateColumnName3);
            this.RadGrid1.MasterTableView.Columns.Add(templateColumn3);
            templateColumn3.DataField = "Rake";
            templateColumn3.UniqueName = "Rake";
            templateColumn3.HeaderText = "Rake";
            templateColumn3.DataField = "Rake";
            templateColumn3.DataType = System.Type.GetType("System.String");           
            RadGrid1.DataSource = dtRakeLoad;
            return dtRakeLoad;
}





chennaiah P
Top achievements
Rank 1
 asked on 06 Mar 2010
1 answer
110 views
Hi,

I have a page which checks three textboxes.
It all works great in my development IDE on the webserver.
However, when I access the page over the internet, I get an error.
It only happens when I have more than one text box also.
If I just have one text box, it works via the internet.

Error

Any help would be great.

Tim
Tim McDonnell
Top achievements
Rank 1
 answered on 05 Mar 2010
0 answers
228 views
Hi,
I've a user control in an aspx page.
In my aspx page, I do the following:

<

 

AjaxSettings>

 

 

<telerik:AjaxSetting AjaxControlID="m_radGrid">

 

 

<UpdatedControls>

 

 

<telerik:AjaxUpdatedControl ControlID="m_radGrid" LoadingPanelID="m_radAjaxLoadingPanel" />

 

 

</UpdatedControls>

 

 

</telerik:AjaxSetting>

 

 

</AjaxSettings>

 

 

<telerik:RadAjaxLoadingPanel ID="m_radAjaxLoadingPanel" runat="server" Skin="Default">

 

 

</telerik:RadAjaxLoadingPanel>

 


But the loading panel doesnot appear.

Note:="m_radGrid" is called from another usercontrol. so user control embedded within another user control. How do I make loading panel to appear?



Ayesha
Top achievements
Rank 1
 asked on 05 Mar 2010
9 answers
522 views
I found an odd behavior from the DatePicker in version 2008.3.1314.35

If I use the date format MM/yyyy, no matter what month I pick it always sets the date to the current month.

So if I select May 2009, it sets it to 12/2009.  If I select March 2010, it sets it to 12/2010.  Now if I change the format to MM/DD/yyyy it works as expected.

Here is an example of one of my datepickers

<telerik:RadDatePicker ID="TextBoxMonthEndDate" runat="server" Calendar-ShowRowHeaders="false" Skin="Vista">  
   <DatePopupButton ImageUrl="~/images/Calendar_scheduleHS.png" HoverImageUrl="~/images/Calendar_scheduleHS.png" /> 
   <DateInput DateFormat="MM/yyyy" runat="server" /> 
</telerik:RadDatePicker>   


Has this been fixed in more recent versions?
Jeremy Yoder
Top achievements
Rank 1
 answered on 05 Mar 2010
1 answer
219 views
I am trying to convert a DataList to a ListView.  The DataList has an ItemDataBoundEvent that I need to add to the ListView, what is the event argument for a list view?:

protected void dListItems_ItemDataBound(object sender, DataListItemEventArgs e)
{

}
Daniel
Telerik team
 answered on 05 Mar 2010
6 answers
300 views
Hi

this is shanker am doing project my requirement is rad grid filtered by rad combo box .when ever am click edit button and add new  the rad grid is cleared how to solve that  .

This is my code

protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Facility.DataSource = studentremarks.org_view_facility_lookup();
                Facility.DataBind();
                
            }
        }
        public void getdata()
        {
            grdstudentremarks.DataSource = studentremarks.sch_view_sch_student_remark_list(RadcomFiscalyear.SelectedValue.GetInteger(), Radcomclass.SelectedValue.GetInteger());
            grdstudentremarks.DataBind();
        }
        protected void Facility_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e)
        {
            RadcomFiscalyear.DataSource = Feeschedulemanager.sch_view_fiscal_year_lookup(Facility.SelectedValue.GetInteger());
            RadcomFiscalyear.DataBind();
            Radcomclass.DataSource = studentremarks.sch_view_class_lookup(Facility.SelectedValue.GetInteger());
            Radcomclass.DataBind();
        }

        protected void Radcomclass_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e)
        {
            getdata();
        }

        protected void grdstudentremarks_DeleteCommand(object source, GridCommandEventArgs e)
        {
            GridEditableItem editedItem = e.Item as GridEditableItem;
            int? eventId = GetEventId(editedItem);
            if (eventId.HasValue)
            {

                try
                {
                    string status_text = String.Empty;
                    bool res = studentremarks.org_sproc_dml_org_person_remarks_del(eventId.Value, out status_text);
                    if (res)
                    {
                        DisplayMessage(false, "Fisacl_year deleted");
                    }
                    else
                    {
                        e.Canceled = true;
                        DisplayMessage(true, "Can't delete Fisacl_year. Reason: " + status_text);
                    }
                }
                catch (Exception ex)
                {
                    e.Canceled = true;
                    DisplayMessage(true, "Fisacl_year cannot be deleted. Reason: " + ex.Message);
                }
            }
            else
            {
                e.Canceled = true;
                DisplayMessage(true, "Such Fisacl_year does not exist");
            }
        }

        protected void grdstudentremarks_InsertCommand(object source, GridCommandEventArgs e)
        {
            int? faciltyid = LogonDetails.Instance.sys_lclvar_default_facility_id;

            GridEditableItem editedItem = e.Item as GridEditableItem;
            Dictionary<string, object> values = ParseEditValues(editedItem);
            string msg;
            if (ValidateFields(values, out msg))
            {
                try
                {
                    LogonDetails det = LogonDetails.Instance;
                    string status_text = String.Empty;
                    bool res = studentremarks.org_sproc_dml_org_person_remarks_ins(Convert.ToInt32(values["StudentName"])as int?,Convert.ToInt32(values["ReportedResource"])as int?,
                    values["RemarkDate"] as DateTime?,values["description"]as string ,(bool)values["BadRemark"], out status_text, (bool)values["Goodremark"]);
                    if (res)
                    {
                        DisplayMessage(false, "Fisacl_year inserted");
                    }
                    else
                    {
                        e.Canceled = true;
                        DisplayMessage(true, "Can't insert Fisacl_year. Reason: " + status_text);
                    }
                }
                catch (Exception ex)
                {
                    e.Canceled = true;
                    DisplayMessage(true, "Fisacl_year cannot be inserted. Reason: " + ex.Message);
                }
            }
            else
            {
                e.Canceled = true;
                DisplayMessage(true, msg);
            }
        }

        protected void grdstudentremarks_UpdateCommand(object source, GridCommandEventArgs e)
        {
            int? faciltyid = LogonDetails.Instance.sys_lclvar_default_facility_id;
            GridEditableItem editedItem = e.Item as GridEditableItem;
            Dictionary<string, object> values = ParseEditValues(editedItem);
            int? eventId = GetEventId(editedItem);
            if (eventId.HasValue)
            {
                try
                {
                    string status_text = String.Empty;
                    bool res = studentremarks.org_sproc_dml_org_person_remarks_upd(eventId.Value, Convert.ToInt32(values["StudentName"]) as int?, Convert.ToInt32(values["ReportedResource"]) as int?,
                    values["RemarkDate"] as DateTime?, values["description"] as string, (bool)values["BadRemark"], out status_text, (bool)values["Goodremark"]);
                    if (res)
                    {
                        DisplayMessage(false, "Fisacl_year updated");
                    }
                    else
                    {
                        e.Canceled = true;
                        DisplayMessage(true, "Can't update Fisacl_year. Reason: " + status_text);
                    }
                }
                catch (Exception ex)
                {
                    e.Canceled = true;
                    DisplayMessage(true, "Fisacl_year cannot be updated. Reason: " + ex.Message);
                }
            }
            else
            {
                e.Canceled = true;
                DisplayMessage(true, "Such Fisacl_year does not exist");
            }
        }

        protected void grdstudentremarks_PreRender(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                //GridColumn editColumn = grdstudentremarks.MasterTableView.GetColumn("EditCommandColumn");
                //if (editColumn != null) { editColumn.Visible = CanUpdate; }
                GridColumn deleteColumn = grdstudentremarks.MasterTableView.GetColumn("DeleteCommandColumn");
                if (deleteColumn != null) { deleteColumn.Visible = CanDelete; }
                if (!CanInsert)
                {
                    HideInsertCol(grdstudentremarks);
                }
                getdata();
            }
        }

        protected override int GetScreenId()
        {
            return Screens.studentremarks;
        }
        private bool ValidateFields(Dictionary<string, object> values, out string msg)
        {
            msg = String.Empty;
            bool res = false;
            if (values != null)
            {
                res = true;
                if ((!values.ContainsKey("fiscal_year")) || (values["fiscal_year"] == null) || (string.IsNullOrEmpty(values["fiscal_year"].ToString())))
                {
                    msg = "Select Fiscalyear";
                    res = false;
                }
            }
            return res;
        }
        private int? GetEventId(GridItem item)
        {
            int? id = null;
            if (item != null)
            {
                if (item.ItemIndex >= 0)
                {
                    id = item.OwnerTableView.DataKeyValues[item.ItemIndex]["person_id"].ToString().GetInteger();
                }
            }
            return id;
        }
        private Dictionary<string, object> ParseEditValues(GridEditableItem editedItem)
        {
            Dictionary<string, object> dic = new Dictionary<string, object>();

            if (editedItem != null)
            {
                editedItem.OwnerTableView.ExtractValuesFromItem(dic, editedItem);
                RadComboBox StudentName = editedItem.FindControl("StudentName") as RadComboBox;
                if (StudentName != null)
                {
                    dic.Add("StudentName", StudentName.SelectedValue.GetInteger());
                }
                RadComboBox ReportedResource = editedItem.FindControl("ReportedResource") as RadComboBox;
                if (ReportedResource != null)
                {
                    dic.Add("ReportedResource", ReportedResource.SelectedValue.GetInteger());
                }
                RadDatePicker RemarkDate = editedItem.FindControl("RemarkDate") as RadDatePicker;
                if (RemarkDate != null)
                {
                    dic.Add("RemarkDate", RemarkDate.SelectedDate);
                }
                TextBox txtDescription = editedItem.FindControl("txtDescription") as TextBox;
                if (txtDescription != null)
                {
                    dic.Add("description", txtDescription.Text);
                }

                CheckBox Goodremark = editedItem.FindControl("Goodremark") as CheckBox;
                dic.Add("Goodremark", Goodremark.Checked);
                CheckBox BadRemark = editedItem.FindControl("BadRemark") as CheckBox;
                dic.Add("BadRemark", BadRemark.Checked);
            }
            return dic;
        }

        protected void grdstudentremarks_ItemDataBound(object sender, GridItemEventArgs e)
        {
            int? faciltyid = Facility.SelectedValue.GetInteger();

            if (e.Item is GridEditFormItem && e.Item.IsInEditMode)
            {
                int? eventId = GetEventId(e.Item);
                RadComboBox StudentName = e.Item.FindControl("StudentName") as RadComboBox;
                if (StudentName != null)
                {
                    StudentName.DataSource = studentremarks.sch_view_class_student_lookup(faciltyid,Radcomclass.SelectedValue.GetInteger(),RadcomFiscalyear.SelectedValue.GetInteger());
                    StudentName.DataBind();
                }
                RadComboBox ReportedResource = e.Item.FindControl("ReportedResource") as RadComboBox;
                if (ReportedResource != null)
                {
                    ReportedResource.DataSource = subjectmanager.org_view_department_lookup();
                    ReportedResource.DataBind();
                }
               


                if (e.Item.OwnerTableView.IsItemInserted)
                {
                    //item is about to be inserted
                }
                else
                {
                    if (eventId.HasValue)
                    {
                        var det = studentremarks.sch_view_sch_student_remark_detail(eventId.Value);



                        if (det != null)
                        {
                            
                            TextBox txtDescription = e.Item.FindControl("txtDescription") as TextBox;
                            if (txtDescription != null)
                            {
                                txtDescription.Text = det.description;
                            }
                            RadDatePicker RemarkDate = e.Item.FindControl("RemarkDate") as RadDatePicker;
                            if (RemarkDate != null)
                            {
                              
                                RemarkDate.SelectedDate = det.remark_date;
                            }
                            CheckBox Goodremark = e.Item.FindControl("Goodremark") as CheckBox;
                            {
                                if (Goodremark != null)
                                {
                                    Goodremark.Checked = det.good_remark;
                                }

                            }
                            CheckBox BadRemark = e.Item.FindControl("BadRemark") as CheckBox;
                            {
                                if (BadRemark != null)
                                {
                                    BadRemark.Checked = det.bad_remark;
                                }

                            }
                        }
                    }
                }
            }
        }


please how to solve that it,s argent 

thanks and regards
shanker.B
shanker bangari
Top achievements
Rank 1
 answered on 05 Mar 2010
1 answer
221 views
Hello,

I have a data export screen which is exporting about 30,000 records in one scenario.  In this scenario, the data query takes about 2-3 seconds from the database when we run it in SQL, but it's taking 3-7 minutes to generate the Excel file.  In my page, I bind the grid when I have the results and the page spins while it generates the Excel file.

I'm generating the excel file from code via:

this

.rgResults.DataSource = set.Tables[0];

this.rgResults.DataBind();

this.rgResults.MasterTableView.ExportToExcel();


So I'm binding a data table.  The grid is statically on the page.  The UI of the grid is generated using AutoGenerateColumns, so I'm using whatever columns are there.  Getting the data from the adapter into the table is fast, so that isn't the issue.  The issue is the rendering of the data.

Can I speed that up somehow?  Or how can I debug this?  What might be affecting the slowness?  Is it just related to the amount of data?

Thanks.
Brian Mains
Top achievements
Rank 1
 answered on 05 Mar 2010
4 answers
344 views
I'm trying to accomplish a few things - and I can't get the last 20%.

I have a RadTabStrip (& MultiPage), a RadGrid and a button on my page.  Currently if you click the button, it will (via client-side JavaScript function), switch to the 2nd tab, set the RadGrid to insert a new record, and focus on the first box.

What I'd like to do is to populate a few of the RadTextBoxes with some values (which were passed to the function when the button was clicked).  However, since the process to change the RadGrid so that it can insert a new record is a server-side hit...I can't figure out how to do this.

Suggestions?
Kris
Top achievements
Rank 1
 answered on 05 Mar 2010
4 answers
671 views
<telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateEditColumn="True" DataSourceID="SqlDataSource1" 
    GridLines="None" PageSize="15" OnItemDataBound="RadGrid1_ItemDataBound" AllowPaging="True" 
    OnItemCreated="RadGrid1_ItemCreated" AllowSorting="True" Skin="Vista" OnItemCommand="RadGrid1_ItemCommand" 
    OnPreRender="RadGrid1_PreRender" AllowAutomaticUpdates="True" >  
    <MasterTableView AutoGenerateColumns="False" DataSourceID="SqlDataSource1" DataKeyNames="ticket_id, id" 
        CommandItemDisplay="Top"
        <CommandItemTemplate> 
            <table> 
                <tr> 
                    <td> 
                        <asp:ImageButton ImageUrl="~/image/AddRecord.gif" ID="btnAllTickets" runat="server" 
                            CommandName="AllFiles" /> 
                        All Tickets 
                    </td> 
                    <td> 
                        <asp:ImageButton ImageUrl="~/image/AddRecord.gif" ID="btnUnansweredTickets" runat="server" 
                            CommandName="Unanswered" /> 
                        Unanswered Tickets </asp:LinkButton> 
                    </td> 
                </tr> 
            </table> 
        </CommandItemTemplate> 
        <RowIndicatorColumn> 
            <HeaderStyle Width="20px"></HeaderStyle> 
        </RowIndicatorColumn> 
        <ExpandCollapseColumn> 
            <HeaderStyle Width="20px"></HeaderStyle> 
        </ExpandCollapseColumn> 
        <Columns> 
            <telerik:GridBoundColumn DataField="id" HeaderText="id" SortExpression="id" UniqueName="id" 
                DataType="System.Int64" Visible="false"
            </telerik:GridBoundColumn> 
            <telerik:GridBoundColumn DataField="t_id" HeaderText="t_id" ReadOnly="True" 
                SortExpression="ticket_id" UniqueName="ticket_id" Visible="false"
            </telerik:GridBoundColumn> 
            <telerik:GridBoundColumn DataField="username" HeaderText="Username" SortExpression="username" 
                UniqueName="username"
            </telerik:GridBoundColumn> 
            <telerik:GridBoundColumn DataField="subject" HeaderText="Subject" SortExpression="subject" 
                UniqueName="subject"
            </telerik:GridBoundColumn> 
            <telerik:GridBoundColumn DataField="department" HeaderText="department" SortExpression="department" 
                UniqueName="department" Visible="false"
            </telerik:GridBoundColumn> 
            <telerik:GridBoundColumn DataField="priority" DataType="System.Int32" HeaderText="priority" 
                SortExpression="priority" UniqueName="priority" Visible="false"
            </telerik:GridBoundColumn> 
            <telerik:GridBoundColumn DataField="status" HeaderText="status" SortExpression="status" 
                UniqueName="status" DataType="System.Int32" Visible="false"
            </telerik:GridBoundColumn> 
            <telerik:GridBoundColumn DataField="last_replier" HeaderText="last_replier" SortExpression="last_replier" 
                UniqueName="last_replier" Visible="false"
            </telerik:GridBoundColumn> 
        </Columns> 
        <DetailTables> 
           
            <telerik:GridTableView DataKeyNames="ticket_id, id" DataSourceID="SqlDataSource2" 
                Width="100%" runat="server" AutoGenerateColumns="false" OnSelectedIndexChanged="RadGrid1_SelectedIndexChanged"
                <ParentTableRelation> 
                    <telerik:GridRelationFields DetailKeyField="ticket_id" MasterKeyField="ticket_id" /> 
                </ParentTableRelation> 
                <Columns> 
                    <telerik:GridBoundColumn DataField="id" Visible="false" HeaderText="ID" ReadOnly="True" 
                        SortExpression="id" UniqueName="id"
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn DataField="ticket_id" HeaderText="ticket_id" Visible="False" 
                        ReadOnly="True" SortExpression="ticket_id" UniqueName="ticket_id"
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn DataField="tdate" HeaderText="Date" UniqueName="tdate"
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn DataField="message" HeaderText="Message" UniqueName="message"
                    </telerik:GridBoundColumn> 
                </Columns> 
                 <DetailTables> 
                 
                    <telerik:GridTableView DataSourceID="SqlDataSource3" Width="100%" DataKeyNames="ticketChildID" Name="ThirdTable" 
                        runat="server"  AutoGenerateColumns="False" CommandItemDisplay="Top" oninsertcommand="RadGrid1_InsertCommands"
                        <ParentTableRelation> 
                            <telerik:GridRelationFields DetailKeyField="id" MasterKeyField="ticket_id" /> 
                        </ParentTableRelation> 
                        <EditFormSettings EditFormType="Template" > 
                           
                            <FormTemplate> 
         
                                    <telerik:RadUpload ID="radup1" runat="server" AllowedFileExtensions=".zip,.jpg,.jpeg" /> 
                                    </telerik:RadUpload> 
                                    <asp:Button ID="b1" runat="server"  Text="Upload" CommandName="InsertForm" /> 
                      
                            </FormTemplate> 
                            <PopUpSettings ScrollBars="None" /> 
                        </EditFormSettings> 
                       <Columns> 
                        <telerik:GridBoundColumn DataField="filetitle" HeaderText="Attachment" UniqueName=" filetitle"
                    </telerik:GridBoundColumn> 
                       </Columns> 
                    </telerik:GridTableView> 
                </DetailTables> 
            </telerik:GridTableView> 
        </DetailTables> 
    </MasterTableView> 
</telerik:RadGrid> 
protected void RadGrid1_PreRender(object sender, EventArgs e) 
    { 
            for (int i = 0; i < RadGrid1.MasterTableView.Items.Count; i++) 
            { 
                RadGrid1.MasterTableView.Items[i].Expanded = true
            } 
          
        
    } 

It only expand the first Detail Table. how do i expand all child detail table?
Schlurk
Top achievements
Rank 2
 answered on 05 Mar 2010
1 answer
204 views
Hi there,

I am trying to use the method to explicitly show/hide the loading panel. My code is:

<

 

telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">

 

 

<AjaxSettings>

 

 

<telerik:AjaxSetting AjaxControlID="btnImport">

 

 

<UpdatedControls>

 

 

<telerik:AjaxUpdatedControl ControlID="Panel5" LoadingPanelID="LoadingPanel1" />

 

 

</UpdatedControls>

 

 

</telerik:AjaxSetting>

 

 

</AjaxSettings>

 

 

<ClientEvents OnRequestStart="RequestStart" OnResponseEnd="ResponseEnd" />

 

 

</telerik:RadAjaxManager>

 

 

<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server"

 

 

Skin="Vista">

 

 

</telerik:RadAjaxLoadingPanel>

 

 

<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">

 

 

<script type="text/javascript">

 

 

var currentLoadingPanel = null;

 

 

var currentUpdatedControl = null;

 

 

function RequestStart(sender, args) {

 

alert(

"Should Load");

 

currentLoadingPanel = $find(

"<%= RadAjaxLoadingPanel1.ClientID %>");

 

 

if (args.get_eventTarget() == "<%= btnImport.UniqueID %>") {

 

currentUpdatedControl =

"<%= Panel5.ClientID %>";

 

}

 

 

 

 

//show the loading panel over the updated control

 

currentLoadingPanel.show(currentUpdatedControl);

}

 

function ResponseEnd() {

 

 

//hide the loading panel and clean up the global variables

 

 

if (currentLoadingPanel != null)

 

currentLoadingPanel.hide(currentUpdatedControl);

currentUpdatedControl =

null;

 

currentLoadingPanel =

null;

 

}

 

</script>

 

 

</telerik:RadCodeBlock>

And I try and call it by:

 

RadAjaxManager1.ResponseScripts.Add(

"RequestStart();");

But i can't get it to show.
Can someone help figure out what Im doing wrong?

Thanks

 

robertw102
Top achievements
Rank 1
 answered on 05 Mar 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?