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

New Telerik User - Question about grid

4 Answers 50 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Julie
Top achievements
Rank 1
Julie asked on 22 Oct 2014, 02:21 PM
Hi, we are in the process of upgrading some grids from Infragistics Ultrawebgrid  to Telerik Controls.  We are under some time constraints due to enforced IE11 upgrade.  The grid I am working with is very simple.  It is straight data entry of requsition details.  It can be one or many lines.  Is the RadGrid appropriate for this?  I have tried using it and am struggling a bit.  I don't want to bind to a data source as there won't be any data on inital load of the screen.  When the user is done inputting all of the data, I then want to insert detail lines into database.  How do I create a simple input grid?

Thanks and sorry for such a rookie question!

4 Answers, 1 is accepted

Sort by
0
Accepted
Konstantin Dikov
Telerik team
answered on 27 Oct 2014, 11:26 AM
Hi Julie,

You could go through our online demos and help articles regarding the editable RadGrid, the available options for data binding, handling CRUD operations, etc:
In my opinion, the most appropriate edit mode that you could use is the Batch Editing. For your convenience, following is a very basic example demonstrating how to bind RadGrid to an empty collection and allow the end user to insert multiple items. Once he finishes he could click on the Save Changes button. Then, on server-side you could handle the server-side OnBatchEditCommand event and retrieve the values for each inserted item and save it to your database:
<telerik:RadGrid runat="server" ID="RadGrid1" MasterTableView-ShowHeadersWhenNoRecords="true"
    OnNeedDataSource="RadGrid1_NeedDataSource" OnBatchEditCommand="RadGrid1_BatchEditCommand">
    <MasterTableView EditMode="Batch" CommandItemDisplay="Top" AutoGenerateColumns="false">
        <Columns>
            <telerik:GridBoundColumn DataField="ID" HeaderText="ID"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="SomeField" HeaderText="Some field"></telerik:GridBoundColumn>
        </Columns>
    </MasterTableView>
</telerik:RadGrid>

And the code-behind:
protected void RadGrid1_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
{
    (sender as RadGrid).DataSource = new List<string>();
}
 
protected void RadGrid1_BatchEditCommand(object sender, GridBatchEditingEventArgs e)
{
        // your custom code here
}

However, you should have in mind that with the above implementation, the items will not be visible after the Save Changes button is clicked, but from what I understand from your post, this is the end result you are looking for.


Regards,
Konstantin Dikov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
C
Top achievements
Rank 1
answered on 02 Mar 2015, 06:33 PM
Hi Julie,

We are in the same boat as you WRT IE11 support. Were you able to convert to Telerik's grid and if so, how difficult was it?

Thanks,

Carlo.
0
Julie
Top achievements
Rank 1
answered on 02 Mar 2015, 06:41 PM
Hi Carlo,

No it wasn't too difficult.  It is pretty easy to use and the documentation and tutorials from Telerik are pretty good.  Most of my issues were due to my limited knowledge of grids.  If you are pretty comfortable with Infragistics Ultrawebgrid then I don't think you will have too much trouble.

Thanks,

Julie
0
C
Top achievements
Rank 1
answered on 02 Mar 2015, 06:52 PM
Hi Julie,

Thanks for the quick reply! Unfortunately I'm completely new to the application, Infragistics and Telerik, but knowing that there were no major hurdles helps a lot.


Thanks again,

Carlo.
Tags
Grid
Asked by
Julie
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
C
Top achievements
Rank 1
Julie
Top achievements
Rank 1
Share this question
or