Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. GridDataitem retrival issue

GridDataitem retrival issue

Scheduled Pinned Locked Moved ASP.NET
helpcssdesign
2 Posts 2 Posters 3 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mark_me
    wrote on last edited by
    #1

    Hi, I have an editformtemplate in a grid. The edit form contains 2 radiobuttons along with other controls. During itemdatabound , i convert the values of this column in grid to yes/no. Now on itemdatabound , when the form goes into edit mode i want to get the yes/no value and after converting to true/false want to populate radiobuttons. I am having problem retrieving the Cell data from the grid in edit mode. The exception is: Telerik.Web.UI.GridNotSupportedException: Item in insert mode does implement indexer only when the edit form is autogenerated at Telerik.Web.UI.GridEditFormInsertItem.get_Item(String columnUniqueName) Code:

    'ItemDatabound code snippet

    Select Case e.Item.ItemType
    
                    Case Telerik.Web.UI.GridItemType.Item, GridItemType.AlternatingItem
    
                        Dim item As Telerik.Web.UI.GridDataItem = e.Item
                        'display Yes/No instead of flag 1,0
                        If CType(item("IsNewProduct").Text, Boolean) = False Then
                            item("IsNewProduct").Text = "NO"
                        Else
                            item("IsNewProduct").Text = "YES"
                        End If
    
    
    
                    Case GridItemType.EditFormItem 'inside template edit form 
    
                        If e.Item.IsInEditMode Then
    
                            'populate controsl on  template edit form
                            Dim item As Telerik.Web.UI.GridEditableItem = e.Item
                            Dim editFormItem As GridEditFormItem = CType(e.Item, GridEditFormItem)
    
                            'Below line throws error, i am trying to retrieve yes, no and chose the correct radiobutton accordingly
                            Dim IsNewProductValue As String = CType(item("IsNewProduct").Text, String) 
                           'Exception is : Telerik.Web.UI.GridNotSupportedException: Item in insert mode does implement indexer only
    		' when the edit form is autogenerated at Telerik.Web.UI.GridEditFormInsertItem.get\_Item(String columnUniqueName) 
    

    i have tried setting item as

    Dim editFormItem As GridEditFormItem = CType(e.Item, GridEditFormItem)
    Dim item As Telerik.Web.UI.GridEditableItem = Ctype(editFormItem.ParentItem,GridDataItem)

    but this also didnt work Please provide help in this regard. Thanks ... Regards

    A 1 Reply Last reply
    0
    • M mark_me

      Hi, I have an editformtemplate in a grid. The edit form contains 2 radiobuttons along with other controls. During itemdatabound , i convert the values of this column in grid to yes/no. Now on itemdatabound , when the form goes into edit mode i want to get the yes/no value and after converting to true/false want to populate radiobuttons. I am having problem retrieving the Cell data from the grid in edit mode. The exception is: Telerik.Web.UI.GridNotSupportedException: Item in insert mode does implement indexer only when the edit form is autogenerated at Telerik.Web.UI.GridEditFormInsertItem.get_Item(String columnUniqueName) Code:

      'ItemDatabound code snippet

      Select Case e.Item.ItemType
      
                      Case Telerik.Web.UI.GridItemType.Item, GridItemType.AlternatingItem
      
                          Dim item As Telerik.Web.UI.GridDataItem = e.Item
                          'display Yes/No instead of flag 1,0
                          If CType(item("IsNewProduct").Text, Boolean) = False Then
                              item("IsNewProduct").Text = "NO"
                          Else
                              item("IsNewProduct").Text = "YES"
                          End If
      
      
      
                      Case GridItemType.EditFormItem 'inside template edit form 
      
                          If e.Item.IsInEditMode Then
      
                              'populate controsl on  template edit form
                              Dim item As Telerik.Web.UI.GridEditableItem = e.Item
                              Dim editFormItem As GridEditFormItem = CType(e.Item, GridEditFormItem)
      
                              'Below line throws error, i am trying to retrieve yes, no and chose the correct radiobutton accordingly
                              Dim IsNewProductValue As String = CType(item("IsNewProduct").Text, String) 
                             'Exception is : Telerik.Web.UI.GridNotSupportedException: Item in insert mode does implement indexer only
      		' when the edit form is autogenerated at Telerik.Web.UI.GridEditFormInsertItem.get\_Item(String columnUniqueName) 
      

      i have tried setting item as

      Dim editFormItem As GridEditFormItem = CType(e.Item, GridEditFormItem)
      Dim item As Telerik.Web.UI.GridEditableItem = Ctype(editFormItem.ParentItem,GridDataItem)

      but this also didnt work Please provide help in this regard. Thanks ... Regards

      A Offline
      A Offline
      Arindam Tewary
      wrote on last edited by
      #2

      These looks like a Telerik grid control related issue. Telerik offers forum for helping out developers who have been using their product. You might get a quick work around if you post this query in telerik forum. Try here [http://www.telerik.com/automated-testing-tools/community/forums/aspnet-ajax/grid/accessing-value-in-onitemdatabound-item-in-insert-mode-does-implement-indexer-only-when-the-edit-form-is-autogenerated.aspx]

      Thanks, Arindam D Tewary

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups