Telerik Forums
UI for ASP.NET AJAX Forum
7 answers
141 views
Hi,
          I would like to add two rad windows, one for alert purpose and another for linking another form into rad window. But i am able to add only one rad window at a time.

I used the below code for alert
        <telerik:RadWindowManager ID="RadAlertWindow" runat="server" />              
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">  
            <AjaxSettings> 
                <telerik:AjaxSetting AjaxControlID="RadGrid1">  
                    <UpdatedControls> 
                        <telerik:AjaxUpdatedControl ControlID="RadGrid1" /> 
                          <telerik:AjaxUpdatedControl ControlID="RadAlertWindow" /> 
                    </UpdatedControls> 
                </telerik:AjaxSetting> 
            </AjaxSettings> 
        </telerik:RadAjaxManager> 
CS Code
protected void btnTest_Click(object sender, EventArgs e)  
    {  
        string verbiage = "Testing Alert";          
        RadAjaxManager1.ResponseScripts.Add(@"radalert('" + verbiage + "', 330, 110);");            
    } 

The another RadWindow helps to show the linked page;
 function ShowForm(CID) {  
            window.radopen("FileInfo.aspx?cid="+CID, "OpenWindow");  
            return false;  
        }     
<telerik:RadWindowManager ID="RadWindowManager2" runat="server">  
            <Windows>              
                <telerik:RadWindow ID="OpenWindow" runat="server" Title="Test" Height="500px" 
                    Width="900px" Left="150px" ReloadOnShow="true" ShowContentDuringLoad="false" 
                    Modal="true" />                              
            </Windows>              
        </telerik:RadWindowManager> 

All the above codes are mentioned in single form, but when i try to show the rad window i am getting the following error

"Microsoft JScript runtime error: Sys.InvalidOperationException: Two components with the same id 'OpenWindow' can't be added to the application."

So how to solve the above issue

-Thanks
Yavor
Telerik team
 answered on 26 Mar 2010
1 answer
94 views
Hello,

I need help!
I want to add a customize a "New Appointment form" on click of RedScheduler. There I need some dropdowns and textboxes, how I can do it? Can you please provide a code example, also how I will get these values on server side, so that  on click of "Add" I can add these values into Database.

Please help as soon as possible, Thanks!

Mohit
Shinu
Top achievements
Rank 2
 answered on 26 Mar 2010
3 answers
230 views
Hi.

I am moving a pretty large chunk of our system from regular grids with semi ajaxified updates and paging to total client side binding through webservices.

We have a diverse user base, running different cultures pr. user in the system, so we need to be able to se the DataFormatString on Page_Load (or some other time) for the datetime columns so that the display is consistent throughout the system.

I have tried and tried, but  not had any luck.

How would I go about this ... ?

And I don't want to create OnDataBound functions for all the grids just to be able to do this ... there should be a way somehow to do this.

Thanks for the help,
- Arni Gunnar Ragnarsson.
Yavor
Telerik team
 answered on 26 Mar 2010
4 answers
419 views
I'm currently working on a web site reporting system, using the RadGrid.  The system must be able to support multiple ReportTypes which return different number of columns, column names, and even hierarchy.  I've setup a system that is driven by xml files and there are virtually no hard coded values, column names, templates, and so forth.  It needs to be lightweight and dynamic. Most of the RadGrid settings are pulled in at the Page_Init event.  The application is dynamically buidling columns with AutoGenerateColumns=true.

Everything is working great to this point but, I've run into a problem which I hope some of you can help me with.  I dynamically create image icons and link to javascript at the column header level and also at the row level.  Works great until a user initiaites some event that raises a PostBack at the hierarchy's child level.  My custom controls added to the RadGrid are lost in the PostBack.   Obviously I am doing something wrong but, I'm not sure how to address this.

In the code below you'll see that I am creating controls and adding them to the RadGrid. gridDataItem[gridColumn.UniqueName].Controls.Add controls collection.  These are the controls which get lost in the PostBack.

<telerik:RadAjaxPanel ID="ParentRadAjaxPanel" runat="server">  
<telerik:RadGrid ID="ParentRadGrid" runat="server" EnableEmbeddedSkins="false" Skin="BIC3RadSkin" 
    OnItemDataBound="RadGrid_ItemDataBound" OnColumnCreated="RadGrid_ColumnCreated" 
    OnNeedDataSource="RadGrid_NeedDataSource" OnSortCommand="RadGrid_SortCommand">  
    <MasterTableView> 
    </MasterTableView> 
</telerik:RadGrid> 
</telerik:RadAjaxPanel> 


    protected void RadGrid_ItemDataBound(object sender, GridItemEventArgs newGridDataItem)  
    {  
        try 
        {  
            RadGrid radGrid = (RadGrid)sender;
            #region Create Custom Header  
 
            if (newGridDataItem.Item.ItemType == GridItemType.Header)  
            {
                #region Create links to charts  
 
                    ...  
                    // Box a the ItemType as it is easier to use  
                    GridHeaderItem gridHeaderItem = (GridHeaderItem)newGridDataItem.Item;  
 
                    // Iterate thorugh every column and format the value  
                    foreach (GridColumn gridColumn in radGrid.MasterTableView.RenderColumns)  
                    {  
                        if (gridColumn.ColumnType != "GridExpandColumn" && gridColumn.ColumnType != "GridRowIndicatorColumn")  
                        {  
                            ...  
                            try 
                            {  
                                // Create a LinkButton control instead of setting the columns' .text property or the javascript will not work  
                                LinkButton linkButton = (LinkButton)gridHeaderItem[gridColumn.UniqueName].Controls[0];  
                                linkButton.Text = gridColumn.UniqueName;  
 
                                // Create a hyperLink control for the chart to work and does not interfere with the sort LinkButton  
                                if (_report.Grids[radGrid.ID][gridColumn.UniqueName].ChartColumnLink == true)  
                                {  
                                    String chartParameters = String.Format(" <a alt=\"Click to view chart\" href=\"javascript:ViewChart('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}','{9}');\"><img border=\"0\" src=\"images/iconChart.gif\"></a>", _report.ManagerUserID.ToString(), _report.DepartmentID, Convert.ToByte(_report.DepartmentDrillDown), _report.Location, Convert.ToByte(_report.ShiftWindow), _report.StartDate.ToShortDateString(), _report.EndDate.ToShortDateString(), _report.ReportType, _report.AggregationPeriod, gridColumn.UniqueName);  
 
                                    HyperLink chartHyperLink = new HyperLink();  
                                    chartHyperLink.Text = chartParameters;  
                                    gridHeaderItem[gridColumn.UniqueName].Controls.Add(chartHyperLink);  
                                }  
                            }  
                            catch 
                            {  
                                // If this fails, allow the column name to go w/o the chart link by default  
                            }  
                        }  
                    }  
                }
                #endregion Create links to charts  
            }
            #endregion Create Custom Header  
 
            ... // Create Custom Footer ommitted for easier troubleshooting  
 
            #region Put the proper formatting on values before display  
 
            if ((newGridDataItem.Item is GridDataItem) == true)  
            {  
                ...  
                GridDataItem gridDataItem = (GridDataItem)newGridDataItem.Item;  
 
                // Iterate thorugh every column and format the value  
                foreach (GridColumn gridColumn in radGrid.MasterTableView.RenderColumns)  
                {  
                    if (_report.Grids[radGrid.ID].ContainsKey(gridColumn.UniqueName) == true)  
                    {  
                        // Create the grid data item text in a control or .text property  
                        Label textLabel = new Label();  
                        if (gridDataItem[gridColumn.UniqueName].Text == "NaN")  
                        {  
                            // Weird: Add both text and a control. If there are more controls added below, the text is hidden but, if there are no other controls, the text will show.  
                            textLabel.Text = RadGrid_FormatText(radGrid, gridColumn.UniqueName, "0");  
                            gridDataItem[gridColumn.UniqueName].Text = RadGrid_FormatText(radGrid, gridColumn.UniqueName, "0");  
                        }  
                        else 
                        {  
                            // Do not display items that are special case exceptions governed by the .ReplaceHierarchyParentText property from xml  
                            if (String.IsNullOrEmpty(_report.Grids[radGrid.ID][gridColumn.UniqueName].ReplaceHierarchyParentText) == false && gridDataItem.OwnerTableView.ParentItem == null)  
                            {  
                                textLabel.Text = _report.Grids[radGrid.ID][gridColumn.UniqueName].ReplaceHierarchyParentText;  
                                gridDataItem[gridColumn.UniqueName].Text = _report.Grids[radGrid.ID][gridColumn.UniqueName].ReplaceHierarchyParentText;  
                            }  
                            else 
                            {  
                                // Weird: Add both text and a control. If there are more controls added below, the text is hidden but, if there are no other controls, the text will show.  
                                textLabel.Text = RadGrid_FormatText(radGrid, gridColumn.UniqueName, gridDataItem[gridColumn.UniqueName].Text);  
                                gridDataItem[gridColumn.UniqueName].Text = RadGrid_FormatText(radGrid, gridColumn.UniqueName, gridDataItem[gridColumn.UniqueName].Text);  
                            }  
                        }  
 
                        gridDataItem[gridColumn.UniqueName].Controls.Add(textLabel);
                        #region Create a hyperLink control for the chart to work and does not interfere with the sort  
 
                        // Create a hyperLink control for the chart to work and does not interfere with the sort LinkButton  
                        if (_report.Grids[radGrid.ID][gridColumn.UniqueName].ChartRowLink == true)  
                        {  
                            String chartParameters = String.Format(" <a alt=\"Click to view chart\" href=\"javascript:ViewChart('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}','{9}');\"><img border=\"0\" src=\"images/iconChart.gif\"></a>", gridDataItem[_childRadGridProperties["MasterTableView.DataKeyNames"]].Text, _report.DepartmentID, Convert.ToByte(_report.DepartmentDrillDown), _report.Location, Convert.ToByte(_report.ShiftWindow), _report.StartDate.ToShortDateString(), _report.EndDate.ToShortDateString(), _report.ReportType, _report.AggregationPeriod, gridColumn.UniqueName);  
 
                            HyperLink chartHyperLink = new HyperLink();  
                            chartHyperLink.Text = chartParameters;  
 
                            gridDataItem[gridColumn.UniqueName].Controls.Add(chartHyperLink);  
                        }
                        #endregion Create a hyperLink control for the chart to work and does not interfere with the sort  
                    }  
                }  
            }
            #endregion Put the proper formatting on values before display  
        }  
        catch (Exception exception)  
        {  
            //UNDONE: Wireup error handler object  
            Console.Write("error");  
        }  
    } 

Thanks!

Stacy
Stacy
Top achievements
Rank 1
 answered on 26 Mar 2010
2 answers
440 views

Hey,

I'm trying to get the value of a masked input field via javascript.

I'm using version 2.1.5.0 of the RadInput.Net2

On the founds I found:

http://www.telerik.com/community/forums/aspnet/input/radmaskedtextbox-javascript-value.aspx
http://www.telerik.com/community/forums/aspnet/input/input-into-radmaskedtextbox-with-qtp.aspx

However It's not working.

I've tried:

alert(document.getElementById('_ctl0_ph_txtSocialSecurityNumber').GetValue());

alert($find('_ctl0_ph_txtSocialSecurityNumber').GetValue());

alert(_ctl0_ph_txtSocialSecurityNumber.GetValue();

And a few other variations. Nothing works. I can get the value with jQuery and other methods but i need the unmasked version. The same functionality as the new version:

http://www.telerik.com/help/aspnet-ajax/input_clientsideradmaskedtextbox.html

get_value - Returns the value of the text box. This is the string without any prompt characters or literals.

Any ideas?

NaturalCause
Top achievements
Rank 1
 answered on 26 Mar 2010
2 answers
179 views
Hey!

I'd like to display text only summary of the content that was created through the editor with formatting, but no matter what I do, Server.HtmlDecode etc., there are still tags and bits and pieces left in it!! Is there a clean way of doing it? Cheers!
Joe
Top achievements
Rank 1
 answered on 26 Mar 2010
0 answers
163 views
Hi,
I have a rad combobox and i need to make a textbox as a required field if a particular item was selected in the combobox.

I have the following code:
<td valign="top" style="font-weight: normal" class="ms-formbody"> 
                <%-- <asp:DropDownList ID="ddlReferralSource" runat="server" Width="132"> 
                </asp:DropDownList>--%> 
                <telerik:RadComboBox runat="server" ID="radComboReferralSource" AllowCustomText="false" 
                    EnableLoadOnDemand="false" MarkFirstMatch="true" OnClientSelectedIndexChanged="ValidateHearAboutUsSource" > 
                </telerik:RadComboBox> 
                <asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator2" ControlToValidate="radComboReferralSource" 
                    Display="Dynamic" SetFocusOnError="true" ErrorMessage="<%$Resources:CareerResources, Career_RequiredField%>" 
                    ValidationGroup="profile" InitialValue="<%$Resources:CareerResources, Career_SelectText%>"></asp:RequiredFieldValidator> 
            </td> 
            <td> 
                <asp:TextBox runat="server" ID="txtHearAboutUsSourceValue"></asp:TextBox> 
                 <asp:RequiredFieldValidator runat="server" ID="rfvHearAboutUsSourceValue" ControlToValidate="txtHearAboutUsSourceValue" 
                    Display="Dynamic" SetFocusOnError="true" ErrorMessage="<%$Resources:CareerResources, Career_RequiredField%>" 
                    ValidationGroup="profile" ></asp:RequiredFieldValidator> 
            </td> 

as soon as i add the OnClientSelectedIndexChanged attribute, the dropdown doesnt even open on the page.
so i have two questions:
  1. How to solve the problem with dropdown in the rad combobox?
  2. How to force client side validation for a particular textbox if a particular value is selected in the radcombobox?

Update: I am now able to view the dropdown values but they are not triggering the ValidateHearAboutUsSource function.
<script type="text/javascript" language="javascript"> 
        function ValidateHearAboutUsSource(item, eventArgs) { 
alert("test"); 
        var item1 = eventArgs.get_item(); 
        alert("You selected " + item1.get_text()); 
            var dropdownvalue = item.value; 
            alert(dropdownvalue); 
            var textBoxItem = document.getElementById('<%=txtHearAboutUsSourceValue.ClientID%>' 
            var validator = document.getElementById('<%=rfvHearAboutUsSourceValue.ClientID%>'); 
        } 
    </script> 

Thanks
Vishesh
vishesh kumar
Top achievements
Rank 1
 asked on 26 Mar 2010
2 answers
91 views
Hello All,

Client Side valiadations for Rad controls in User control is not firing in the aspx page.

Kindly  help.

Regards,
Suja
Suja Kanak
Top achievements
Rank 1
 answered on 26 Mar 2010
1 answer
102 views
Hi Telerik,

    I have problem with radpanes in firefox and IE 8.
The problem is,In my application i'am using 2 radpanes
one on top, and the other middle.
now when i run the application it works fine in IE6 but in fire fox the middle pane hides the top pane and is not visible
i can only see the middle pane it seems like the top pane is being dissapeared(but getting overlapped).
How can i maintain the height of the panes in all browsers
kindly respond asap....
My queries have not been answered previously also

Thanks in advance
Pushpa.
Tsvetie
Telerik team
 answered on 25 Mar 2010
6 answers
129 views
It seems that whenever I collapse a single group, all of the others in the grid expand.  I don't want all groups to collapse and I don't want the default to change for collapsing groups - I just want the groups that are collapsed to stay there until the user says otherwise.

Related to this: ?
http://www.telerik.com/community/forums/aspnet-ajax/grid/problem-with-single-group-expand-collapse.aspx

Thanks!
TonyG
Top achievements
Rank 1
 answered on 25 Mar 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?