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

Populating the grid in unbound mode

1 Answer 164 Views
GridView
This is a migrated thread and some comments may be shown as answers.
mr_iq73
Top achievements
Rank 1
mr_iq73 asked on 29 Apr 2010, 12:26 AM
Below is the code segemnt to add data to RadGridView in unbound mode.
The added rows are not displayed unless I click an empty cell and press enter.
But vertical scroll bar is not appearing. What am I missing the commented line are just not working.

foreach (DataRow dataRow in reportsDataSet.TransDetailsExtendedView.Rows)
{
    GridViewDataRowInfo gridViewDataRowInfo = trDetailsEditRadGridView.Rows.NewRow();

    gridViewDataRowInfo.Cells["trId"].Value = dataRow["trId"].ToString();
    gridViewDataRowInfo.Cells["trStatus"].Value = dataRow["trStatus"].ToString();
    gridViewDataRowInfo.Cells["accCode"].Value = dataRow["accCode"].ToString();
    
    trDetailsEditRadGridView.Rows.Add(gridViewDataRowInfo);
}
//trDetailsEditRadGridView.EndEdit();
//trDetailsEditRadGridView.Update();
}

1 Answer, 1 is accepted

Sort by
0
Julian Benkov
Telerik team
answered on 04 May 2010, 06:35 PM
Hello mr_iq73,

A bit off topic, please ask the person who has purchased our controls in your company to add you as a License Developer to the purchase. This will give you full access to the products your company has purchased, to our downloads section, and to our support ticketing system. Additionally, all your questions will be reviewed according to the license you have. More information on License Developers you can find here: www.telerik.com/account/faqs.aspx.

As to your question, you can use the Update method of MasterGridViewTemplate for this scenario:

foreach (DataRow dataRow in reportsDataSet.TransDetailsExtendedView.Rows)
{
    GridViewDataRowInfo gridViewDataRowInfo = trDetailsEditRadGridView.Rows.NewRow();
 
    gridViewDataRowInfo.Cells["trId"].Value = dataRow["trId"].ToString();
    gridViewDataRowInfo.Cells["trStatus"].Value = dataRow["trStatus"].ToString();
    gridViewDataRowInfo.Cells["accCode"].Value = dataRow["accCode"].ToString();
     
    trDetailsEditRadGridView.Rows.Add(gridViewDataRowInfo);
}
 
this.radGridView1.MasterGridViewTemplate.Update(GridUINotifyAction.Reset);


Sincerely yours,
Julian Benkov
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
GridView
Asked by
mr_iq73
Top achievements
Rank 1
Answers by
Julian Benkov
Telerik team
Share this question
or