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

How to access the GridNumericColumn values in Edit Mode.

4 Answers 389 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Sairam
Top achievements
Rank 1
Sairam asked on 17 May 2013, 05:46 AM
 

 <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  .

4 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 17 May 2013, 06:10 AM
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.
0
Sairam
Top achievements
Rank 1
answered on 17 May 2013, 09:04 AM
thanks Princy,It's working
0
Mayur
Top achievements
Rank 1
answered on 09 Oct 2013, 07:44 AM
Hi Princy,

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

Thanks & Regards
Mayur
0
Mayur
Top achievements
Rank 1
answered on 09 Oct 2013, 07:57 AM
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.
Tags
General Discussions
Asked by
Sairam
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Sairam
Top achievements
Rank 1
Mayur
Top achievements
Rank 1
Share this question
or