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

Hiding the Column during editmode in hierarchical radgrid

5 Answers 68 Views
Grid
This is a migrated thread and some comments may be shown as answers.
VIJAY
Top achievements
Rank 1
VIJAY asked on 18 May 2012, 03:55 PM
How can i hide the control of detailview grid in hierarchical radgrid during the edit mode.
I have used the below cdoe to hide the control in itemdatabound event of grid:
  RadNumericTextBox t1 = (RadNumericTextBox)editItem["StartAge"].Controls[0];
                    t1.NumberFormat.DecimalDigits = 0;
                    t1.NumberFormat.GroupSeparator = "";
                    t1.NumberFormat.AllowRounding = false;
                    editItem["StartAge"].Visible = false;

it is hiding the control but how to hide the header: See below screenshot:

i.e. how to hide the Start Age caption.

5 Answers, 1 is accepted

Sort by
0
Jayesh Goyani
Top achievements
Rank 2
answered on 18 May 2012, 06:31 PM
Hello,

<telerik:GridNumericColumn EditFormHeaderTextFormat="">
                    </telerik:GridNumericColumn>


Thanks,
Jayesh Goyani
0
VIJAY
Top achievements
Rank 1
answered on 21 May 2012, 06:27 AM
how can i hide it from the codebehind as i have done for the gridnumericcolumneditor
0
Shinu
Top achievements
Rank 2
answered on 21 May 2012, 07:00 AM
Hello Vijay,

Try hiding the column using the following code.
C#:
GridEditableItem edititem = (GridEditableItem)e.Item;
edititem["StartAge"].Parent.Visible = false;

Thanks,
Shinu.
0
VIJAY
Top achievements
Rank 1
answered on 21 May 2012, 08:07 PM
How can i show "StartPage" in red color font which indicates that this field in mandatory to be entered during the edit mode.

I want to change font color from codebehind according to a boolean value.
0
Jayesh Goyani
Top achievements
Rank 2
answered on 21 May 2012, 08:31 PM
Hello Vijay,

protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
        {
            if (e.Item.IsInEditMode && e.Item is GridEditableItem)
            {
                GridEditableItem item = e.Item as GridEditableItem;
                // Change title text
                ((item["StartAge"].Parent.Controls[0]) as TableCell).Text = "Your Title";
                // Change title color
                ((item["StartAge"].Parent.Controls[0]) as TableCell).ForeColor = System.Drawing.Color.Red;
            }
        }


Thanks,
Jayesh Goyani
Tags
Grid
Asked by
VIJAY
Top achievements
Rank 1
Answers by
Jayesh Goyani
Top achievements
Rank 2
VIJAY
Top achievements
Rank 1
Shinu
Top achievements
Rank 2
Share this question
or