IGridEditableColumn

4 posts, 0 answers
  1. Kyle Jones
    Kyle Jones avatar
    30 posts
    Member since:
    Jul 2009

    Posted 13 Aug 2009 Link to this post

    Hey,

    I have a RadGrid on my page and I am trying to access the information that I am editting and I am having a problem with the TemplateColumn.  This is the code that I am using to traverse through a Grid that is all text and it works great but when I try to edit it to work on Template Columns I keep getting that the column is null when it has Data in it.  Just so you know that when I am using a TemplateColumn I have a RadComboBox inside it and that is what I am trying to grab the information from when i am updating or inserting.  I am making the change to make the editor be a RadComboBox but it is still giving me null values when there is data in my ComboBox.

    foreach (GridColumn column in e.Item.OwnerTableView.RenderColumns)
    {
    if (column is IGridEditableColumn)
    {
    IGridEditableColumn editableCol = (column as IGridEditableColumn);
    if (editableCol.IsEditable)
    {
    IGridColumnEditor editor = editManager.GetColumnEditor(editableCol);
    if (editor is GridTextColumnEditor)
    {
    if (Decimal.Parse((editor as GridTextColumnEditor).Text) > 0)
    {
    offerValues[i] = Decimal.Parse((editor as GridTextColumnEditor).Text);
    i++;
    }
    else
    {
    status = false;
    }
    }
    }
    }
    }
  2. Tsvetoslav
    Admin
    Tsvetoslav avatar
    1823 posts

    Posted 14 Aug 2009 Link to this post

    Hello Kyle,

    Could you provide more information on your scenario. What event do you traverse the columns in and what exactly is the purpose of accessing the information in the columns.

    Regards,
    Tsvetoslav
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Kyle Jones
    Kyle Jones avatar
    30 posts
    Member since:
    Jul 2009

    Posted 14 Aug 2009 Link to this post

    No Problem.  What I am trying to do is I have a grid that has some data in it and I am letting users edit that data that is in the columns.  The code that I provided I am using on a different page for the same reason but it just has textboxes.  This time around my gird has two template columns that have radcomboboxes in them that users are still allowed to change to information in and I have 2 gridbound with the standard text box that comes with it and 2 numericcolumns.  So I have 5 columns that can be edited and I am trying to figure out how to re-write the code that I provided so that I can grab the information off the grid and update my database when someone changes the information and wants it saved.
  5. Tsvetoslav
    Admin
    Tsvetoslav avatar
    1823 posts

    Posted 19 Aug 2009 Link to this post

    Hello Kyle,

    Do you put the rows you need to update in EditMode? If so, you can attach an event handler to the UpdateCommand event and extract the information through ExtractValue method of the coming event-args object Item property (you need to cast e.Item to GridEditableItem or GridEditFormItem).

    If you have any other custom logic of updating the records, you need to traverse the rows  - the grid's Items collection, and not the columns. How exactly you should manipulate the latter depends on your particular scenario.

    I hope this information helps.

    Regards,
    Tsvetoslav
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Back to Top