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

[Solved] how do I check the actual value the record created?

1 Answer 75 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Darren
Top achievements
Rank 2
Darren asked on 18 Jun 2009, 10:51 AM
Hi there,

I'm trying to check what a value is on a column. If the value for a record is say "Approved" within column "Status" then I want to disable the button I have in my template column.

I have something similar with headertext.
    protected void RadGrid1_ColumnCreated(object sender, Telerik.Web.UI.GridColumnCreatedEventArgs e) 
    { 
        switch (e.Column.HeaderText) 
        { 
            case "DetailId"
                e.Column.Display = false
                break
        } 
    } 

Now how do I check the actual value the record? I imagine it's something with the RadGrid1_ItemCreated event.
Please help thanks :)

1 Answer, 1 is accepted

Sort by
0
Accepted
Daniel
Telerik team
answered on 18 Jun 2009, 11:14 AM
Hello Darren,

Test the following code-snippet:
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e) 
    if (e.Item is GridDataItem) 
    { 
        GridDataItem item = e.Item as GridDataItem; 
        if (item["ColumnName"].Text == "something"
            (item.FindControl("myButton"as Button).Enabled = false
    } 

Kind regards,
Daniel
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Grid
Asked by
Darren
Top achievements
Rank 2
Answers by
Daniel
Telerik team
Share this question
or