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

hide EditForm

2 Answers 41 Views
Grid
This is a migrated thread and some comments may be shown as answers.
d-cpt
Top achievements
Rank 2
d-cpt asked on 21 Nov 2008, 02:40 PM
I have a grid that does automatically insert/update/delete. The grid has a GridDropDownColumn which is binded with a DataSet at runtime for user selects the available items. I like to hide the whole EditForm when the DataSet is null (out-of-stock) but only able to hide the dropdownlist. Please lend me some hints.
Thanks in advance.
Regards,
d-cpt.

2 Answers, 1 is accepted

Sort by
0
Accepted
Daniel
Telerik team
answered on 21 Nov 2008, 04:01 PM
Hello d-cpt,

Please test the following approach:

C#
protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e) 
    if (e.CommandName == "Edit" && myDataSet.Tables[0].Rows.Count == 0) 
        e.Canceled = true

VB
Protected Sub RadGrid1_ItemCommand(ByVal source As ObjectByVal e As GridCommandEventArgs) 
    If e.CommandName = "Edit" AndAlso myDataSet.Tables(0).Rows.Count = 0 Then 
        e.Canceled = True 
    End If 
End Sub 

Hope this helps.

Regards,
Daniel
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
d-cpt
Top achievements
Rank 2
answered on 21 Nov 2008, 04:19 PM
It works!!!
Thank you, Daniel.

d-cpt
Tags
Grid
Asked by
d-cpt
Top achievements
Rank 2
Answers by
Daniel
Telerik team
d-cpt
Top achievements
Rank 2
Share this question
or