Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
195
Wingrid basic questions
posted

Hi,

I am new to Infragistics Grid. I have following basic questions. My grid is not bound design time. It will display search results based on user selection in Search form. I bind it using grid.datasource = mydatasourceTable.

1. How can I hide some of the columns I am pulling in my datasource table?

2. How can I convert cells of one column into checkboxes?

3. How can I change column headings for this column?

 

This is a single band grid and no hierarchical data.  Will appreciate any suggestions you may have.

thank you,

Yogesh

Parents
  • 69832
    Suggested Answer
    Offline posted

    1. Handle InitializeLayout and set the Hidden property on the columns you don't want to present to the user:

    private void ultraGrid_InitializeLayout(object sender, InitializeLayoutEventArgs e)
    {
        ColumnsCollection columns = e.Layout.Bands[0].Columns;
        foreach( UltraGridColumn column in columns )
        {
            string columnKey = column.Key;

            switch ( columnKey )
            {
                //  Hide the column
                case "Whatever":
                    column.Hidden = true;
                    break;
            }
        }
    }

     

    2. If the data is boolean, the column will automatically select a CheckEditor as the default embeddable editor/renderer for the column, so in that case you don't have to do anything. If the data is not convertible to boolean, you can use a data filter, and demonstrated in this KB article.

    3. You can also use InitializeLayout for this, as demonstrated by the code in #1. In this case, you would set the UltraGridColumn.Header.Caption property.

Reply Children
No Data