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

Mandatory events for RadGrid

3 Answers 79 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Amit
Top achievements
Rank 1
Amit asked on 07 Oct 2010, 07:02 AM
Hey everyone,

What are the mandatory events in using a RadGrid?..Why it is not visible in the browser until it is empty and there is no datasource?....I want to show an empty rad grid with template columns in edit mode on page load,where user inputs data.Than data will be saved to a data table and then to db.But the grid is not visible?...What's that required or is compulsory while using radGrid?...

3 Answers, 1 is accepted

Sort by
0
Accepted
Maria Ilieva
Telerik team
answered on 08 Oct 2010, 01:53 PM
Hello Amit,

Set the DataSource for the grid initially as shown below to show the headers even if you have no records.
protected void Page_Load(object sender, EventArgs e)
{
    if (!IsPostBack)
    {
        rdgDepartment.DataSource = String.Empty;
    }
}


All the best,
Maria Ilieva
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
Amit
Top achievements
Rank 1
answered on 11 Oct 2010, 12:41 PM
but than for inserting new records i've used sql data source.How can i change grid's datasource after page_Load?...Can i set DataSource and DataSource Id to a single control?...
0
Accepted
Maria Ilieva
Telerik team
answered on 14 Oct 2010, 10:45 AM
Hi Amit,

Add the following code:

Datatable dt= new datatable();
radgrdid.datasource=dt;



Best wishes,
Maria Ilieva
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
Amit
Top achievements
Rank 1
Answers by
Maria Ilieva
Telerik team
Amit
Top achievements
Rank 1
Share this question
or