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

[Solved] how to find particular delete cloumn in rad grid

4 Answers 91 Views
Grid
This is a migrated thread and some comments may be shown as answers.
shanker bangari
Top achievements
Rank 1
shanker bangari asked on 05 Mar 2010, 07:24 PM
Hi,

this is shanker am doing one application my requirement is am catch particular delete column in rad grid in pretender event 

this is my code 

how to find

protected void fulldaygrid_PreRender(object sender, EventArgs e)
        {
            for (int i = 0; fulldaygrid.Items.Count > i; i++)
            {
                if(fulldaygrid.Items[i].Cells[6].Text=="YES")
                {
                    GridColumn deleteColumn = fulldaygrid.MasterTableView.Items[i].Cells[0].GetColumn("DeleteCommandColumn");
                    if (deleteColumn != null) { deleteColumn.Visible = true; }
                   
                }
               
            }
           
        }

please send solution 

thanks and regards
shanker.b

4 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 05 Mar 2010, 09:59 PM
Hello Shanker,

There are several ways to get the desired column. The code-snippet below demonstrates how to achieve this using the GetColumn method:
protected void Page_PreRender(object sender, EventArgs e)
{
    GridColumn myColumn = RadGrid1.MasterTableView.GetColumn("myColumnName");
    //...
}

Regards,
Daniel
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
shanker bangari
Top achievements
Rank 1
answered on 06 Mar 2010, 09:14 AM
Hi

thank you for your response .I know that solution But my requirement is particular row delete column, just like  particular index column 
how to catch  that  
this is my code

 protected void fulldaygrid_PreRender(object sender, EventArgs e)
        {
            for (int i = 0; fulldaygrid.Items.Count > i; i++)
            {
                if (fulldaygrid.Items[i].Cells[6].Text == "YES")
                {
                    GridButtonColumn button = fulldaygrid.Items[i].FindControl("delete") as GridButtonColumn;
                    button.Visible = true;

                }

            }
           
        }
0
Princy
Top achievements
Rank 2
answered on 08 Mar 2010, 07:54 AM
Hi,

Please try the code snippet below to access  the GridButtonColumn for a particular row and set the control visibility to false:

ASPX:
  <telerik:GridButtonColumn CommandName="Delete" Text="Delete" UniqueName="DeleteColumn"></telerik:GridButtonColumn> 

C#
RadGrid1.MasterTableView.Items[0]["DeleteColumn"].Controls[0].Visible = false


Hope this helps.

Thanks,
Princy
0
shanker bangari
Top achievements
Rank 1
answered on 08 Mar 2010, 11:53 AM
Hi,

This is shanker am doing project my problem is "Editmode=Inplace " is working this below code

 protected void transactiontyperadgrud_ItemDataBound(object sender, GridItemEventArgs e)
        {
            if (e.Item.IsInEditMode)
            {

                if (e.Item.OwnerTableView.IsItemInserted)
                {
                    int index = transactiontyperadgrud.Columns.FindByUniqueName("active").OrderIndex;
                    CheckBox chk = e.Item.Cells[index].Controls[0] as CheckBox;
                    if (chk != null)
                    {
                        chk.Checked = true;
                    }
                }
            }
        }
than 
"Editmode=Editfroms"  it,s not working am face the errors is out of index value .

How to solve that please it,s argent

thanks and regards
shanker.B
Tags
Grid
Asked by
shanker bangari
Top achievements
Rank 1
Answers by
Daniel
Telerik team
shanker bangari
Top achievements
Rank 1
Princy
Top achievements
Rank 2
Share this question
or