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

Alignments Getting changed When Hiding Edit Column

7 Answers 66 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Vijay
Top achievements
Rank 2
Vijay asked on 22 Aug 2011, 03:29 PM
Hi Telerik Team,


 Its been a great Pleasure to Work with u r Telerik Controls.i have been using Telerik Controls from past one year and i feel so comfortable with u r controls.Thanks for that

My issue here is that When i'm trying to hide a EditcommandColumn through Code behind, its changing the Alignments  of the other columns..can u please help me in this issue

Code i used in Item Data bound Event
 if (e.Item is GridEditableItem && !(e.Item.IsInEditMode))
 {
            GridDataItem dataItem = e.Item as GridDataItem;
            dataItem["EditColumn"].Visible = false;
 }


Thanks,
Vijay

7 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 23 Aug 2011, 06:33 AM
Hello Vijay,

I tried the following code snippet and it worked as expected.
C#:
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
 {
  if (e.Item is GridEditableItem && !(e.Item.IsInEditMode))
    {
      GridEditableItem dataItem = e.Item as GridEditableItem;
      dataItem["EditColumn"].Visible = false;
    }
 }

Thanks,
Shinu.
0
Vijay
Top achievements
Rank 2
answered on 23 Aug 2011, 06:39 AM
Hi Shinu,

    That Code Works fine When the Grid is View Mode ..When u keep the RadGrid Edit mode in  "InPlace"  and then try to add a new Record With some records already there in grid...and then see the alignments,they are gettting Changed.
    Please look into this .

Thanks,
Vijay.
0
Pavlina
Telerik team
answered on 23 Aug 2011, 08:30 AM
Hi Vijay,

Does hiding the EditColumn by setting its Display property to false (instead of Visible = false) makes a difference? If this does not help, I will appreciate if you provide a live url or a sample project where this discrepancy can be observed. Thus I will do my best to provide more to-the-point answer/solution for your case.

Greetings,
Pavlina
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

0
Vijay
Top achievements
Rank 2
answered on 23 Aug 2011, 02:31 PM
Hi Pavlina,

Thanks For the Quick Response. i have tried by setting property "Display=False"  but  this is making the save and cancel buttons also to hide .  Please look at the attached file to see the scenario that i ' m facing

Thanks,
Vijay.
0
Pavlina
Telerik team
answered on 25 Aug 2011, 01:06 PM
Hi Vijay,

Try setting MasterTableView TableLayout  property to Fixed and see if it makes any difference.

All the best,
Pavlina
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

0
Vijay
Top achievements
Rank 2
answered on 26 Aug 2011, 07:41 AM
Hi Pavlina,

Thanks for the Reply.As per u r suggestion if i keep MasterTableLayout Property to Fixed ...then it equally shares column width among the columns in radgrid..but i have defined some custom widths to each column in my grid so i cant use that property..

Vijay.
0
Pavlina
Telerik team
answered on 26 Aug 2011, 04:34 PM
Hi Vijay,

Can you send us a runnable version of the project, so we can test it locally and find the cause of the described problem?

Kind regards,
Pavlina
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Tags
Grid
Asked by
Vijay
Top achievements
Rank 2
Answers by
Shinu
Top achievements
Rank 2
Vijay
Top achievements
Rank 2
Pavlina
Telerik team
Share this question
or