We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Changing ColHeader when binding to List of Objects and Editing values

Thread ID:

Created:

Updated:

Platform:

Replies:

133087 Oct 9,2017 07:36 AM UTC Oct 10,2017 11:18 AM UTC Windows Forms 1
loading
Tags: GridListControl
Grozer
Asked On October 9, 2017 07:39 AM UTC

When using a list of objects as datasource:

Is it possible to change the shown header of the column?

Like:

    \< displayname("KoArt")\>

    Public Property PosKostenart As Double

And is it possible to edit the Values directly over the grid?


Thanks in advance :)


Arulpriya Ramalingam [Syncfusion]
Replied On October 10, 2017 11:18 AM UTC

Hi Grozer,   
   
Thanks for using Syncfusion products.   
   
By default, the HeaderText for the columns will be updated from the data source of the Grid. In order to change the header text of a column, the PrepareViewStyleInfo event can be used. In that event the Text property can be used to set the HeaderText for a particular column based on index.    
   
Moreover, the GridListControl is used to display the datasource values and its cell’s type is “Static”. So, the GridListControl does not allowed to edit the cell values at run-time.    
Please make use of the below code, KB link and sample,   
   
Code example:  
   
//Event Triggering   
this.gridListControl1.Grid.PrepareViewStyleInfo += Grid_PrepareViewStyleInfo;   
   
//Event Customization   
private void Grid_PrepareViewStyleInfo(object sender,GridPrepareViewStyleInfoEventArgs e)   
{   
    if (e.RowIndex == 0 && e.ColIndex == 3)   
    {   
        e.Style.Text = "Header1";   
    }   
}   
   
   
   
Note   
Please refer to the below UG for choosing the best grid,   
   
Regards,   
Arulpriya   


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;