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

Issue with disabled link button confirm Message

5 Answers 184 Views
Grid
This is a migrated thread and some comments may be shown as answers.
saman
Top achievements
Rank 1
saman asked on 24 Feb 2013, 07:07 AM
<telerik:GridButtonColumn CommandName="Confirm1" ConfirmDialogType="RadWindow" ConfirmText="are you sure?"   ConfirmTitle="Notice" FilterControlAltText="Filter Confirm column" Text="confirm"  UniqueName="Confirm1">  </telerik:GridButtonColumn>
hello
i have this gridbutton 
my problem is when i disable this button in "ItemCreated" from codebehind, its confirm message still be shown!!!
how i can disable its confirm message too?!

tanx
saman

5 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 25 Feb 2013, 04:11 AM
Hi,

Try disabling the cell as shown below.
C#:
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
   {
       if (e.Item is GridDataItem)
       {
           GridDataItem item = (GridDataItem)e.Item;
           TableCell cell = (TableCell)item["Uniquename"];
           cell.Enabled = false;
       }
   }

Thanks,
Shinu
0
saman
Top achievements
Rank 1
answered on 25 Feb 2013, 05:30 AM
hi
first tnx for your attention
i implement your solution but did not work for me!
protected void RadGrid1_OnItemDataBound(object sender, GridItemEventArgs e)
       {
           var grid = sender as RadGrid;
           if (!(e.Item is GridDataItem)) return;
           var Gitem = e.Item as GridDataItem;
           if (!Gitem.OwnerTableView.Name.Contains("Contracts")) return;
           var cell = Gitem["Confirm1"] as TableCell;
           cell.Enabled = false;
       }
0
Accepted
Shinu
Top achievements
Rank 2
answered on 26 Feb 2013, 03:29 AM
Hi,

Please try the following code snippet.

C#:
void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
{      
    if (e.Item is GridDataItem)
    {
       GridDataItem item = e.Item as GridDataItem;
       LinkButton link = (LinkButton)item["Select"].Controls[0];
       link.Enabled = false;
       link.Attributes.Add("onclick", "confirm();return false;");
    }
}

Javascript:
function confirm()
{
    return false;
}

Thanks,
Shinu.
0
saman
Top achievements
Rank 1
answered on 26 Feb 2013, 05:36 AM
yes!!!
thank you very much
This is what I was looking for
0
saman
Top achievements
Rank 1
answered on 26 Feb 2013, 05:37 AM
yes!!!
thank you very much
This is what I was looking for
Tags
Grid
Asked by
saman
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
saman
Top achievements
Rank 1
Share this question
or