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

Migrating from Telerik.WebControls.RadGrid (RadGrid.Net2.dll) to Telerik.Web.UI.RadGrid (Telerik.Web.UI.dll Q2 2016)

1 Answer 131 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Philip Gaffney
Top achievements
Rank 2
Philip Gaffney asked on 13 May 2016, 11:18 AM

I'm currently going through updating an application that was using RadGrid.Net2 and RadChart.Net2, to be using the latest release of Telerik ASP.NET AJAX Grid and Chart controls.

So far I've encountered numerous issues with skinning of the Grid, and am now experiencing issues with some of the databinding and controls usage for the grid which I'm hoping you could advise on.

One of the failing instances of the RadGrid used to use the following code:-

<radG:RadGrid id="GridOutcomes" runat="server" AllowSorting="True" AllowPaging="True" AutoGenerateColumns="False" GridLines="None" Skin="Default" OnNeedDataSource="GridOutcomes_NeedDataSource" OnItemCommand="GridOutcomes_ItemCommand" OnItemDataBound="GridOutcomes_ItemDataBound" Visible="False">
<MasterTableView DataSourcePersistenceMode="NoPersistence">
<Columns>
<radG:GridBoundColumn DataField="ID" HeaderText="Case" UniqueName="columnId" Visible="False" />                                <radG:GridTemplateColumn DataField="GmcCode" HeaderText="GMC" UniqueName="columnGMC" SortExpression="GmcCode">                         <ItemStyle HorizontalAlign="Left" />
    <HeaderStyle HorizontalAlign="Left" />
       <ItemTemplate>
           <des:Button ID="ButtonDrillDown" runat="server" CssClass="linkButtonNoValidate showInPrint" CommandName="DrillDown" Text='<%#((string)Eval("GmcCode")) + "&nbsp;"%>' CausesValidation="false" />
       </ItemTemplate>
</radG:GridTemplateColumn>
<radG:GridBoundColumn DataField="FormattedName" HeaderText="Name" UniqueName="columnName" />
</MasterTableView>
<PagerStyle Mode="NextPrevAndNumeric" />
</radG:RadGrid>

With the Telerik DLLs updated, I've noticed that the 'DataSourcePersistenceMode' property is no longer valid for the MasterTableView.

Also, when the application runs, clicking on one of the row buttons which calls 'GridOutcomes_ItemCommand' no longer is able to extract the correct value from the grid, and the value returned is the Empty Cell Default Value.

01.protected void GridOutcomes_ItemCommand(object source, GridCommandEventArgs e)
02.{
03.    Logger.Write(User.Identity.Name + ": SearchPersonnel:GridOutcomes_ItemCommand", Defines.LoggingCategoryMain);
04. 
05.    switch(e.CommandName)
06.    {
07.        case "DrillDown":
08.            try
09.            {
10.                GridDataItem gridItem = e.Item as GridDataItem;
11.                TableCell cell = gridItem[GridOutcomes.Columns[(int)GridColumn.PersonnelId].UniqueName];
12. 
13.                int personnelId = 0;
14.                if(int.TryParse(cell.Text, out personnelId))
15.                {
16.                    ApplicationStore.Instance.SelectedPersonnel = new Personnel(new PersonnelRecord(), personnelId);

 

Could you please advise on what I should do to replace the missing DataSourcePersistenceMode property in order to retain the same functionality, and also could you please let me know if you have a guide on migrating from the .Net2 versions of the RadGrid and RadChart to the up to date releases since I'm guessing I'm going to find a lot of issues when I get to testing the chart control.

 

Thanks,

 

Jonathan

 

1 Answer, 1 is accepted

Sort by
0
Viktor Tachev
Telerik team
answered on 18 May 2016, 08:40 AM
Hi Jonathan,

The version of the controls you are using is very outdated and the new controls are completely reworked. This is why the property you are referring to is not available in the current controls.

If you would like to specify that the state of RadGrid should not be persisted you can use the EnableViewState property and set it to false.

You can find additional information regarding ViewState optimization in the following article:



Regards,
Viktor Tachev
Telerik
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Tags
Grid
Asked by
Philip Gaffney
Top achievements
Rank 2
Answers by
Viktor Tachev
Telerik team
Share this question
or