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

updatecommand when grid bind ot a collection list instead of dataset

1 Answer 43 Views
Grid
This is a migrated thread and some comments may be shown as answers.
JJ
Top achievements
Rank 1
JJ asked on 14 Sep 2011, 08:10 PM
I have a radgrid, bind to a collection list ( a list of data entitis).

One the grid_update command, GridTextBoxColumnEditor editor = (GridTextBoxColumnEditor)editMan.GetColumnEditor("Notes") returns "specificied argument was out of the range of valid value" error. But Notes is one of the item in my Collection class. Why?

radgrid update won't work for collection?


protected void rgDesigLevel_UpdateCommand(object sender, GridCommandEventArgs e)
       {
           
             
           switch (e.Item.OwnerTableView.Name)
           {
               case "Master":
                 
                   string Level1Notes="";
                   CustomerFileHistoryManager cfhm = new CustomerFileHistoryManager();
                   foreach (GridDataItem item in rgDesigLevel.EditItems)
                   {
                       Int32 AuditCustomerId = Convert.ToInt32(item.GetDataKeyValue("ID"));
                       GridEditManager editMan = item.EditManager;
                       GridTextBoxColumnEditor editor = (GridTextBoxColumnEditor)editMan.GetColumnEditor("Notes");
                       Level1Notes = editor.TextBoxControl.Text;
                       cfhm.UpdatePreProcNotes(AuditCustomerId, Level1Notes);
                   }
                   break;                       
           }
       }
   }
Thanks

1 Answer, 1 is accepted

Sort by
0
Mira
Telerik team
answered on 19 Sep 2011, 02:03 PM
Hello JJ,

Please make sure that the UniqueName of the corresponding column in the RadGrid is Notes as well.
You can see how to work with column editors here.

I hope this helps.

Best wishes,
Mira
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal
Tags
Grid
Asked by
JJ
Top achievements
Rank 1
Answers by
Mira
Telerik team
Share this question
or