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

Telerik dll version Issue for RadGridView Control

1 Answer 78 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Bylar
Top achievements
Rank 1
Bylar asked on 29 Aug 2013, 07:36 AM
Hi,


I am using the Telerik.Web.UI.dll and Telerik.Web.UI.Skins.dll with version number : 2012.3.1308.35 in my currently running application  but now we are updating the dll version to  2013.2.717.40 so I am getting an error at run time in RadGridView Control :

Error : I am getting the data-type conversion issue

Here is my code :
              <telerik:RadGrid OnNeedDataSource="rgrd_NeedDataSource" AlternatingItemStyle-HorizontalAlign="Left"
                            ItemStyle-HorizontalAlign="Left" runat="server" ID="rgrd" OnPreRender="rgrd_OnPreRender"
                            OnItemCommand="rgrd_ItemCommand" AllowPaging="True" Skin="WebBlue" Width="99%"
                            AutoGenerateColumns="false" GridLines="None" AllowSorting="True" PageSize="10"
                            OnItemDataBound="rgrd_OnItemDataBound">
                            <MasterTableView DataKeyNames="UserId" AutoGenerateColumns="False" Width="100%">
                                <NoRecordsTemplate>
                                    No Records
                                </NoRecordsTemplate>
                                <Columns>
                                    <telerik:GridBoundColumn Visible="false" UniqueName="IsEnable" DataField="IsEnable" />
                                    <telerik:GridBoundColumn  UniqueName="Name" DataField="UserName" />
                                </Columns>
                            </MasterTableView>
                            <HeaderStyle HorizontalAlign="Left" />
                        </telerik:RadGrid>
 protected void rgrd_OnPreRender(object source, EventArgs eventArgs)
        {
            var list= (List<User>) rgrd.DataSource;
            if (list=  != null && list= .Count > 0)
            {
                for (int index = 0; index < rgrd.Items.Count; index++)
                {
                    GridDataItem item = rgrd.Items[index];
                    if (item != null)
                    {
                        Boolean isEnable = Convert.ToBoolean(item["IsEnable"].Text); // Getting Error in this code
                    }
                }
            }
      }


"Boolean isEnable = Convert.ToBoolean(item["IsEnable"].Text);"
With old dll version I am getting here item["IsEnable"].Text ="True"
but with newer version of dll I am getting here item["IsEnable"].Text="&nbsp;"
so I do not understand What can I do in this case ?
Please Help.

Thanks,
Aditya

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 29 Aug 2013, 11:06 AM
Hi Bylar,

The error is causing because you have set the Visible="false",for the IsEnable column,Please set Display="false" ,so that you can access it in the code behind.

ASPX:
<telerik:GridBoundColumn Display="false" UniqueName="IsEnable" DataField="IsEnable"  />

Thanks,
Princy

Tags
General Discussions
Asked by
Bylar
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or