Unplanned
Last Updated: 19 Jun 2017 11:07 by ADMIN
ADMIN
Dess | Tech Support Engineer, Principal
Created on: 16 May 2017 12:47
Category: GridView
Type: Feature Request
2
ADD. RadGridView - expose property for the GridGroupExpanderCellElement to control the expander alignment
Workaround:

 private void RadForm1_Load(object sender, EventArgs e)
 {
     this.categoriesTableAdapter.Fill(this.nwindDataSet.Categories);
     this.productsTableAdapter.Fill(this.nwindDataSet.Products);


     radGridView1.AutoGenerateHierarchy = true;
     radGridView1.DataSource = this.nwindDataSet;
     radGridView1.DataMember = "Categories";

     radGridView1.Rows[0].IsExpanded = !radGridView1.Rows[0].IsExpanded;
     radGridView1.Rows[0].IsExpanded = !radGridView1.Rows[0].IsExpanded;
 }
  
 Image expandedSign;
 Image collapsedSign;
 private void radGridView1_ViewCellFormatting(object sender, CellFormattingEventArgs e)
 {
     GridGroupExpanderCellElement expanderCell = e.CellElement as GridGroupExpanderCellElement;
     if (expanderCell != null)
     {
         if (expandedSign == null && expanderCell.Expander.SignImage != null && e.Row.IsExpanded == false)
         {
             expandedSign = expanderCell.Expander.SignImage.Clone() as Image;

         }
         if (collapsedSign == null && expanderCell.Expander.SignImage != null && e.Row.IsExpanded == true)
         {
             collapsedSign = expanderCell.Expander.SignImage.Clone() as Image;

         }
         if (expandedSign != null && collapsedSign != null)
         {
             expanderCell.Expander.SignImage = null;
         }
         if (e.Row.IsExpanded)
         {
             expanderCell.Expander.Image = collapsedSign;
         }
         else
         {
             expanderCell.Expander.Image = expandedSign;
         }

         expanderCell.Expander.ImageLayout = ImageLayout.None;
         expanderCell.Expander.DrawImage = true;
         expanderCell.Expander.ImageAlignment = ContentAlignment.TopLeft;

     }
 }
0 comments