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

RadGrid insert,Items not visible

5 Answers 132 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Amit
Top achievements
Rank 1
Amit asked on 14 Oct 2010, 10:51 AM
Hey everyone,

I am using a RadGrid to insert new records.I am using Sql Data Source for inserting Items.The problem is that records get inserted in the database table but are'nt visible inside the grid.

Thanks
Amit

5 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 14 Oct 2010, 11:37 AM
Hi,


Go through the following links and see whats missing in your case.
Grid / Automatic Operations Demo
Automatic DataSource operations


Could you paste the code if this does not help?


-Shinu.
0
Amit
Top achievements
Rank 1
answered on 14 Oct 2010, 12:12 PM
Hey Shinu,

Thanks,I got what i was missing.just one more thing to ask.I want my grid to be empty initially,where user puts order more than once may be and then on a button(Submit) click outside the grid,all the items in the grid are saved to the database table and table is again empty.But Grid is not visible unless there is no proper select command.And when i use a false select command,grid looks empty which actually is not and that is why the inserted items are not visible inside the grid.plz help...

Thanks
Amit
 
0
Tsvetina
Telerik team
answered on 20 Oct 2010, 08:07 AM
Hi Amit,

Please, take a look at the following Code Library and let us know if its approach covers all your requirements:
Insert new Records into an empty RadGrid

If not, please, let us know how the offered functionality differs from what you need to achieve.

Kind regards,
Tsvetina
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
DQ
Top achievements
Rank 1
answered on 22 Aug 2012, 08:19 PM
I am running into the same problem.  And I ready don't like the answer from the technical supporter.  Sorry I did not mean to harass or anything.

For question like this, l like answer that is solid:  Why it happen, and what to do to fix it.  If you are the one who developed the component and you don't know why that happen, and what source code changes have to be done to stop it from happen, you are in big trouble yourself.  All what you do here is try to shoot in the dark by pointing to some examples that work, have source code displayed, but who knows what really the code behind is.

And really, if technical support means pointing to examples, I myself can be a great one:  Hire Me!

Many thanks.
0
Tsvetina
Telerik team
answered on 27 Aug 2012, 10:44 AM
Hi,

The explanation is simple - RadGrid is a databound control and it cannot display data items (row) unless it is bound to a datasource with at least one record. If you bind it to an empty object it displays the NoRecords item and allows you to insert one item in case you fire an InitInsert command (for example by clicking the Add New Record button in the command item).

If after the insert you still bind the grid to an empty object, it will show the NoRecords template again.
If you bind it to null/Nothing it will not create its structure and will render only its container <div>.

Additionally, in RadGrid you can insert a single item at a time, so if you want to simulate multiple inserts, you need to bind the grid to a datasource with the desired number of records, which have empty values. Then, you can put all its items in Edit mode. You can use a dummy datasource for this purpose.

Let me know in case you want further details about any of the above statements.

All the best,
Tsvetina
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
Amit
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Amit
Top achievements
Rank 1
Tsvetina
Telerik team
DQ
Top achievements
Rank 1
Share this question
or