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

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.
.jpg)
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.
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 >>
.jpg)
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.
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 >>
.jpg)
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.
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 >>