The following code is used to remove the expander [+] or [-] for the Hierarchy Tree.
Question: Do you know how to remove the blue square which surrounding the expander as well ?
public void RadGridView_ViewCellFormatting(object sender, CellFormattingEventArgs e)
{
if (e.CellElement is GridGroupExpanderCellElement)
{
GridGroupExpanderCellElement cell = e.CellElement as GridGroupExpanderCellElement;
if (cell != null && e.CellElement.RowElement is GridDataRowElement)
{
if (!IsExpandable(cell.RowInfo))
{
cell.Expander.Visibility = Telerik.WinControls.ElementVisibility.Hidden;
}
else
{
cell.Expander.Visibility = Telerik.WinControls.ElementVisibility.Visible;
}
}
}
}
Thanks Telerik Team =)
I have attached a picture to describe the blue square which surrounding the expander, please take a look !
Question: Do you know how to remove the blue square which surrounding the expander as well ?
public void RadGridView_ViewCellFormatting(object sender, CellFormattingEventArgs e)
{
if (e.CellElement is GridGroupExpanderCellElement)
{
GridGroupExpanderCellElement cell = e.CellElement as GridGroupExpanderCellElement;
if (cell != null && e.CellElement.RowElement is GridDataRowElement)
{
if (!IsExpandable(cell.RowInfo))
{
cell.Expander.Visibility = Telerik.WinControls.ElementVisibility.Hidden;
}
else
{
cell.Expander.Visibility = Telerik.WinControls.ElementVisibility.Visible;
}
}
}
}
Thanks Telerik Team =)
I have attached a picture to describe the blue square which surrounding the expander, please take a look !
8 Answers, 1 is accepted
0
Hi Charles,
Thank you for writing.
I assume that you want to change the mentioned cell back color from blue to something else. If this is so, please refer to the following code snippet:
Let me know if you have further questions.
Kind regards,
Stefan
the Telerik team
Thank you for writing.
I assume that you want to change the mentioned cell back color from blue to something else. If this is so, please refer to the following code snippet:
void
radGridView1_ViewCellFormatting(
object
sender, CellFormattingEventArgs e)
{
if
(e.CellElement
is
GridGroupExpanderCellElement)
{
GridGroupExpanderCellElement cell = e.CellElement
as
GridGroupExpanderCellElement;
if
(cell !=
null
&& e.CellElement.RowElement
is
GridDataRowElement)
{
if
(cell.RowInfo.ChildRows.Count == 0)
{
cell.Expander.Visibility = Telerik.WinControls.ElementVisibility.Hidden;
cell.BackColor = Color.White;
cell.GradientStyle = Telerik.WinControls.GradientStyles.Solid;
}
else
{
cell.Expander.Visibility = Telerik.WinControls.ElementVisibility.Visible;
cell.ResetValue(LightVisualElement.BackColorProperty, Telerik.WinControls.ValueResetFlags.Local);
cell.ResetValue(LightVisualElement.GradientStyleProperty, Telerik.WinControls.ValueResetFlags.Local);
}
}
}
}
Let me know if you have further questions.
Kind regards,
Stefan
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
0
tphan
Top achievements
Rank 1
answered on 21 Feb 2012, 11:23 AM
Hi Stefan,
Is that possible remove the expander empty column Instead of changing the color from blue to white ? so that all columns can shift one column to the left... it will be more perfect !
Thanks!
Charles.
Is that possible remove the expander empty column Instead of changing the color from blue to white ? so that all columns can shift one column to the left... it will be more perfect !
Thanks!
Charles.
0
Hi Charles,
Thank you for writing back.
I am not able to provide you with a solution to remove this column without breaking the layout of the row. What I can offer, is to remove the expander cell right border and the left border of the cell in the first column. However, the white space will remain. Attached you can find a sample project.
I hope that this will work for you.
All the best,
Stefan
the Telerik team
Thank you for writing back.
I am not able to provide you with a solution to remove this column without breaking the layout of the row. What I can offer, is to remove the expander cell right border and the left border of the cell in the first column. However, the white space will remain. Attached you can find a sample project.
I hope that this will work for you.
All the best,
Stefan
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
tphan
Top achievements
Rank 1
answered on 24 Feb 2012, 07:25 PM
Hi Stefan,
Yep ! as you say the empty expander cell still exist... I change the color to Red, so that you can easily to spot the emptry expander cell.
I am pretty appreciate your effort ! I know you have try your best afford.
Thanks!
Charles.
Yep ! as you say the empty expander cell still exist... I change the color to Red, so that you can easily to spot the emptry expander cell.
I am pretty appreciate your effort ! I know you have try your best afford.
Thanks!
Charles.
0
Indeed, the cell is still there as I mentioned in my previous post.
I hope that the proposed solutions will cover your case.
Regards,
Stefan
the Telerik team
I hope that the proposed solutions will cover your case.
Regards,
Stefan
the Telerik team
RadControls for WinForms Q1'12 release is now live! Check out what's new or download a free trial >>
0
tphan
Top achievements
Rank 1
answered on 04 May 2012, 12:22 PM
Hi Stefan,
You answer is helpful... I have a faced another problem is that when the rows are getting large ! the scrolling is become slow....
anyway can improve the performace ?
Thanks.
Charles.
You answer is helpful... I have a faced another problem is that when the rows are getting large ! the scrolling is become slow....
anyway can improve the performace ?
Thanks.
Charles.
0
Hello Charles,
Your latest questions does not concern this thread's subject, so I would like to kindly ask you to open a new thread for your latest questions. Here you can find information describing how to use the forums:
http://www.telerik.com/community/forums/winforms/gridview/important-information-on-using-the-telerik-forums.aspx.
Looking at the case, I would suggest to open a new support ticket with a sample project attached, so we can investigate it and provide you with adequate support.
Regards,
Stefan
the Telerik team
Your latest questions does not concern this thread's subject, so I would like to kindly ask you to open a new thread for your latest questions. Here you can find information describing how to use the forums:
http://www.telerik.com/community/forums/winforms/gridview/important-information-on-using-the-telerik-forums.aspx.
Looking at the case, I would suggest to open a new support ticket with a sample project attached, so we can investigate it and provide you with adequate support.
Regards,
Stefan
the Telerik team
RadControls for WinForms Q1'12 release is now live! Check out what's new or download a free trial >>