Dear Team,
I am using datareader to bind data with grid. Works fine for first page but when a page index is changed or page size is changed grid displays no records...
it shows the new page or resized page correctly when I reload the page this is serverside code please tell me if i am missing something
protected void NeedDataSource()
{
grd_report.Visible = true;
if (IsPostBack == true && txt_todate.SelectedDate != null && txt_fromdate.SelectedDate != null)
{
String _todate = txt_todate.SelectedDate.Value.ToString("dd-MMM-yyyy");
String _fromdate = txt_fromdate.SelectedDate.Value.ToString("dd-MMM-yyyy");
obj_sales.initConnection();
obj_sales.nwideTotalSalesSummary(_todate, _fromdate);
grd_report.DataSource = obj_sales.getResults();
grd_report.DataBind();
}
}
protected void PageSizeChanged(object source, Telerik.Web.UI.GridPageSizeChangedEventArgs e)
{
NeedDataSource();
grd_report.Rebind();
}
protected void NeedDataSource()
{
grd_report.Visible = true;
if (IsPostBack == true && txt_todate.SelectedDate != null && txt_fromdate.SelectedDate != null)
{
String _todate = txt_todate.SelectedDate.Value.ToString("dd-MMM-yyyy");
String _fromdate = txt_fromdate.SelectedDate.Value.ToString("dd-MMM-yyyy");
obj_sales.initConnection();
obj_sales.nwideTotalSalesSummary(_todate, _fromdate);
grd_report.DataSource = obj_sales.getResults();
grd_report.DataBind();
}
}
protected void NeedDataSource()
{
grd_report.Visible = true;
if (IsPostBack == true && txt_todate.SelectedDate != null && txt_fromdate.SelectedDate != null)
{
String _todate = txt_todate.SelectedDate.Value.ToString("dd-MMM-yyyy");
String _fromdate = txt_fromdate.SelectedDate.Value.ToString("dd-MMM-yyyy");
obj_sales.initConnection();
obj_sales.nwideTotalSalesSummary(_todate, _fromdate);
grd_report.DataSource = obj_sales.getResults();
grd_report.DataBind();
}
}
protected void NeedDataSource()
{
grd_report.Visible = true;
if (IsPostBack == true && txt_todate.SelectedDate != null && txt_fromdate.SelectedDate != null)
{
String _todate = txt_todate.SelectedDate.Value.ToString("dd-MMM-yyyy");
String _fromdate = txt_fromdate.SelectedDate.Value.ToString("dd-MMM-yyyy");
obj_sales.initConnection();
obj_sales.nwideTotalSalesSummary(_todate, _fromdate);
grd_report.DataSource = obj_sales.getResults();
grd_report.DataBind();
}
}
protected void NeedDataSource()
{
grd_report.Visible = true;
if (IsPostBack == true && txt_todate.SelectedDate != null && txt_fromdate.SelectedDate != null)
{
String _todate = txt_todate.SelectedDate.Value.ToString("dd-MMM-yyyy");
String _fromdate = txt_fromdate.SelectedDate.Value.ToString("dd-MMM-yyyy");
obj_sales.initConnection();
obj_sales.nwideTotalSalesSummary(_todate, _fromdate);
grd_report.DataSource = obj_sales.getResults();
grd_report.DataBind();
}
}
protected void NeedDataSource()
{
grd_report.Visible = true;
if (IsPostBack == true && txt_todate.SelectedDate != null && txt_fromdate.SelectedDate != null)
{
String _todate = txt_todate.SelectedDate.Value.ToString("dd-MMM-yyyy");
String _fromdate = txt_fromdate.SelectedDate.Value.ToString("dd-MMM-yyyy");
obj_sales.initConnection();
obj_sales.nwideTotalSalesSummary(_todate, _fromdate);
grd_report.DataSource = obj_sales.getResults();
grd_report.DataBind();
}
}