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

RadGrid programatically add/remove editcolumn on postback

3 Answers 186 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Andreas N.
Top achievements
Rank 2
Andreas N. asked on 10 Jul 2008, 08:08 AM
Hi,

what I would like to do is to add or remove the edit column on postback. I tried setting the AutoGenerateEditColumn property in code without success.

Anyone a suggestion?

Thanks in advance

Andreas

3 Answers, 1 is accepted

Sort by
0
Sebastian
Telerik team
answered on 10 Jul 2008, 08:17 AM
Hello nic77,

You may consider the approach presented in this demo to hide/show the edit column in the grid dynamically on postback/ajax request.

Best regards,
Stephen
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Andreas N.
Top achievements
Rank 2
answered on 10 Jul 2008, 08:23 AM
Thank you Stephen,

I will give it a try, and sorry for cross posting, I did not realise I was in the General Discussions Forum.

Kind regards

Andreas
0
Accepted
Princy
Top achievements
Rank 2
answered on 10 Jul 2008, 11:20 AM
Hi nic77,

You can try the following code snippet in a Button click event.

ASPX:
 <telerik:GridEditCommandColumn UniqueName="EditCommandColumn" Visible="true" ></telerik:GridEditCommandColumn> 

CS:
protected void Button1_Click(object sender, EventArgs e)  
    {  
        RadGrid1.MasterTableView.GetColumn("EditCommandColumn").Visible =!RadGrid1.MasterTableView.GetColumn("EditCommandColumn").Visible;  
        RadGrid1.MasterTableView.Rebind();  
    } 


Thanks
Princy.
Tags
General Discussions
Asked by
Andreas N.
Top achievements
Rank 2
Answers by
Sebastian
Telerik team
Andreas N.
Top achievements
Rank 2
Princy
Top achievements
Rank 2
Share this question
or