Hello,
I have a RadGrid inside a Webpart. Its a non-visual webpart.
I am binding the grid to a Datasource of List<T>.
Every column is being returned from the datasource so I turned off AutoGenerateColumns to remove the extra columns and control what is painted on the screen.
Now the grid always displays "No records to display"...
The radgrid is created in the CreateChildControls override event:
I am adding only one column to see if I can remove the possible reasons for the error:
And the NeedDataSource event is used:
I can see that 40+ records are returned, but its not binding them - is this some strange page life cycle issue?
Please help
I have a RadGrid inside a Webpart. Its a non-visual webpart.
I am binding the grid to a Datasource of List<T>.
Every column is being returned from the datasource so I turned off AutoGenerateColumns to remove the extra columns and control what is painted on the screen.
Now the grid always displays "No records to display"...
The radgrid is created in the CreateChildControls override event:
radGridViewSearch = new RadGrid();
radGridViewSearch.AutoGenerateColumns = false;
radGridViewSearch.AllowPaging = true;
radGridViewSearch.PageSize = 25;
radGridViewSearch.NeedDataSource += new GridNeedDataSourceEventHandler(radGridViewSearch_NeedDataSource);
this.Controls.Add(radGridViewSearch);
I am adding only one column to see if I can remove the possible reasons for the error:
GridBoundColumn colFacilityID = new GridBoundColumn();
colFacilityID.DataField = "Facility";
colFacilityID.HeaderText = "Facility";
radGridViewSearch.Columns.Add(colFacilityID);
And the NeedDataSource event is used:
void radGridViewSearch_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
{
lionRepository = new LionBCSRepository();
radGridViewSearch.DataSource = lionRepository.BuildMatterDataSet(txtMatterNameSearch.Text.Trim(), txtContractNameSearch.Text.Trim(), txtPhysicianNameSearch.Text.Trim());
}
I can see that 40+ records are returned, but its not binding them - is this some strange page life cycle issue?
Please help