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

Don't allow record editing but allow new rows

4 Answers 61 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Gompje
Top achievements
Rank 1
Gompje asked on 20 May 2010, 12:32 PM
Hi,

In a SL4 application that I am building I need a grid which allows the user to add new rows but he may not update existing rows.

So far I see this scenario is not possible?
If I specify "isreadonly" the user cannot update (which is good) but he also cannot insert a new row (=bad). Even doh I've specified that this is allowed and the button is also visible, but is not working. The not working is caused by the "readonly"
Leaving the readonly off and not saving any updated data is an option but a confusing one for the user.

Before I create a custom routine to add new records, I wanted to know if I can achieve this scenario out-of-the-box ?

tx!


4 Answers, 1 is accepted

Sort by
0
Gompje
Top achievements
Rank 1
answered on 21 May 2010, 04:34 PM
If somebody would have a build in solution, I would still like to hear it :).
I've just create a popupform so..

thanks anyway
0
Milan
Telerik team
answered on 24 May 2010, 07:21 AM
Hello Gompje,

You can use the BeginningEdit event to workaround the limitation:

// subscribe for BeginningEdit event
void gridView_BeginningEdit(object sender, GridViewBeginningEditRoutedEventArgs e)
{
    if (this.gridView.Items.CurrentAddItem != e.Row.Item)
    {
        e.Cancel = true;
        return;
    }
}


Regards,
Milan
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.
0
Gompje
Top achievements
Rank 1
answered on 26 May 2010, 09:26 AM
Tx for the suggestion, but I think the custom popup solution is more userfriendly. So I stick with that for now ...
0
Sri
Top achievements
Rank 1
answered on 18 May 2011, 02:15 PM
this help me and worked perfect thanx Milan
Tags
GridView
Asked by
Gompje
Top achievements
Rank 1
Answers by
Gompje
Top achievements
Rank 1
Milan
Telerik team
Sri
Top achievements
Rank 1
Share this question
or