How to access the GridNumericColumn values in Edit Mode.

5 posts, 0 answers
  1. Sairam
    Sairam avatar
    56 posts
    Member since:
    May 2013

    Posted 17 May 2013 Link to this post

     

     <telerik:GridNumericColumn UniqueName="c31"  HeaderText="Rate" DataField="c31" DataFormatString="{0:C}"  ColumnGroupName="c3"/>
                        <telerik:GridNumericColumn UniqueName="c32" HeaderText="Hours" DataField="c32" DataFormatString="{0:C}" ColumnGroupName="c3">


    I have above code in  Rad grid view, when i am double click rows  ,The column's are went to   edit mode,I modify the values ,then click on update alert  "yes", Then i want to update the modified values...i am not getting the "How to access particular  grid numeric column values " in Update_command().
    plz help  me ..post the  snippet  .
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 17 May 2013 Link to this post

    Hi,

    Try the following code to access the new values in UpdateCommand
    C#:
    protected void RadGrid1_UpdateCommand(object sender, GridCommandEventArgs e)
    {
        GridEditableItem editItem = e.Item as GridEditableItem;
        Hashtable newValues = new Hashtable();
        e.Item.OwnerTableView.ExtractValuesFromItem(newValues, editItem);
        string rate = newValues["c31"].ToString();
    }

    Thanks,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Sairam
    Sairam avatar
    56 posts
    Member since:
    May 2013

    Posted 17 May 2013 Link to this post

    thanks Princy,It's working
  5. Mayur
    Mayur avatar
    12 posts
    Member since:
    Oct 2013

    Posted 09 Oct 2013 Link to this post

    Hi Princy,

    Can you post the code for accessing GridNumericColumn in ItemCommand PerformInsert event of a RadGrid.

    Thanks & Regards
    Mayur
  6. Mayur
    Mayur avatar
    12 posts
    Member since:
    Oct 2013

    Posted 09 Oct 2013 Link to this post

    Hi Princy,

    Sorry I have done it.

    Actually i was using RadNumericTextBox instead of Normal TextBox.

    I was writting the code :

    Convert.ToInt32((editItem["CityID"].Controls[0] as TextBox).Text);

    which is wrong. I should write. :

    Convert.ToInt32((editItem["CityID"].Controls[0] as RadNumericTextBox).Text)

    This works fine.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017