protected
void BtnSearch_Click(object sender, ImageClickEventArgs e)
{
soHelper =
new SmartOfficeHelper();
DataTable dtContact = soHelper.SearchSmartOffice(RadTextBoxName.Text);
ViewState[
"dtContact"] = dtContact;
RadGridContact.DataSource = dtContact;
RadGridContact.Rebind();
if (dtContact.Rows.Count > 0)
{
RadGridContact.Visible =
true;
}
}
If i change the page and then try to do a different search my grid shows no records.
If i don't change the page then everything works fine.
protected
void RadGridContact_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
{
if (e.RebindReason == GridRebindReason.InitialLoad)
{
DataTable emptyTable = new DataTable();
RadGridContact.DataSource = emptyTable;
}
else if (e.RebindReason == GridRebindReason.PostBackEvent)
{
soHelper =
new SmartOfficeHelper();
DataTable dtContact = soHelper.SearchSmartOffice(RadTextBoxName.Text);
RadGridContact.DataSource = dtContact;
}
}
Am I doing something wrong?