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

Grid view groupby

4 Answers 57 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Saikiran
Top achievements
Rank 1
Saikiran asked on 01 Jun 2011, 04:31 PM
Hi
Sir/Madam,


I attached 2 files,
in 1st file ,grid is exactly fit into screen . it is OK , but

in 2nd file , when  i perform group by  grid size is decreasing and it is not looking good

Can any one help me about this asap.


Thanks&Regards

Saikiran

4 Answers, 1 is accepted

Sort by
0
Emanuel Varga
Top achievements
Rank 1
answered on 05 Jun 2011, 09:38 AM
Hello,

Have you set the AutoSizeColumnsMode to Fill?

radGridView.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;

Hope this helps, if you have any other questions or comments, please let me know,

Best Regards,
Emanuel Varga

Telerik WinForms MVP
0
Svett
Telerik team
answered on 06 Jun 2011, 12:33 PM
Hi Saikiran,

You can customize the sizing behavior of columns' headers by setting the AutoSizeColumnsMode to GridViewAutoSizeColumnsMode.Fill :

this.radGridView1.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;

If this solution does not fit your requirements, please share with us the way you have initialized the RadGridView control.

 

All the best,
Svett
the Telerik team
Q1’11 SP1 of RadControls for WinForms is available for download; also available is the Q2'11 Roadmap for Telerik Windows Forms controls.
0
Saikiran
Top achievements
Rank 1
answered on 08 Jun 2011, 06:28 AM
Hi,


Thanks.

And next I want to change the alternate color of the Rows in Grid View.

Actually in Windows forms ,we can achieve it by set the properties in following way
GridView.AlternatingRowsDefaultCellStyle.ForeColor = Color.White;
GridView.AlternatingRowsDefaultCellStyle.BackColor = Color.FromArgb(41, 41, 41);
 
GridView.AlternatingRowsDefaultCellStyle.SelectionBackColor = System.Drawing.Color.FromArgb(66, 66, 66);
GridView.AlternatingRowsDefaultCellStyle.SelectionForeColor = Color.White;
but i didn't find any such type of properties in Telerik.
Can u give any idea.

Thanks & Regards
Saikiran
0
Svett
Telerik team
answered on 10 Jun 2011, 03:29 PM
Hi Saikiran,

You should enable the row alternating color by setting the EnableAlternatingRowColor property:

this.radGridView1.EnableAlternatingRowColor = true;

If you want to change the alternating background row color, you should set the AlternatingRowColor property:
this.radGridView1.TableElement.AlternatingRowColor = Color.Red;

If you want to customize the foreground color, you should use the CellFormatting event in this way:
void radGridView1_CellFormatting(object sender, CellFormattingEventArgs e)
{
    if (e.Row.IsOdd)
    {
        e.CellElement.ForeColor = Color.Yellow;
    }
    else
    {
        e.CellElement.ResetValue(LightVisualElement.ForeColorProperty, ValueResetFlags.Local);
    }
}

I hope this helps.

Regards,
Svett
the Telerik team
Q1’11 SP1 of RadControls for WinForms is available for download; also available is the Q2'11 Roadmap for Telerik Windows Forms controls.
Tags
GridView
Asked by
Saikiran
Top achievements
Rank 1
Answers by
Emanuel Varga
Top achievements
Rank 1
Svett
Telerik team
Saikiran
Top achievements
Rank 1
Share this question
or