eDosWeb/eDos/DocDGrid.aspx.cs

73 lines
2.4 KiB
C#
Raw Normal View History

2025-11-21 17:00:30 +01:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
namespace Rems2018
{
public partial class DocDGrid : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
//Zet titel op masterpage
Literal titelControl = Master.FindControl("PageTitle") as Literal;
titelControl.Text = "Document D";
}
protected bool isChecked(object b)
{
if (b is bool) return (bool)b; else return false;
}
protected void cmbPerson_SelectedIndexChanged(object sender, Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs e)
{
rgDocD.DataBind();
}
protected void cmbPerson_DataBound(object sender, EventArgs e)
{
rgDocD.DataBind();
}
protected void rs_DataSourceSelect(object sender, Telerik.Web.UI.SearchBoxDataSourceSelectEventArgs e)
{
SqlDataSource source = (SqlDataSource)e.DataSource;
var searchBox = sender as RadSearchBox;
//string likeCondition = string.Format("'{0}' + @filterString + '%'", searchBox.Filter == SearchBoxFilter.Contains ? "%" : "");
//string countCondition = e.ShowAllResults ? " " : " TOP 100 ";
//source.SelectCommand = string.Format("SELECT {0}* FROM [Products] WHERE [" + searchBox.DataTextField + "] LIKE {1}", countCondition, likeCondition);
//if (e.SelectedContextItem != null)
// source.SelectParameters["key"].DefaultValue = e.SelectedContextItem.Key;
//else
// source.SelectParameters["key"].DefaultValue = "*";
source.SelectParameters["search"].DefaultValue = searchBox.Text.Replace("'", "''");
}
protected void rs_Search(object sender, SearchBoxEventArgs e)
{
int persid = 0;
if (e.Value != null)
hPersID.Value = e.Value;
else
{
if (int.TryParse(e.Text, out persid))
{
hPersID.Value = persid.ToString();
}
}
rgDocD.DataBind();
}
}
}