🙂 İNSANLARIN EN HAYIRLISI INSANLARA FAYDALI OLANDIR 🙂

Ramazan HABER / C# DEVEXPRESS RMOS / gridview popup image ToolTip to show an image for each data row resim

1-) C# DEVEXPRESS RMOS - gridview popup image ToolTip to show an image for each data row

 

1-) ilk adım olarak devexpresin tooltipcontrollerini indir ve GetActiveObjectInfo eventını kullan

 

 

  private void toolTipController1_GetActiveObjectInfo(object sender, DevExpress.Utils.ToolTipControllerGetActiveObjectInfoEventArgs e)

        {

            try

            {

                if (e.Info == null && e.SelectedControl == gridControlTeknikBilgiler)

                {

                    GridView view = gridControlTeknikBilgiler.FocusedView as GridView;

                    GridHitInfo info = view.CalcHitInfo(e.ControlMousePosition);

                    if (info.InRowCell)

                    {

                        string text = view.GetRowCellDisplayText(info.RowHandle, "image");

                        if (!text.Equals("")) // resim linkidir

                        {

                            var request = WebRequest.Create(text);

                            Image image = null;

                            using (var response = request.GetResponse())

                            using (var stream = response.GetResponseStream())

                            {

                                image = Bitmap.FromStream(stream);

                            }

 

                            string cellKey = info.RowHandle.ToString() + " - " + info.Column.ToString();

                            ToolTipControlInfo toolTipInfo = new ToolTipControlInfo(cellKey, text);

                            SuperToolTip superTip = new SuperToolTip();

                            superTip.Items.Add(new ToolTipItem() { Image = image });

                            toolTipInfo.SuperTip = superTip;

                            e.Info = toolTipInfo;

                        }

                    }

                }

            }

            catch (Exception ex)

            {

 

            }

        }

 

 

2-) EKRAN GÖRÜNTÜSÜ

 

 

3-) KAYNAK : https://supportcenter.devexpress.com/ticket/details/t525262/tooltip-to-show-an-image-for-each-data-row

 2022 Haziran 11 Cumartesi
 416