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

Setting DataSource at runtime

3 Answers 138 Views
Grid
This is a migrated thread and some comments may be shown as answers.
rachel
Top achievements
Rank 1
rachel asked on 16 Sep 2010, 04:40 PM
Hello,
I'm using with the RadGrid for display and edit data.
I want to set the DataSource at runtime, so in Page_Load i put:
myGrid.DataSource = myList;
myGrid.DataBind();

I have 2 problems with that:
1. for the first time data ara well but the next time that comes to Page_Load 
  a fall occurs.
2. the data are presented also without the DataBind,
    but the next time that comes to Page_Load the changes that made on the grid disappear.

Can you refer me to a grid of receiving data at runtime and not by DataSourceID, and Lets to edit

Thanks.





3 Answers, 1 is accepted

Sort by
0
Nikolay Rusev
Telerik team
answered on 17 Sep 2010, 05:41 AM
Hello rachel,

Please consider using Advanced Data-binding instead simple data binding.

Regards,
Nikolay
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
rachel
Top achievements
Rank 1
answered on 19 Sep 2010, 01:09 PM
the event occurs Immediately after clicked on edit button, and the data source is null,
the data re-filled (in the event), and if any change occurs in the contorols in the grid, i can't access them.
How can I access to the changes that occur in the client ?



0
Nikolay Rusev
Telerik team
answered on 23 Sep 2010, 07:45 AM
Hello Rachel,

I do not understand what you are trying to achieve. NeedDataSource will be triggered when Edit command is triggered by the button inside GridEditCommandColumn. The DataSource of RadGrid will be null as expected - you need to assign some data source here.

Regards
Nikolay
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
Tags
Grid
Asked by
rachel
Top achievements
Rank 1
Answers by
Nikolay Rusev
Telerik team
rachel
Top achievements
Rank 1
Share this question
or