protected override void OnLoad(System.EventArgs e) { base.OnLoad(e); this.InvalidStyle.BackColor = Color.Yellow; this.ClientEvents.OnLoad = "fnOnUpdateValidators"; this.ClientEvents.OnValueChanged = "fnOnUpdateValidators"; }
i got my textbox here :
<syn:SynergieTextBox CausesValidation="true" Width="300px"
Text='<%# Eval("FirstName") %>' ID="txtFirstName" runat="server">
</syn:SynergieTextBox>
and the javascript here :
function
fnOnUpdateValidators(sender, eventArgs) {
if (typeof (Page_Validators) != "undefined") {
for (var i = 0; i < Page_Validators.length; i++) {
var val = Page_Validators[i];
var ctrl = document.getElementById(val.controltovalidate);
if (ctrl != null && sender != null) {
if (sender._clientID == ctrl.id) {
if (!val.isvalid) {
sender._invalid =
true;
sender.updateCssClass();
break;
}
else {
sender._invalid =
false;
sender.updateCssClass();
}
}
}
}
}
}
<telerik:RadGrid ID="RadGrid1" runat="server"> <MasterTableView DataMember="Employee" DataKeyNames="ID" GroupLoadMode="Client" HierarchyLoadMode="Client" GroupsDefaultExpanded="false"> <GroupByExpressions> <telerik:GridGroupByExpression> <GroupByFields> <telerik:GridGroupByField FieldName="Location" /> </GroupByFields> <SelectFields> <telerik:GridGroupByField FieldName="Location" /> </SelectFields> </telerik:GridGroupByExpression> </GroupByExpressions> <DetailTables> <telerik:GridTableView DataMember="EmployeeProperties" DataKeyNames="ID"> <ParentTableRelation> <telerik:GridRelationFields MasterKeyField="ID" DetailKeyField="EmployeeID" /> </ParentTableRelation> </telerik:GridTableView> </DetailTables> </MasterTableView></telerik:RadGrid>protected override void OnInit(EventArgs e){ RadGrid1.NeedDataSource += new Telerik.Web.UI.GridNeedDataSourceEventHandler(RadGrid1_NeedDataSource); RadGrid1.DetailTableDataBind += new Telerik.Web.UI.GridDetailTableDataBindEventHandler(RadGrid1_DetailTableDataBind); base.OnInit(e);}void RadGrid1_DetailTableDataBind(object source, Telerik.Web.UI.GridDetailTableDataBindEventArgs e){ DataSet ds = GetDataSource(); e.DetailTableView.DataSource = ds;}void RadGrid1_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e){ DataSet ds = GetDataSource(); RadGrid1.DataSource = ds;}private DataSet GetDataSource(){ DataSet ds = new DataSet(); DataTable employee = ds.Tables.Add("Employee"); DataTable employeeProperties = ds.Tables.Add("EmployeeProperties"); var empKey = employee.Columns.Add("ID", typeof(int)); employee.Columns.Add("FullName", typeof(string)); employee.Columns.Add("DepartmentID", typeof(string)); employee.Columns.Add("Location", typeof(string)); var empPKey = employeeProperties.Columns.Add("ID", typeof(int)); var empPFK = employeeProperties.Columns.Add("EmployeeID", typeof(int)); employeeProperties.Columns.Add("Title", typeof(string)); employeeProperties.Columns.Add("Value", typeof(string)); employee.PrimaryKey = new[] { empKey }; employeeProperties.PrimaryKey = new[] { empPKey }; ds.Relations.Add(new DataRelation("rel", empKey, empPFK)); employee.Rows.Add(new object[] { 1, "Scott Smith", 1, "Sweden" }); employee.Rows.Add(new object[] { 2, "Adam West", 1, "Sweden" }); employee.Rows.Add(new object[] { 3, "John Doe", 2, "Norway" }); employee.Rows.Add(new object[] { 4, "Sven Svensson", 2, "Norway" }); employee.Rows.Add(new object[] { 5, "Anders Andersson", 3, "Finland" }); employee.Rows.Add(new object[] { 6, "Jane Doe", 3, "Finland" }); employee.Rows.Add(new object[] { 7, "Stan Smith", 4, "United States of America" }); int i = 0; foreach (DataRow emp in employee.Rows) { string[] s = ((string)emp["FullName"]).Split(new[] { ' ' }); employeeProperties.Rows.Add(new object[] { ++i, (int)emp["ID"], "GivenName", s[0] }); employeeProperties.Rows.Add(new object[] { ++i, (int)emp["ID"], "GivenName", s[1] }); } return ds;}hi all
i have a little problem with radalert method, i am trying to open an alert with an asp button, try with register startup script but this dont work as expected
somebody have an example that can show me