2

I have the code below , i bind data from database to telerik data grid "gridCommon" .

gridCommon.DataSource = DbContext.MTO_General_Commons.ToList();

In my aspx ,

  <telerik:RadGrid ID="gridCommon" runat="server" AllowPaging="True" AllowSorting="True"
        AutoGenerateColumns="False" ShowStatusBar="True" CellSpacing="0" GridLines="None"
        Width="470px" OnNeedDataSource="gridCommon_dataRebind" OnInsertCommand="gridCommonInsert"
        OnUpdateCommand="gridCommonUpdate" OnDeleteCommand="gridCommonDelete">
        <MasterTableView DataKeyNames="CommonID" CommandItemDisplay="Top">
            <CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
            <RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column">
            </RowIndicatorColumn>
            <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column">
            </ExpandCollapseColumn>
            <Columns>
                <telerik:GridButtonColumn ButtonType="ImageButton" CommandName="Edit" UniqueName="EditCommandColmun">
                </telerik:GridButtonColumn>
                <telerik:GridBoundColumn DataField="Name" FilterControlAltText="Filter Name column"
                    HeaderText="Name" UniqueName="Name">
                </telerik:GridBoundColumn>
                <telerik:GridButtonColumn ConfirmText="Are you sure to delete ?" ConfirmDialogType="RadWindow"
                    ConfirmTitle="Delete" ButtonType="ImageButton" CommandName="Delete">
                </telerik:GridButtonColumn>
            </Columns>
        </MasterTableView>
        <FilterMenu EnableImageSprites="False">
        </FilterMenu>
    </telerik:RadGrid>

But gridArea doesn't show the data , I want to know why ?

1 Answer 1

3
gridCommon.DataSource = DbContext.MTO_General_Commons.ToList();
gridCommon.DataBind();
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.