Radgrid; Add New
Record Button not visible
The first time you use RadGrid you may spend a lot of time
trying to work out how to display the Add New Record Button. I had to search
for ages to find out what to do to display the Add New Record Button.
The property you need to set is the CommandItemDisplay of
the MasterTableView property.
In Visual Studio you can edit the properties of the RadGrid
in the property editor window. Select the RadGrid on your page, and then find
the property called MasterTableView and its child property CommandItemDisplay. Now select one of the drop down options: None,
Top, Bottom , TopAndBottom. Like magic
the Add new button appears.
Remember to set AllowAutomaticInserts to true if you are not
writing your own insert code.
The MasterTableView code that may look something like this, notice the property CommantItemDisplay="Top":
<MasterTableView DataKeyNames="PriceTypeID"
DataSourceID="PriceType_LinqDataSource" CommandItemDisplay="Top">
<RowIndicatorColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</RowIndicatorColumn>
<ExpandCollapseColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</ExpandCollapseColumn>
<Columns>
<telerik:GridBoundColumn DataField="PriceType" HeaderText="PriceType"
SortExpression="PriceType" UniqueName="PriceType">
</telerik:GridBoundColumn>
</Columns>
</MasterTableView>