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

GridButtonColumn CausesValidation="false"

3 Answers 121 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Gourangi
Top achievements
Rank 1
Gourangi asked on 14 Oct 2008, 11:36 AM
Hi,

How can I set CausesValidation="false" to GridButtonColumn ?

Regards,
Divyesh

3 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 14 Oct 2008, 11:42 AM
Hello Divyesh,

Try out the following code to set the CausesValidation property for a button in a  ButtonColumn.
cs:
 protected void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e) 
    { 
      if (e.Item is GridDataItem) 
        { 
            GridDataItem dataItem = (GridDataItem)e.Item; 
            (dataItem["ButtonColumnUniqueName"].Controls[0] as Button).CausesValidation = false
        } 
    } 

Thanks
Princy.
0
Gourangi
Top achievements
Rank 1
answered on 14 Oct 2008, 12:07 PM
hi Princy,

Things working fine now but its bit confusing means there should be a design time property which does this task.

And even those part of code executed every time though its property was set to false when the page was loaded first time, I mean to say its already false and that itemdatabound is setting the same value again when I click any button !

Thanks
0
Gourangi
Top achievements
Rank 1
answered on 14 Oct 2008, 12:35 PM
hi,

Same problem with Add New Record button i.e. CommandItemDisplay.

Its also need to be set causesvalidation=false.

How to do so?

Regards,
Divyesh
Tags
Grid
Asked by
Gourangi
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Gourangi
Top achievements
Rank 1
Share this question
or