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

Set visible for Adding new record button in code behind

3 Answers 268 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mark
Top achievements
Rank 1
Mark asked on 24 Nov 2010, 02:10 AM
Hi everyone,
I'm very new to ASP.NET.
Currently I'm doing a project that require CommandItemSettings-ShowAddNewRecordButton to be set hidden by default and will be set to visible (myGrid.MasterTableView.CommandItemSettings.ShowAddNewRecordButton = true) after validate the user credentials successful in the code behind C#. However, I encounter the problem where it won't be showed as visible unless there is an action on the page/grid to refresh(like a post back event, etc).
So is there a solution to by pass this problem?

Thanks a lot.

3 Answers, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 24 Nov 2010, 05:39 AM
Hello Mark,

You need to Rebind the grid after setting myGrid.MasterTableView.CommandItemSettings.ShowAddNewRecordButton = true.

myGrid.MasterTableView.CommandItemSettings.ShowAddNewRecordButton = true;
myGrid.MasterTableView.Rebind();

Thanks,
Princy.
0
Mark
Top achievements
Rank 1
answered on 24 Nov 2010, 06:05 AM
Hi Princy,

Thanks a lot for your help, it solves the problem.

Cheers,
Mark
0
Sayle
Top achievements
Rank 1
answered on 18 Jun 2012, 09:25 PM
Hi Princy,

Thanks a lot for your help, you solved my problem as well...

-Miles
Tags
Grid
Asked by
Mark
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Mark
Top achievements
Rank 1
Sayle
Top achievements
Rank 1
Share this question
or