0
votes

I want to show the cell value of AspxGridview in Tooltip. I tried it using HtmlDataCellPrepared event but it shows database values not the grid cell values. i.e I am displaying the Value field in grid and storing Value field in database. When I hover the mouse on the cell it shows Value field in Tooltip. I have attached the screen shot kindly check it.

enter image description here

  <dx:GridViewDataComboBoxColumn FieldName="CartType" PropertiesComboBox-TextField="" VisibleIndex="4" Settings-FilterMode="DisplayText"
                            Width="8%" Settings-AutoFilterCondition="Contains" Caption="Cart Type" PropertiesComboBox-Width="150px"
                            HeaderStyle-Font-Bold="true" CellStyle-HorizontalAlign="Left"
                            PropertiesComboBox-IncrementalFilteringMode="StartsWith" Settings-AllowAutoFilter="True">
                            <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Font-Bold="True" Wrap="True"></HeaderStyle>
                            <CellStyle HorizontalAlign="Left" VerticalAlign="Middle" Wrap="True"></CellStyle>
                            <PropertiesComboBox Width="250px" ValueField="Id" TextField="Type" ValueType="System.Int32" ClientSideEvents-KeyPress="disableenterkey">
                                <ValidationSettings ErrorTextPosition="Bottom" ErrorDisplayMode="Text">
                                    <RequiredField ErrorText="Select Cart Type" IsRequired="true" />
                                </ValidationSettings>
                            </PropertiesComboBox>
                            <EditFormSettings VisibleIndex="2" Caption="Cart Type" />
                        </dx:GridViewDataComboBoxColumn>
1
what is the difference between database value and cell value in your case? how is the cell value computed? Is Cart Type some kind of enumeration where 2 is the key and Food Cart is the desired value to show in your example? Could you also show to us the HtmlDataCellPrepared event code you have used? - jambonick
if (e.DataColumn.FieldName == "CartType") { if (e.CellValue != null) e.Cell.ToolTip = e.CellValue.ToString(); } - user7095098
is CartType field some kind of enumeration? Is 2 the value in database and you wish to display "FoodCart"? - jambonick
i have added my aspx page in question tag. Cart type is bind from xml. No this is not enumeration - user7095098

1 Answers

0
votes

e.CellValue contains always the ValueField value, that is ID field in your condition, while you wish to show the TextField value. Try this code in your HtmlDataCellPreparedEvent

e.Cell.ToolTip = (e.DataColumn as GridViewDataComboBoxColumn).PropertiesComboBox.Items.FindByValue(e.CellValue).Text;

You can also check this out https://www.devexpress.com/Support/Center/Question/Details/T119004