Asp Dot Net Notes for Web Masters RSS 2.0

# Sunday, May 31, 2009

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>

Sunday, May 31, 2009 2:04:38 PM (GMT Daylight Time, UTC+01:00)  #    Comments [0] - Trackback
Controls
Tracked by:
"http://www.google.com/search?q=vrylpyhx" (http://www.google.com/search?q=vrylpy... [Pingback]
Archive
<May 2009>
SunMonTueWedThuFriSat
262728293012
3456789
10111213141516
17181920212223
24252627282930
31123456
Blogroll
About the author/Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

© Copyright 2012
I do I.T. Ltd.
Sign In
Statistics
Total Posts: 27
This Year: 0
This Month: 0
This Week: 0
Comments: 22
All Content © 2012, I do I.T. Ltd.