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);
}
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
| 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"; |
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
| <%@ 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> |
| 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); |
| } |
| } |
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.