This is a migrated thread and some comments may be shown as answers.

Not showing column values after bind radgrid

1 Answer 177 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Vitaly
Top achievements
Rank 1
Iron
Iron
Vitaly asked on 14 Jan 2013, 09:09 PM
Hi guys,
I have a radgrid in my apsx page:

 

 

<telerik:RadGrid ID="FundReportGrid" runat="server" GridLines="None"

 

 

 

Skin="Office2010Blue" AllowPaging="true" AllowSorting="true"

 

 

 

onexcelmlexportrowcreated="FundReportGrid_ExcelMLExportRowCreated"

 

 

 

onexcelmlexportstylescreated="FundReportGrid_ExcelMLExportStylesCreated"

 

 

 

onneeddatasource="FundReportGrid_NeedDataSource"

 

 

 

onpageindexchanged="FundReportGrid_PageIndexChanged"

 

 

 

onpagesizechanged="FundReportGrid_PageSizeChanged"

 

 

 

onpdfexporting="FundReportGrid_PdfExporting"

 

 

 

onselectedindexchanged="FundReportGrid_SelectedIndexChanged"

 

 

 

onsortcommand="FundReportGrid_SortCommand"

 

 

 

onitemcreated="FundReportGrid_ItemCreated">

 

 

 

<ExportSettings FileName="FundingIssueReport" OpenInNewWindow="true" IgnorePaging="true" ExportOnlyData="true">

 

 

 

<Excel Format="ExcelML" FileExtension="xls" />

 

 

 

<Pdf FontType="Subset" PaperSize="Letter" />

 

 

 

</ExportSettings>

 

 

 

<MasterTableView AutoGenerateColumns="false" AllowMultiColumnSorting="true">

 

 

 

 

<RowIndicatorColumn>

 

 

 

<HeaderStyle Width="1px" />

 

 

 

</RowIndicatorColumn>

 

 

 

<ExpandCollapseColumn>

 

 

 

<HeaderStyle Width="1px" />

 

 

 

</ExpandCollapseColumn>

 

 

 

<Columns>

 

 

 

<telerik:GridBoundColumn HeaderText="Location" DataField="LOC" UniqueName="LOC" ReadOnly="true" SortExpression="LOC" HeaderButtonType="TextButton" >

 

 

 

<HeaderStyle Width="1px" />

 

 

 

<ItemStyle Width="1px" />

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn HeaderText="Job" DataField="JOB" UniqueName="JOB" ReadOnly="true" SortExpression="JOB" HeaderButtonType="TextButton" >

 

 

 

<HeaderStyle Width="1px" />

 

 

 

<ItemStyle Width="1px" />

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn HeaderText="Title" DataField="TITLE" UniqueName="TITLE" ReadOnly="true" SortExpression="TITLE" HeaderButtonType="TextButton" >

 

 

 

<HeaderStyle Width="1px" />

 

 

 

<ItemStyle Width="1px" />

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn HeaderText="PD Code" DataField="PDIEM_CODE" UniqueName="PDIEM_CODE" ReadOnly="true" SortExpression="PDIEM_CODE" HeaderButtonType="TextButton" >

 

 

 

<HeaderStyle Width="1px" />

 

 

 

<ItemStyle Width="1px" />

 

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridBoundColumn HeaderText="Service Days" DataField="SERVICE_DAYS" UniqueName="SERVICE_DAYS" ReadOnly="true" SortExpression="SERVICE_DAYS" HeaderButtonType="TextButton" >

 

 

 

<HeaderStyle Width="1px" />

 

 

 

<ItemStyle Width="1px" />

 

 

 

</telerik:GridBoundColumn>

 

 

 

</Columns>

 

 

 

</MasterTableView>

 

 

 

<ClientSettings EnableRowHoverStyle="true" EnablePostBackOnRowClick="true">

 

 

 

<Selecting AllowRowSelect="true" />

 

 

 

</ClientSettings>

 

 

 

</telerik:RadGrid>

 


I code behind file I am accessing data thru Store Procedure and returning Dataset:

DataSet

 

 

ds = new DataSet();

 

 

 

string jobstatus = string.Empty;

 

ds =

 

PerDiemCFNReport.CFN_Funding_Issue_Report(FiscalYear.ToString(), CFNList1.CFN, Location, JobTextBox.Text.Trim(), EMP_IDs1.SelectedID, EMP_IDs1.SelectedIDType, ref jobstatus);

 

 

 

if ((ds.Tables.Count > 0) && (ds.Tables[0].Rows.Count > 0) && (ds.Tables[0] != null))

 

{

Session[

 

"FundReportData"] = ds.Tables[0];

 

lblError.Text =

 

String.Empty;

 

lblError.Attributes.Add(

 

"display", "none");

 

FundingIssueReport.Visible =

 

true;

 

ErrorImage.Visible =

 

false;

 

BindFundIssueData();

FYDetail = CFNList1.Year;

GetDetailReport();

}

 

 

else

 

{

lblError.Visible =

 

true;

 

lblError.Text =

 

"No Data found for the given search criteria";

 

FundingIssueReport.Visible =

 

false;

 

FundingIssueDetailReport.Visible =

 

false;

 

ErrorImage.Visible =

 

true;

 

 

 

return;

 

}


This is my bind function:

private

 

 

void BindFundIssueData()

 

{

 

 

RadGrid FundIssueGrid = (RadGrid)FundingIssueReport.FindItemByValue("FundDataReport").FindControl("FundReportGrid");

 

FundIssueGrid.MasterTableView.CurrentPageIndex = 0;

FundIssueGrid.DataSource = Session[

 

"FundReportData"];

 

FundIssueGrid.DataBind();

}


For some reason only first 2 column populated with the data.I run debug and SP returns all 5 fields populated with the data.

Please help,
Thanks so much.

1 Answer, 1 is accepted

Sort by
0
Kostadin
Telerik team
answered on 17 Jan 2013, 03:46 PM
Hello Vitaly,

I noticed that you are using Simple Data Binding in your project. I would recommend you to use Advanced Data-binding. Check out the help articles to get an idea what are the differences between both methods.

Greetings,
Kostadin
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Grid
Asked by
Vitaly
Top achievements
Rank 1
Iron
Iron
Answers by
Kostadin
Telerik team
Share this question
or