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

Please find the below options for validation, may be these would help.

 

Options 1:

 

if (Condition satisfied)

{

 //Code for Update Logic

}

Else

{

  throw new Exception("The Date format is not correct format");

}

 

Option 2:

 

string sMessage;

sMessage = " The Date format is not correct format ";

str = "<script language=javascript> var strTrueFalse; ";

str = str + " alert('" + sMessage + "');";

str = str + "</script>";

Page.RegisterStartupScript("ppname", str);

 

Option 3:

 

In App_Code you can write common function that would be used in project.

 

public static void DisplayUserMessage(int nMessageTypeID)

    {

        string strScript = string.Empty;

        strScript = "<script type='text/javascript'>alert('";

        if (nMessageTypeID == 1)

        {

            strScript = strScript + Resources.Multilingual.Recordhasbeensavedsuccessfully;

           

        }

        else if (nMessageTypeID == 2)

        {

            strScript = strScript + Resources.Multilingual.Recordhasbeenupdatedsuccessfully;

        }

        else if (nMessageTypeID == 3)

        {

            strScript = strScript + Resources.Multilingual.Recordshasbeendeletedsuccessfully;

        }

        else if (nMessageTypeID == 4)

        {

            strScript = strScript + Resources.Multilingual.Recordshasbeeninactivateddeletedsuccessfully;

        }

      

        strScript = strScript + "');</script>";

        System.Web.UI.Page P = (System.Web.UI.Page)System.Web.HttpContext.Current.Handler;

        ScriptManager.RegisterStartupScript(P, typeof(System.Web.UI.Page), "alertScript", strScript, false);

    }

 

In application you can use like that

 

if (Condition satisfied)

{

 //Code for Update Logic

}

Else

{

  PMAP_Common_Methods.DisplayUserMessage(2);

}

 

shaik
Top achievements
Rank 1
 asked on 17 Feb 2010
1 answer
149 views
hi

I have a Radmenu in a master page. In this menu, there is an item name "Back"

I want to be able to go back to previous page when users click on the Back menu item.  

How should i go about it? Thanks a lot
Shinu
Top achievements
Rank 2
 answered on 17 Feb 2010
3 answers
120 views

I added a GridButtonColumn at runtime
        RadGrid1.Columns.Clear()
        Dim objGC_Command As New Telerik.Web.UI.GridButtonColumn
        objGC_Command.ButtonType = Telerik.Web.UI.GridButtonColumnType.PushButton
        objGC_Command.CommandName = "Select"
        objGC_Command.UniqueName = "Select"
        objGC_Command.Text = "..."
        RadGrid1.Columns.Add(objGC_Command)

I handled the event triggered by pressing the button 
        Protected Sub RadGrid1_ItemCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs)
                If e.CommandName = "Select" Then
                        ...

                End If
        End Sub

The problem is that this event is not fired when I press the button because then HTML generated is

        <input type="submit" name="ctl00$CPHMain$RadGrid1$ctl00$ctl04$ctl00" value="..." />

why?

Thanks for your attention and sorry for my English

Fabio

Princy
Top achievements
Rank 2
 answered on 17 Feb 2010
3 answers
164 views
Hello,

I'm currently working on a report project. I'm using a rdlc and a report viewer control to display reports. I've few chart reports too. I completed the project using the default chart controls available with the rdlc. But i've three issues with the rdlc chart control.

  1. I want to show the Y Axis reading on either sides (both the verticals)
  2. I need to have a subtitle apart from the chart title. The title and subtitle to display in separate lines with their own text formatting.
  3. I want to format the readings shown in the axis. For example, if the readings are 5000, 5100, 5200,.. etc, i want to show them as 5,000, 5,100, 5,200..etc. (or) 5000.00, 5100.00, 5200.00.. etc.

Can RadChart help me in 'all' the above issues?

Thank you.
Regards
NLV

NLV
Top achievements
Rank 1
 answered on 17 Feb 2010
3 answers
146 views
Hello,

I need to insert user's details into a table using radgrid.
I need to enter state and country of the user.
So, in Add new record -> I should be able to filter states based on countries using 2 dropdownlists.

So, in the selected index changed event of the country dropdown - i should able to find the both the dropdown controls.
But I am not able to do that. Only null is coming in that.

please, provide me a solution as soon as possible.

Since, I am not saving after selecting country, I suppose the radgrid events may not work in this scenario. I cannot write code in item created or itemdatabound.,, etc.,,..

please check the below image to have an idea... here district and schools are cascading dropdown's
http://i45.tinypic.com/117bdz6.jpg

Thanks in advance,
Gnanadeep
Princy
Top achievements
Rank 2
 answered on 17 Feb 2010
4 answers
383 views
i have this column on my rad grid:

            GridHyperLinkColumn GHyperLinkColumn = new GridHyperLinkColumn();  
            GvDetails.MasterTableView.Columns.Add(GHyperLinkColumn);  
            GHyperLinkColumn.DataTextField = "resource_nm";  
            GHyperLinkColumn.DataNavigateUrlFormatString = "ViewResourceRoleSkillInfo.aspx?rid={0}";  
            string[] arr = new string[1];  
            arr[0] = "resource_id";  
            GHyperLinkColumn.DataNavigateUrlFields = arr;  
            GHyperLinkColumn.UniqueName = "resource_nm";  
            GHyperLinkColumn.HeaderText = "Resource Name"

i need the target of that column to be on radwindow of my page,  any help on this?

thanks in advance...

Princy
Top achievements
Rank 2
 answered on 17 Feb 2010
3 answers
182 views

Hi,

In RadGrid, is it possible to set multi-column filtering, what I mean by multi-column filtering is for the same column can I set a filter expression using logical operators, ie., like FilterExpression = "ID equals OR greater Than 10".(ID being the column)

How can I set the filter expression at code-behind?

Could u plz reply me with the code snippet....

-Liji Gilesh

Princy
Top achievements
Rank 2
 answered on 17 Feb 2010
1 answer
130 views
I want to add an item to the RadComboBox on the client side.  I have copied the suggested code, but it does not work.  The error comes at the line combo.get_items().add(comboItem);. The error message is 'undefined' is null or not an objet
<%@ Control Language="VB" AutoEventWireup="false" CodeFile="pnl_iChoose_Hrchy.ascx.vb" 
    Inherits="WebUserControls_pnl_iChoose_Hrchy"%> 
<asp:Panel ID="pnlAjax" runat="server" >      
    <table class="tblPanel" > 
        <col class="leftCell" /> 
        <col class="rightCell" /> 
        <tr> 
            <td> 
                Dept:  
            </td> 
            <td> 
                <telerik:RadComboBox runat="server" ID="ddlDepartment" AutoPostBack="true" EnableLoadOnDemand="True" 
                    ShowDropDownOnTextboxClick="false" OnClientSelectedIndexChanged="ddlDept_SelIChng">  
                    <WebServiceSettings Method="loadDepartment" Path="../WebServices/srvc_ComboBox.asmx" /> 
                </telerik:RadComboBox> 
            </td> 
        </tr> 
        <tr> 
            <td> 
                Class:  
            </td> 
            <td> 
                <telerik:RadComboBox runat="server" ID="ddlClass" AutoPostBack="true" EnableLoadOnDemand="True" 
                    OnClientItemsRequesting="hrchy_itmReq_Dpt">  
                    <WebServiceSettings Method="loadClass" Path="../WebServices/srvc_ComboBox.asmx" /> 
                </telerik:RadComboBox> 
            </td> 
        </tr> 
        <tr> 
            <td> 
                Subclass:  
            </td> 
            <td> 
                <telerik:RadComboBox runat="server" ID="ddlSubClass" AutoPostBack="true" EnableLoadOnDemand="True">  
                    <WebServiceSettings Method="loadSubClass" Path="../WebServices/srvc_ComboBox.asmx" /> 
                </telerik:RadComboBox> 
            </td> 
        </tr> 
        <tr> 
            <td> 
                Vendor:  
            </td> 
            <td> 
                <telerik:RadComboBox runat="server" ID="ddlSupplier" AutoPostBack="true" EnableLoadOnDemand="True">  
                    <WebServiceSettings Method="loadVendor" Path="../WebServices/srvc_ComboBox.asmx" /> 
                </telerik:RadComboBox> 
            </td> 
        </tr> 
        <tr> 
            <td> 
                Vendor Style:  
            </td> 
            <td> 
                <telerik:RadComboBox runat="server" ID="ddlStyle" AutoPostBack="true" EnableLoadOnDemand="True">  
                    <WebServiceSettings Method="loadStyle" Path="../WebServices/srvc_ComboBox.asmx" /> 
                </telerik:RadComboBox>                 
            </td> 
        </tr> 
        <tr> 
            <td> 
                SEA CDE:  
            </td> 
            <td> 
                <telerik:RadComboBox runat="server" ID="ddlSeason" EnableLoadOnDemand="True">  
                    <WebServiceSettings Method="loadSeaCde" Path="../WebServices/srvc_ComboBox.asmx" /> 
                </telerik:RadComboBox> 
            </td> 
        </tr> 
         <tr> 
            <td> 
                Vendor PID:  
            </td> 
            <td> 
                <telerik:RadTextBox ID="txtPID" runat="server">  
                    <ClientEvents OnFocus="ShowResultTab" OnKeyPress="RetrieveOnEnter" /> 
                </telerik:RadTextBox></td>  
        </tr> 
        <tr> 
            <td> 
                Created Since:  
            </td> 
            <td> 
                <telerik:RadDatePicker runat="server" Skin="WebBlue" ID="dpSince" SharedCalendarID="sharedCal" 
                    Width="80px" > 
                    <DateInput ID="diSince" runat="server" onclick="dp_PUpdating(this.id);">  
                    </DateInput> 
                    <DatePopupButton ImageUrl="~/App_Themes/BlueBT2009/Calendar/Cal.gif" onclick="dp_PUpdating(this.id);" /> 
                </telerik:RadDatePicker> 
            </td> 
        </tr>    
          
    </table> 
    <telerik:RadCalendar runat="server" ID="sharedCal">  
    </telerik:RadCalendar>   
       
</asp:Panel> 
 This RadComboBox is on a user control that is contained in a RadPanelItem.  The RadPanelItem is contained in a RadPane.  The RadPane is contained in a RadSplitter.
 function pnlHierarchyBackFeed(sql) {  
            try {  
                var sqlt = trim(sql);  
                var arry = sqlt.split(' '); ;  
                var combo;  
                var str;  
                var x;  
                for (x in arry) {  
                    str = arry[x + 2];  
                    switch (arry[x]) {  
                        case 'DEPT_ID':  
                            combo = $find("<%= Me.ddlDepartment.ClientID %>");  
                            var comboItem = new Telerik.Web.UI.RadComboBoxItem();  
                            comboItem.set_text(str);  
                            combo.trackChanges();  
                            combo.get_items().add(comboItem);  
                            comboItem.select();  
                            combo.commitChanges();  
                            break;  
                        case 'CLASS_ID':  
                            combo = $find("<%= Me.ddlClass.ClientID %>");  
                            var comboItem = new Telerik.Web.UI.RadComboBoxItem();  
                            comboItem.set_text(str);  
                            combo.trackChanges();  
                            combo.get_items().add(comboItem);  
                            comboItem.select();  
                            combo.commitChanges();  
                            break;  
                        
                        default:  
                             
                    }  
                    x = x + 2;  
                }  
            }  
            catch (err) {  
                alert(err.message);  
            }  
        } 
Jeanne Kornkven
Top achievements
Rank 1
 answered on 17 Feb 2010
1 answer
213 views

Hello,

Highlighting of Items is not working for me in IE8 when I hover over them.

From what I can tell, a RadComboBoxItem's css class is supposed to change from ComboBoxItem_Vista to ComboBoxItemHover_Vista when the user mouses over it. If I add a doctype declaration to my page, this behavior stops working in IE8. Only the first item that I mouse over gets the hover class. When I hover over other items, the highlight does not move. If I move the mouse away from the dropdown completely and return, the first item I hover over gets the hover class, but then when I move to other items, again, the highlight does not move.

Manually adding onmouseover and onmouseout attributes to each item when it is databound works, but slows the page down considerably because I have many items in each dropdown.

Here is a live sample: https://hertzequipus.rousesales.com/equipmentlisting.aspx

Here is the doctype declaration I am using:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

 

 

And I am using RadComboBox version 2.8.4.0.

Thank you for your help.

Adeel Syed
Top achievements
Rank 1
 answered on 16 Feb 2010
1 answer
170 views
Hi ,

I tried to export data from radgrid to excel with command item and footer. I am able to export the data successfully. But I am not able to format the grid data . for example I am not able to set color for item and alternateitemtemplate.

wehen i am using xliml format then i am able to formate the color for item and alternateitemtemplate but I am not able to send command item and footer. xliml will work only if you set setonlydata = true.

Daniel
Telerik team
 answered on 16 Feb 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?