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

format of column at run time

2 Answers 37 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Anjali
Top achievements
Rank 1
Anjali asked on 22 Jun 2012, 05:28 AM
I have set the auto generate columns to true,I need to modify the format of some columns at run time.Which Grid event should I use for this?
Thanks,
Anjali

2 Answers, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 22 Jun 2012, 05:53 AM
Hi Anjali,

You can try to handle AutoGeneratingColumns event of the grid and perform the logic you require inside.
 

Regards,
Maya
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Anjali
Top achievements
Rank 1
answered on 22 Jun 2012, 06:01 AM
Thanks Maya

Can you please elaborate it little more? eg. I want to set the format of my column to  "#,##0"
Following is my Event :

  private void GridCaseList_AutoGeneratingColumn(object sender, GridViewAutoGeneratingColumnEventArgs e)
        {
            if (e.Column.Header.ToString() == "Adjusted_Gain")
            {
                     
          
                //    how to set the format here?????
                }
            }

Tags
GridView
Asked by
Anjali
Top achievements
Rank 1
Answers by
Maya
Telerik team
Anjali
Top achievements
Rank 1
Share this question
or