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

update values on edit mode

1 Answer 35 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Alon Agmon
Top achievements
Rank 1
Alon Agmon asked on 06 Jun 2010, 08:56 PM
Hi,
I have the following scenario ...
i have a custom column comprised of a custom control: a button & a text field
i need to supply a Java script visible function that will enter a value on the current cell that is in edit mode..
how can i achieve that ?
basically i just need to check if there a certain field in edit mode and than change the field value ... 

kindest regards 
Alon.

1 Answer, 1 is accepted

Sort by
0
Accepted
Veselin Vasilev
Telerik team
answered on 08 Jun 2010, 04:17 PM
Hello Alon Agmon,

If I understood correctly, you want that when a cell enters edit mode - to show a custom text in the input.
You can achieve this without javascript - simply inherit the GridViewDataColumn class and override the CreateCellEditElement:

public class MyColumn : GridViewDataColumn
{
    public override FrameworkElement CreateCellEditElement(GridViewCell cell, object dataItem)
    {
        return new TextBox() { Text = "Enter the new value here" };        
    }
}

<telerik:RadGridView.Columns>
    <local:MyColumn DataMemberBinding="{Binding Text}" ></local:MyColumn>
</telerik:RadGridView.Columns>

Let me know if I misunderstood something.

Sincerely yours,
Veskoni
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
GridView
Asked by
Alon Agmon
Top achievements
Rank 1
Answers by
Veselin Vasilev
Telerik team
Share this question
or