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
280
UltraWinGrid and displaying a Bitmap in a cell
posted

Hello,

i have a Grid, in which a column shall display a bitmap. The Bitmap is being rendered on the fly, according to some bit mask in a hidden column of that grid.

The column also has a drop down editor control assigned to it, so that i can edit the bitmask for the bitmap.

But unfortunately i cant see a way that prevents the cell displaying the textbox in which one normaly enters text. I dont need to edit the cell directly - only via the drop down control.

How can i inhibit the textbox from being displayed and still being able to have the drop down buttons displayed?

this is the part of my sourcecode that handles those settings:

        private void ultraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e)
        {
            if (!e.Layout.Bands[0].Columns.Exists("GrafikSpalte"))
            {
                e.Layout.Bands[0].Columns.Add("GrafikSpalte");
                e.Layout.Bands[0].Columns["GrafikSpalte"].DataType = typeof(Image);
            }
            EditorWithText ewt = new EditorWithText();
            DropDownEditorButton ddew = new DropDownEditorButton("Kanaele");
            ewt.ButtonsRight.Add(ddew);
            // this is the user control that needs to displayed after dropdown
            ddew.Control = kanalauswahl1;
            e.Layout.Bands[0].Columns["GrafikSpalte"].Editor = ewt;
        }

        private void ultraGrid1_InitializeRow(object sender, InitializeRowEventArgs e)
        {
            e.Row.Cells["GrafikSpalte"].Appearance.ImageBackground = KanalBitmapErzeugen(Convert.ToUInt32(e.Row.Cells["Spalte 1"].Value));
            e.Row.Cells["GrafikSpalte"].Appearance.ImageBackgroundStyle = ImageBackgroundStyle.Stretched;
            //e.Row.Cells["GrafikSpalte"].Value = KanalBitmapErzeugen(Convert.ToUInt32(e.Row.Cells["Spalte 1"].Value));
        }

 

in initializeRow i can either set the cells value or the cells imagebackground to display the desired image.

 

Greetings Wolfgang

Parents Reply Children
No Data