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

Quit some properties

2 Answers 88 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Andrés David Santacoloma Isaza
Top achievements
Rank 1
Andrés David Santacoloma Isaza asked on 12 Oct 2010, 11:42 PM
Hi:
I need to quit some properties of my gridview. For example quit the reorder columns.
Thanks

2 Answers, 1 is accepted

Sort by
0
Emanuel Varga
Top achievements
Rank 1
answered on 13 Oct 2010, 04:39 AM
Hello Andres,

What do you mean by quit some properties? Disable some actions?

If yes, you could just set AllowColumnReorder to false;
or if you just want to cancel the reorder operation you can subscribe to the MasterTemplate.Columns.CollectionChanging event, and cancel in case of a move, or do additional checks there.
radGridView1.MasterTemplate.Columns.CollectionChanging += new Telerik.WinControls.Data.NotifyCollectionChangingEventHandler(Columns_CollectionChanging);    
void Columns_CollectionChanging(object sender, Telerik.WinControls.Data.NotifyCollectionChangingEventArgs e)
{
    if (e.Action == NotifyCollectionChangedAction.Move)
    {
        e.Cancel = true;
    }
}

Hope this helps, if you have any other questions or comments, please let me know,

Best Regards,
Emanuel Varga
0
Accepted
Svett
Telerik team
answered on 15 Oct 2010, 07:50 AM
Hi Andrés David Santacoloma Isaza,

Another options to prevent reordering of columns is by setting the AllowColumnReorder property to false:


this
.radGridView1.MasterGridViewTemplate.AllowColumnReorder = false;


Best wishes,
Svett
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
Andrés David Santacoloma Isaza
Top achievements
Rank 1
Answers by
Emanuel Varga
Top achievements
Rank 1
Svett
Telerik team
Share this question
or