Hi guys, i have 4 textboxes and a search button. When the search button is pressed a radgrid is binded depending on the value of the textboxes, the radgrid has enable paging=true, after hitting the search button the textboxes are cleared the when I try to change page,the grid is not binded because there's no value in the textboxes, My question is if is it posible that after clear the textboxes and change the page of the radgrid keep the last value of the textboxes?
Here's my code to bind the grid
In page index change method I call again this method
Hope you could help me
Here's my code to bind the grid
private void BuscaSolicitanteGrid()
{
try
{
if (rdTxtExp.Value != null)
{
var bdInstContext = new BD_INSTEntities();
var empleados = from emp in bdInstContext.Empleados
where emp.exp_emp == rdTxtExp.Value && emp.ind_edo_emp=="A"
select emp;
rgSolic.DataSource = empleados;
rgSolic.Rebind();
rgSolic.Visible = true;
rdTxtNom.Text = "";
rdTxtApat.Text = "";
rdTxtAmat.Text = "";
rdTxtExp.Value = null;
}
if (rdTxtNom.Text != "")
{
var bdInstContextApat = new BD_INSTEntities();
var empleadoNombre = from emp in bdInstContextApat.Empleados
where emp.nombre_emp == rdTxtNom.Text && emp.ind_edo_emp == "A"
select emp;
rgSolic.DataSource = empleadoNombre;
rgSolic.Rebind();
rgSolic.Visible = true;
rdTxtNom.Text = "";
rdTxtApat.Text = "";
rdTxtAmat.Text = "";
rdTxtExp.Value = null;
}
if (rdTxtApat.Text != "")
{
var bdInstContextApat = new BD_INSTEntities();
var empleadoApat = from emp in bdInstContextApat.Empleados
where emp.paterno_emp == rdTxtApat.Text && emp.ind_edo_emp == "A"
select emp;
rgSolic.DataSource = empleadoApat;
rgSolic.Rebind();
rgSolic.Visible = true;
rdTxtNom.Text = "";
rdTxtApat.Text = "";
rdTxtAmat.Text = "";
rdTxtExp.Value = null;
}
if (rdTxtAmat.Text != "")
{
var bdInstContextAmat = new BD_INSTEntities();
var empleadosAmat = from emp in bdInstContextAmat.Empleados
where emp.materno_emp == rdTxtAmat.Text && emp.ind_edo_emp == "A"
select emp;
rgSolic.DataSource = empleadosAmat;
rgSolic.Rebind();
rgSolic.Visible = true;
rdTxtNom.Text = "";
rdTxtApat.Text = "";
rdTxtAmat.Text = "";
rdTxtExp.Value = null;
}
if (rdTxtNom.Text != "" && rdTxtApat.Text!="")
{
var bdInstContextNom = new BD_INSTEntities();
var empleadoNom = from emp in bdInstContextNom.Empleados
where emp.nombre_emp == rdTxtNom.Text && emp.paterno_emp == rdTxtApat.Text && emp.ind_edo_emp == "A"
select emp;
rgSolic.DataSource = empleadoNom;
rgSolic.Rebind();
rgSolic.Visible = true;
rdTxtNom.Text = "";
rdTxtApat.Text = "";
rdTxtAmat.Text = "";
rdTxtExp.Value = null;
}
if (rdTxtNom.Text != "" && rdTxtAmat.Text != "")
{
var bdInstContextNom = new BD_INSTEntities();
var empleadoNom = from emp in bdInstContextNom.Empleados
where emp.nombre_emp == rdTxtNom.Text && emp.materno_emp == rdTxtAmat.Text && emp.ind_edo_emp == "A"
select emp;
rgSolic.DataSource = empleadoNom;
rgSolic.Rebind();
rgSolic.Visible = true;
rdTxtNom.Text = "";
rdTxtApat.Text = "";
rdTxtAmat.Text = "";
rdTxtExp.Value = null;
}
if (rdTxtApat.Text!="" && rdTxtAmat.Text!="")
{
var bdInstContextNom = new BD_INSTEntities();
var empleadoApellidos = from emp in bdInstContextNom.Empleados
where emp.paterno_emp == rdTxtApat.Text && emp.materno_emp == rdTxtAmat.Text && emp.ind_edo_emp == "A"
select emp;
rgSolic.DataSource = empleadoApellidos;
rgSolic.Rebind();
rgSolic.Visible = true;
rdTxtNom.Text = "";
rdTxtApat.Text = "";
rdTxtAmat.Text = "";
rdTxtExp.Value = null;
}
if (rdTxtNom.Text != "" && rdTxtApat.Text != "" && rdTxtAmat.Text != "")
{
var bdInstContextNom = new BD_INSTEntities();
var empleadoApellidos = from emp in bdInstContextNom.Empleados
where
emp.nombre_emp == rdTxtNom.Text && emp.paterno_emp == rdTxtApat.Text &&
emp.materno_emp == rdTxtAmat.Text && emp.ind_edo_emp == "A"
select emp;
rgSolic.DataSource = empleadoApellidos;
rgSolic.Rebind();
rgSolic.Visible = true;
rdTxtNom.Text = "";
rdTxtApat.Text = "";
rdTxtAmat.Text = "";
rdTxtExp.Value = null;
}
}
catch (Exception ex)
{
Alerta(ex.Message);
}
}
Hope you could help me