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

RadGrid and custom toolbar buttons

1 Answer 150 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Luci
Top achievements
Rank 1
Luci asked on 24 Jun 2008, 09:37 AM
Hello,
I have 3 standard toolbar buttons Insert/Edit/Delete and I would like to enable them  accordingly, I am using this code but after I insert or edit something, the values of the conditions are good, yet the buttons are still wrongly enabled... What am I doing wrong?

thanks

<asp:LinkButton ID="btnEditSelected" Style="vertical-align: bottom" runat="server"
CommandName="EditSelected" CausesValidation="false"
Enabled='<%# (theGrid.MasterTableView.IsItemInserted && theGrid.EditIndexes.Count == 0 && theGrid.SelectedIndexes.Count > 0 %>'>

<img style="border:0px;vertical-align:middle;" alt="edit..." src="../../Include/Images/grid/Edit.gif" originalAttribute="src" originalPath="../../Include/Images/grid/Edit.gif" /></asp:LinkButton>

<asp:LinkButton ID="btnInitInsert" runat="server"

CommandName="InitInsert" CausesValidation="false"

Enabled='<%# !theGrid.MasterTableView.IsItemInserted && theGrid.EditIndexes.Count == 0 %>'>

<img style="border:0px;vertical-align:middle;" alt="ins..." src="../../Include/Images/grid/Insert.gif" originalAttribute="src" originalPath="../../Include/Images/grid/Insert.gif" /></asp:LinkButton>

<asp:LinkButton ID="btnCancel" runat="server"

CommandName="Delete" CausesValidation="false"

Enabled='<%# !theGrid.MasterTableView.IsItemInserted && theGrid.EditIndexes.Count == 0 && theGrid.SelectedIndexes.Count > 0 %>'>

<img style="border:0px;vertical-align:middle;" alt="del..." src="../../Include/Images/grid/Delete.gif" originalAttribute="src" originalPath="../../Include/Images/grid/Delete.gif" /></asp:LinkButton>


1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 24 Jun 2008, 10:27 AM
Hi,

Go through the following demo link.
Automatic operations

Princy.
Tags
Grid
Asked by
Luci
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or